added the text box in the middle. added some content and finish the light and dark mode

This commit is contained in:
Rainyy21
2025-09-15 01:25:18 -04:00
parent afb1f375a8
commit 328e359d35
4 changed files with 118 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
let darkmode = localStorage.getItem('dark')
const switch_button = document.getElementById("theme_switch")
const enableDarkmode = () => {
document.body.classList.add('dark')
localStorage.setItem('darkmode' , 'active')
}
const disableDarkmode = () => {
document.body.classList.remove('dark')
localStorage.setItem('darkmode', null)
}
if(darkmode === 'avtive') enableDarkmode()
switch_button.addEventListener("click", () => {
darkmode = localStorage.getItem('darkmode')
darkmode !== "active" ? enableDarkmode() : disableDarkmode()
})