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

@ -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
// ----------------------------------------------------------