diff options
-rw-r--r-- | share/html_start | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/share/html_start b/share/html_start index 68be715..c44b353 100644 --- a/share/html_start +++ b/share/html_start @@ -16,21 +16,8 @@ old.href = path; } } - var otherTheme = { - 'dark': 'light', - 'light': 'dark', - }; - var currentTheme = localStorage.getItem('theme'); - if (!otherTheme.hasOwnProperty(currentTheme)) { - currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; - } + const currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; addStyleSheet(currentTheme, 'theme'); - - function toggleTheme() { - currentTheme = otherTheme[currentTheme] || 'light'; - localStorage.setItem('theme', currentTheme); - addStyleSheet(currentTheme, 'theme'); - } </script> <script src=".data/js/glightbox.min.js"></script> </head> |