mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-13 22:00:10 +00:00
Harvey Tindall
95db48d8f8
the backend code has been added back in, and the build process has been modified so that no output files are left outside of build/. Admin page loads and logs in correctly, nothing else functionality-wise yet.
13 lines
488 B
TypeScript
13 lines
488 B
TypeScript
export function toggleTheme() {
|
|
document.documentElement.classList.toggle('dark-theme');
|
|
document.documentElement.classList.toggle('light-theme');
|
|
localStorage.setItem('theme', document.documentElement.classList.contains('dark-theme') ? "dark" : "light");
|
|
}
|
|
|
|
export function loadTheme() {
|
|
if (localStorage.getItem('theme') == "dark") {
|
|
document.documentElement.classList.add('dark-theme');
|
|
document.documentElement.classList.remove('light-theme');
|
|
}
|
|
}
|