forked from bluelearn-open-source/blue-quotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdark.js
More file actions
41 lines (31 loc) · 985 Bytes
/
dark.js
File metadata and controls
41 lines (31 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
let darkMode=false;
var dark=document.getElementById("dark");
var moon=document.getElementById("moon");
var sun=document.getElementById("sun");
var nav=document.getElementById("nav");
var body=document.getElementById("body");
dark.addEventListener('click',handleCLick)
function handleCLick(){
if(darkMode===false){
darkMode=true;
moon.style.visibility="hidden";
sun.style.visibility="visible";
dark.style.backgroundColor="white";
body.style.backgroundColor="#414758"
nav.style.backgroundColor="#28292e"
// console.log(nav);
}
else{
darkMode=false;
dark.style.backgroundColor="#2e2f30";
body.style.backgroundColor="#eee"
sun.style.visibility="hidden";
moon.style.visibility="visible";
nav.style.backgroundColor="#dcdee6";
}
// console.log(darkMode);
}
// function handleClick(){
// darkMode=true
// console.log(darkMode)
// }