-
Notifications
You must be signed in to change notification settings - Fork 17
/
about.js
38 lines (28 loc) · 789 Bytes
/
about.js
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
var aboutTheme = document.querySelector("input[name=aboutTheme]");
if( localStorage.getItem("dark") !== undefined )
{
if(localStorage.getItem("dark") === "false")
aboutTheme.checked = false;
else
aboutTheme.checked = true;
}
changeTheme();
aboutTheme.addEventListener("change",(e)=>{
changeTheme();
})
function changeTheme(){
let background = document.getElementById("aboutMain");
let text = document.getElementById("aboutText");
if(aboutTheme.checked)
{
background.style.backgroundColor = "black";
text.style.color = "white";
localStorage.setItem("dark",true);
}
else
{
background.style.backgroundColor = "gray";
text.style.color = "black";
localStorage.setItem("dark",false);
}
}