more refactor in frontend javascript
This commit is contained in:
1 parent
7f7936d37f
commit
b833266664
14 files changed
+2345
-2366
No files matched your search
@@ -0,0 +1,10 @@
|
||||
let currentTheme = localStorage.getItem("theme") || "light";
|
||||
|
||||
// Initialize theme
|
||||
document.body.setAttribute("data-theme", currentTheme);
|
||||
|
||||
function toggleTheme() {
|
||||
currentTheme = currentTheme === "light" ? "dark" : "light";
|
||||
document.body.setAttribute("data-theme", currentTheme);
|
||||
localStorage.setItem("theme", currentTheme);
|
||||
}
|
||||
Reference in new issue
Block a user