Desktop: Einheitliche Seitenbreite 860px via pc-desktop Klasse

- app.js: _applyDesktopWidth() setzt nach Page-Init die Klasse pc-desktop
  auf dem ersten Kind-Div aller Standard-Seiten (excl. admin/map/chat/etc.)
- layout.css: .pc-desktop { max-width:860px !important; margin:0 auto }
- layout.css: .page-container ab 768px auf 860px (statt erst 1024px)
- main.py: /force-update Text "Service Worker wird entfernt" →
  "Wir besorgen neue Leckerlis 🦴"
- layout.css ?v=1013, components.css ?v=1010, SW by-v1014, APP_VER 1014
This commit is contained in:
rene 2026-05-16 09:57:00 +02:00
parent 9816075c7e
commit ed9dd08c14
5 changed files with 39 additions and 9 deletions

View file

@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request):
raise _HE(404, "Nicht gefunden.")
return _media_response(filepath)
APP_VER = "1013" # muss mit APP_VER in app.js übereinstimmen
APP_VER = "1014" # muss mit APP_VER in app.js übereinstimmen
@app.get("/.well-known/assetlinks.json")
async def assetlinks():
@ -1724,8 +1724,8 @@ async def force_update():
height:100vh;margin:0;background:#0f1623;color:#fff;flex-direction:column;gap:16px}
p{color:#94a3b8;font-size:14px}</style></head>
<body>
<div> Aktualisiere Ban Yaro</div>
<p id="s">Service Worker wird entfernt</p>
<div> Einen Moment</div>
<p id="s">Wir besorgen neue Leckerlis 🦴</p>
<script>
// Zweiten Reload durch SW-updatefound verhindern
sessionStorage.setItem('by_skip_sw_reload','1');

View file

@ -535,6 +535,20 @@
margin: 0 auto;
}
/* Desktop: Standard-Container auf 860px erweitern (768px1023px) */
@media (min-width: 768px) {
.page-container { max-width: 860px; }
}
/* Desktop-Breite: von app.js nach Page-Init gesetzt */
@media (min-width: 768px) {
.pc-desktop {
max-width: 860px !important;
margin-left: auto !important;
margin-right: auto !important;
}
}
/* Wide-Layout für Karte und ähnliches */
.page-container-wide {
width: 100%;
@ -589,9 +603,6 @@
============================================================ */
@media (min-width: 1024px) {
/* Etwas breiterer Standard-Container auf großen Screens */
.page-container { max-width: 860px; }
/* Admin: breit + Sidebar-Layout */
#page-admin .page-container { max-width: 1200px; }

View file

@ -102,7 +102,7 @@
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
<link rel="stylesheet" href="/css/design-system.css?v=907">
<link rel="stylesheet" href="/css/layout.css?v=973">
<link rel="stylesheet" href="/css/layout.css?v=1013">
<link rel="stylesheet" href="/css/components.css?v=1010">
</head>
<body>

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1013'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1014'; // ← 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
@ -256,6 +256,8 @@ const App = (() => {
if (mod?.init) {
await mod.init(container, state, params);
page.module = mod;
// Desktop: erste Inhalts-Div auf Standardbreite setzen
_applyDesktopWidth(pageId, container);
} else {
// Platzhalter wenn Seite noch nicht gebaut
container.innerHTML = UI.emptyState({
@ -280,6 +282,23 @@ const App = (() => {
}
}
// ----------------------------------------------------------
// DESKTOP WIDTH — einheitliche Breite auf großen Screens
// ----------------------------------------------------------
const _FULLSCREEN_PAGES = new Set([
'admin','map','chat','forum','wiki','ernaehrung','movies','wurfboerse',
'routes','walks','litters','zucht-profil','widget',
]);
function _applyDesktopWidth(pageId, container) {
if (window.innerWidth < 768) return;
if (_FULLSCREEN_PAGES.has(pageId)) return;
const first = container.querySelector(':scope > div');
if (first && !first.classList.contains('page-container') &&
!first.classList.contains('pc-desktop')) {
first.classList.add('pc-desktop');
}
}
// ----------------------------------------------------------
// LOGIN GATE — wird statt Seiteninhalt angezeigt
// ----------------------------------------------------------

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache
============================================================ */
const CACHE_VERSION = 'by-v1013';
const CACHE_VERSION = 'by-v1014';
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