diff options
author | Botond Hende <nettingman@gmail.com> | 2024-09-07 18:10:54 +0200 |
---|---|---|
committer | Botond Hende <nettingman@gmail.com> | 2024-09-07 18:10:54 +0200 |
commit | b982508df0c4514544c1c5b0fff2573147d34e67 (patch) | |
tree | 94ae75aa01ee96d09bcbbf6797d8846db3fdff70 /assets/js | |
parent | decab05a85ea33eeffe75b6275678463277576b6 (diff) |
light theme support
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/theme.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/assets/js/theme.js b/assets/js/theme.js new file mode 100644 index 0000000..ffb6d48 --- /dev/null +++ b/assets/js/theme.js @@ -0,0 +1,16 @@ +"use strict" +const THEME_KEY = "used-theme"; + +function updateTheme() { + let theme = localStorage.getItem(THEME_KEY); + if (theme != null) { + document.documentElement.setAttribute(THEME_KEY, theme) + } +} + +function setTheme(theme) { + localStorage.setItem(THEME_KEY, theme); + updateTheme(); +} + +updateTheme();
\ No newline at end of file |