summaryrefslogtreecommitdiffci
path: root/views/layouts
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <saya.andy@posteo.com> 2026-05-16 13:18:08 +0700
committerGravatar SayaAndy <saya.andy@posteo.com> 2026-05-16 13:18:08 +0700
commit44b72cbc80fb89788470bda75eeb9c0bb3dee2f5 (patch)
tree1dbc4e1ea6a85a31502c99cbf7bf9ba05b58e653 /views/layouts
parent551295ecacebbb94019def022f70397f74c44775 (diff)
downloadweb-44b72cbc80fb89788470bda75eeb9c0bb3dee2f5.tar.gz
web-44b72cbc80fb89788470bda75eeb9c0bb3dee2f5.zip
feat: all color themes now have light & dark variations depending on preference
feat: color all leaflet elements depending on color theme & scheme feat: change font to m-plus for short description fix: theme wheel position on different dpi screens in global map
Diffstat (limited to 'views/layouts')
-rw-r--r--views/layouts/general-page.html13
1 files changed, 10 insertions, 3 deletions
diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html
index 2d125ae..491c652 100644
--- a/views/layouts/general-page.html
+++ b/views/layouts/general-page.html
@@ -401,15 +401,22 @@
localStorage.setItem("theme", theme);
document.body.setAttribute("data-theme", theme);
switchThemeDecor(theme);
- if (theme == "ram" || theme == "night") {
+ }
+
+ const savedTheme = localStorage.getItem("theme") || "lilac";
+ switchTheme(savedTheme);
+
+ function switchColorScheme(isNightMode) {
+ if (isNightMode) {
makeMultitoneOklch('multitone', 4, '--color-background-dark', '--color-accent-light', '--color-background-light');
} else {
makeMultitoneOklch('multitone', 4, '--color-background-light', '--color-accent-light', '--color-background-dark');
}
}
- const savedTheme = localStorage.getItem("theme") || "lilac";
- switchTheme(savedTheme);
+ const mq = matchMedia('(prefers-color-scheme: dark)');
+ switchColorScheme(mq.matches);
+ mq.addEventListener('change', (e) => switchColorScheme(e.matches));
</script>
<script src="{{ .StaticStorageBaseUrl }}/libs/htmx/2.0.6/htmx.min.js"></script>