-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic.js
More file actions
22 lines (21 loc) · 723 Bytes
/
Copy pathdynamic.js
File metadata and controls
22 lines (21 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let darkMode = false;
function changeTheme() {
let color = "darkgrey";
let rcolor = "white";
if (!darkMode) {
color = "white";
rcolor = "black";
document.body.style.backgroundColor = color;
document.body.style.color = rcolor;
document.getElementsByClassName("topbarcontent")[0].style.backgroundColor =
color;
let a = (document.getElementsByClassName("theme")[4].innerHTML = "🌙");
} else {
document.body.style.backgroundColor = color;
document.body.style.color = rcolor;
document.getElementsByClassName("topbarcontent")[0].style.backgroundColor =
color;
let a = (document.getElementsByClassName("theme")[4].innerHTML = "☀️");
}
darkMode = !darkMode;
}