dark mode. this works ok. not too good but yeah it does.

This commit is contained in:
2025-09-27 22:51:39 +02:00
parent 20dbe662b0
commit 0adabd1ba3
4 changed files with 200 additions and 49 deletions

11
js/shared/theme.js Normal file
View File

@@ -0,0 +1,11 @@
function toggleDarkMode() {
document.body.classList.toggle("dark-mode");
localStorage.setItem("dark-mode", document.body.classList.contains("dark-mode"));
}
// Apply stored preference when the page loads
document.addEventListener("DOMContentLoaded", () => {
if (localStorage.getItem("dark-mode") === "true") {
document.body.classList.add("dark-mode");
}
});