Create darkmode

This commit is contained in:
LSvekis 2021-06-17 16:22:49 -04:00 committed by GitHub
parent e5bf1d2b5a
commit 9709eefda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
chapter10/darkmode Normal file
View File

@ -0,0 +1,13 @@
let darkMode = false;
window.onclick = () => {
console.log(darkMode);
if (!darkMode) {
document.body.style.backgroundColor = "black";
document.body.style.color = "white";
darkMode = true;
} else {
document.body.style.backgroundColor = "white";
document.body.style.color = "black";
darkMode = false;
}
}