This commit is contained in:
2025-09-18 15:31:27 +02:00
commit 2abba0c2b7
406 changed files with 31879 additions and 0 deletions

22
resources/js/theme.js Normal file
View File

@@ -0,0 +1,22 @@
function darkModeListener() {
document.querySelector("html").classList.toggle("dark");
if (localStorage.theme == 'light') {
localStorage.theme = 'dark';
} else {
localStorage.theme = 'light';
}
}
document.querySelector("input[type='checkbox']#toogleTheme").addEventListener("click", darkModeListener);
if(localStorage.theme) {
if (localStorage.theme == 'light') {
if (document.querySelector("html").classList.contains('dark')) {
document.querySelector("html").classList.toggle("dark");
}
document.getElementById("toogleTheme").checked = true;
}
} else {
// Default Dark Theme
localStorage.theme = 'dark';
}