theme/wip
This commit is contained in:
parent
b3c85d93c1
commit
a0167fa4e5
3 changed files with 32 additions and 2 deletions
13
script/main.js
Normal file
13
script/main.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const button = document.getElementById("theme");
|
||||
const classes = document.documentElement.classList;
|
||||
|
||||
function refresh() {
|
||||
button.innerHTML = classes.contains("dark")?"dark":"light";
|
||||
}
|
||||
|
||||
button.addEventListener("click", () => {
|
||||
classes.toggle("dark");
|
||||
refresh();
|
||||
});
|
||||
|
||||
refresh();
|
Loading…
Add table
Add a link
Reference in a new issue