Light- und Darkmode hinzugefügt
Some checks failed
Host-Based Deploy (Java 21 Fix) / build-and-run (push) Has been cancelled

This commit is contained in:
2026-04-28 14:07:32 +02:00
parent 34e5fcd777
commit 843acea652
75 changed files with 830 additions and 511 deletions

View File

@@ -1,4 +1,23 @@
(function () {
// ── Theme-Init (synchron, vor allem anderen) ──────────────────────────────
window._applyTheme = function (theme) {
document.documentElement.setAttribute('data-theme', theme);
};
(function () {
const saved = localStorage.getItem('xxx-theme');
if (saved === 'light' || saved === 'dark') {
window._applyTheme(saved);
} else {
const prefersLight = window.matchMedia('(prefers-color-scheme: light)').matches;
window._applyTheme(prefersLight ? 'light' : 'dark');
}
})();
window.matchMedia('(prefers-color-scheme: light)').addEventListener('change', function (e) {
if (!localStorage.getItem('xxx-theme')) {
window._applyTheme(e.matches ? 'light' : 'dark');
}
});
const path = window.location.pathname;
const I = window.IC || function () { return ''; };