Fix: Karte CSS-Filter statt CartoDB Dark, Social Wrapper 860px
Karte Dark-Mode: - CSS-Filter statt CartoDB Dark Matter (war zu dunkel) invert(93%) hue-rotate(180deg) brightness(0.88) contrast(0.88) saturate(0.85) Gleiche OSM-Tiles, Marker bleiben unbeeinflusst (tilePane separater Layer) - Filter sofort bei Init + bei Theme-Wechsel via MutationObserver Social: - Outer Wrapper width:100%;max-width:860px;margin:0 auto Header-Karte und Tabs sind jetzt konsistent gleich breit SW by-v1023, APP_VER 1023
This commit is contained in:
parent
721e630a34
commit
2cf0bc0d97
5 changed files with 17 additions and 23 deletions
|
|
@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request):
|
||||||
raise _HE(404, "Nicht gefunden.")
|
raise _HE(404, "Nicht gefunden.")
|
||||||
return _media_response(filepath)
|
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")
|
@app.get("/.well-known/assetlinks.json")
|
||||||
async def assetlinks():
|
async def assetlinks():
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
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 APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,10 @@ window.Page_map = (() => {
|
||||||
_tileLayer = _buildTileLayer();
|
_tileLayer = _buildTileLayer();
|
||||||
_tileLayer.addTo(_map);
|
_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 = new MutationObserver(() => _applyTileTheme());
|
||||||
_themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
|
_themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', _applyTileTheme);
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', _applyTileTheme);
|
||||||
|
|
@ -629,28 +632,17 @@ window.Page_map = (() => {
|
||||||
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
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() {
|
function _buildTileLayer() {
|
||||||
if (_isDarkMode()) {
|
return L.tileLayer(_OSM_URL, { maxZoom: 19 });
|
||||||
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 }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _applyTileTheme() {
|
function _applyTileTheme() {
|
||||||
if (!_map || !window.L) return;
|
if (!_map) return;
|
||||||
const dark = _isDarkMode();
|
const tilePaneEl = _map.getPane('tilePane');
|
||||||
const url = dark
|
if (tilePaneEl) tilePaneEl.style.filter = _isDarkMode() ? _DARK_FILTER : '';
|
||||||
? '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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _updateZoomDisplay() {
|
function _updateZoomDisplay() {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ window.Page_social = (() => {
|
||||||
function _render() {
|
function _render() {
|
||||||
const lvlBar = _stats ? _levelBar(_stats) : '';
|
const lvlBar = _stats ? _levelBar(_stats) : '';
|
||||||
_el.innerHTML = `
|
_el.innerHTML = `
|
||||||
|
<div style="width:100%;max-width:860px;margin:0 auto">
|
||||||
<div style="background:var(--c-surface);border-radius:var(--radius-lg);
|
<div style="background:var(--c-surface);border-radius:var(--radius-lg);
|
||||||
box-shadow:var(--shadow-sm);padding:var(--space-4);
|
box-shadow:var(--shadow-sm);padding:var(--space-4);
|
||||||
margin-bottom:var(--space-4)">
|
margin-bottom:var(--space-4)">
|
||||||
|
|
@ -71,7 +72,8 @@ window.Page_social = (() => {
|
||||||
color:${_activeTab===t?'var(--c-primary)':'var(--c-text-secondary)'}">
|
color:${_activeTab===t?'var(--c-primary)':'var(--c-text-secondary)'}">
|
||||||
${l}</button>`).join('')}
|
${l}</button>`).join('')}
|
||||||
</div>
|
</div>
|
||||||
<div id="sm-content"></div>`;
|
<div id="sm-content"></div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
_el.querySelectorAll('.sm-tab').forEach(b =>
|
_el.querySelectorAll('.sm-tab').forEach(b =>
|
||||||
b.addEventListener('click', () => { _activeTab = b.dataset.tab; _render(); }));
|
b.addEventListener('click', () => { _activeTab = b.dataset.tab; _render(); }));
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v1022';
|
const CACHE_VERSION = 'by-v1023';
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue