diff --git a/backend/main.py b/backend/main.py index 841e9e9..d8998a4 100644 --- a/backend/main.py +++ b/backend/main.py @@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "1022" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "1023" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 90197f0..66db314 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '1022'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1023'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/js/pages/map.js b/backend/static/js/pages/map.js index 6774e04..ba23906 100644 --- a/backend/static/js/pages/map.js +++ b/backend/static/js/pages/map.js @@ -533,7 +533,10 @@ window.Page_map = (() => { _tileLayer = _buildTileLayer(); _tileLayer.addTo(_map); - // Theme-Wechsel → Tile-Layer tauschen + // Sofort Dark-Filter anwenden wenn nötig (nach Tile-Load) + _tileLayer.on('load', _applyTileTheme); + _applyTileTheme(); + // Theme-Wechsel → Filter aktualisieren _themeObserver = new MutationObserver(() => _applyTileTheme()); _themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] }); window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', _applyTileTheme); @@ -629,28 +632,17 @@ window.Page_map = (() => { return window.matchMedia('(prefers-color-scheme: dark)').matches; } + const _OSM_URL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + const _DARK_FILTER = 'invert(93%) hue-rotate(180deg) brightness(0.88) contrast(0.88) saturate(0.85)'; + function _buildTileLayer() { - if (_isDarkMode()) { - return L.tileLayer( - 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', - { maxZoom: 19, subdomains: 'abcd' } - ); - } - return L.tileLayer( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - { maxZoom: 19 } - ); + return L.tileLayer(_OSM_URL, { maxZoom: 19 }); } function _applyTileTheme() { - if (!_map || !window.L) return; - const dark = _isDarkMode(); - const url = dark - ? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png' - : 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - if (_tileLayer) { - _tileLayer.setUrl(url); - } + if (!_map) return; + const tilePaneEl = _map.getPane('tilePane'); + if (tilePaneEl) tilePaneEl.style.filter = _isDarkMode() ? _DARK_FILTER : ''; } function _updateZoomDisplay() { diff --git a/backend/static/js/pages/social.js b/backend/static/js/pages/social.js index 010d493..d1af781 100644 --- a/backend/static/js/pages/social.js +++ b/backend/static/js/pages/social.js @@ -43,6 +43,7 @@ window.Page_social = (() => { function _render() { const lvlBar = _stats ? _levelBar(_stats) : ''; _el.innerHTML = ` +
@@ -71,7 +72,8 @@ window.Page_social = (() => { color:${_activeTab===t?'var(--c-primary)':'var(--c-text-secondary)'}"> ${l}`).join('')}
-
`; +
+
`; _el.querySelectorAll('.sm-tab').forEach(b => b.addEventListener('click', () => { _activeTab = b.dataset.tab; _render(); })); diff --git a/backend/static/sw.js b/backend/static/sw.js index 3446297..c830f76 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v1022'; +const CACHE_VERSION = 'by-v1023'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache