Add PWA native feel: manifest, meta tags, install prompt, SW optimization, dynamic theme-color

Configure manifest.json with scope, maskable icons, and categories. Add iOS/Android
meta tags for standalone behavior. Create pwa.css for native touch/scroll handling
and safe area insets. Add oikos-install-prompt Web Component with Chrome install
flow and iOS guidance. Optimize service worker with network-first navigation and
expanded precache (v19). Add dynamic theme-color per route and modal overlay dimming
in standalone mode. Generate placeholder icons via sharp script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas
2026-03-29 15:35:01 +02:00
parent 5838fb9243
commit 41e88e0acf
17 changed files with 1206 additions and 689 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
/**
* Modul: Service Worker Registrierung
* Zweck: Ausgelagert aus index.html um CSP-Inline-Script-Verletzung zu vermeiden
* Zweck: Ausgelagert aus index.html um CSP-Inline-Script-Verletzung zu vermeiden.
* Handhabt nahtlose Updates via controllerchange.
* Abhängigkeiten: keine
*/
@@ -10,4 +11,13 @@ if ('serviceWorker' in navigator) {
console.warn('[SW] Registrierung fehlgeschlagen:', err);
});
});
// Nahtloses Update: Neuer SW hat skipWaiting() + clients.claim() aufgerufen
// → Controller wechselt → Seite neu laden für konsistenten Stand
let refreshing = false;
navigator.serviceWorker.addEventListener('controllerchange', () => {
if (refreshing) return;
refreshing = true;
window.location.reload();
});
}