commitig all before branching

This commit is contained in:
Rainyy21
2025-09-24 20:45:55 -04:00
parent cd7254c58b
commit 2a1ed46ec3
5 changed files with 56 additions and 12 deletions
+13 -11
View File
@@ -1,19 +1,21 @@
let darkmode = localStorage.getItem('dark')
const switch_button = document.getElementById("theme_switch")
let darkmode = localStorage.getItem('dark');
const switch_button = document.getElementById("theme_switch");
const enableDarkmode = () => {
document.body.classList.add('dark')
localStorage.setItem('darkmode' , 'active')
document.body.classList.add('dark');
localStorage.setItem('dark' , 'active');
}
const disableDarkmode = () => {
document.body.classList.remove('dark')
localStorage.setItem('darkmode', null)
}
document.body.classList.remove('dark');
localStorage.removeItem('dark');
};
if(darkmode === 'avtive') enableDarkmode()
if (darkmode === 'active') enableDarkmode();
switch_button.addEventListener("click", () => {
darkmode = localStorage.getItem('darkmode')
darkmode !== "active" ? enableDarkmode() : disableDarkmode()
})
darkmode = localStorage.getItem('dark');
darkmode !== "active" ? enableDarkmode() : disableDarkmode();
});