move js for Dark Mode button to custom.js in /_includes

This commit is contained in:
ZanzyTHEbar 2022-05-10 21:41:38 +02:00
parent 9907e276dc
commit bb57ec595d
2 changed files with 18 additions and 22 deletions

View File

@ -2,24 +2,3 @@
<a href="javascript:toggleDetect()" title="Switching Schemes" class="btn btn-mode fs-2 mb-1 mb-md-0 mr-0" <a href="javascript:toggleDetect()" title="Switching Schemes" class="btn btn-mode fs-2 mb-1 mb-md-0 mr-0"
id="switch-mode">Dark Mode</a> id="switch-mode">Dark Mode</a>
</ul> </ul>
<script type="text/javascript">
var isClicked = false;
async function toggleDetect() {
if (isClicked == false) {
isClicked = true;
}
else {
isClicked = false;
}
await switchScheme(isClicked);
};
async function switchScheme(isClicked) {
if (isClicked == true) {
jtd.setTheme("eyetrackvr");
}
else {
jtd.setTheme("light");
}
}
</script>

View File

@ -0,0 +1,17 @@
var isClicked = false;
async function toggleDetect() {
if (isClicked == false) {
isClicked = true;
} else {
isClicked = false;
}
await switchScheme(isClicked);
}
async function switchScheme(isClicked) {
if (isClicked == true) {
jtd.setTheme("eyetrackvr");
} else {
jtd.setTheme("light");
}
}