PWA: Manifest, Service Worker, Icons und Offline-Seite

This commit is contained in:
OpenCode 2026-11-13 00:46:02 +01:00
parent ec88c8ebac
commit 67a1614081
19 changed files with 472 additions and 5 deletions

View file

@ -21,12 +21,21 @@ $navActive = static function (string $area) use ($path): string {
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#196abc">
<meta name="color-scheme" content="light">
<meta name="csrf-token" content="<?= e(csrf_token()) ?>">
<meta name="sw-url" content="<?= e(url('/sw.js')) ?>">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="Drink it cold">
<meta name="application-name" content="Drink it cold">
<title><?= e($title) ?> · Drink it cold</title>
<link rel="manifest" href="<?= e(url('/manifest.webmanifest')) ?>">
<link rel="icon" type="image/svg+xml" href="<?= e(asset('favicon.svg')) ?>">
<link rel="apple-touch-icon" href="<?= e(asset('logo-mark.svg')) ?>">
<link rel="icon" type="image/png" sizes="32x32" href="<?= e(asset('icons/icon-32.png')) ?>">
<link rel="apple-touch-icon" sizes="180x180" href="<?= e(asset('icons/apple-touch-icon-180.png')) ?>">
<link rel="preload" as="font" type="font/woff2" href="<?= e(asset('fonts/manrope-latin.woff2')) ?>" crossorigin>
<link rel="preload" as="font" type="font/woff2" href="<?= e(asset('fonts/inter-latin.woff2')) ?>" crossorigin>
<link rel="stylesheet" href="<?= e(asset('app.css')) ?>">
@ -61,6 +70,7 @@ $navActive = static function (string $area) use ($path): string {
<symbol id="i-alert" viewBox="0 0 24 24"><path d="M12 3.5 2.5 20.5h19z"/><path d="M12 9.5v5M12 17.6v.4"/></symbol>
<symbol id="i-snow" viewBox="0 0 24 24"><path d="M12 2v20M4.5 6.8l15 10.4M19.5 6.8 4.5 17.2M12 6.4 9.6 4M12 6.4 14.4 4M12 17.6 9.6 20M12 17.6l2.4 2.4"/></symbol>
<symbol id="i-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M19.1 4.9 17 7M7 17l-2.1 2.1"/></symbol>
<symbol id="i-download" viewBox="0 0 24 24"><path d="M12 3v12M7 10l5 5 5-5"/><path d="M5 20h14"/></symbol>
</defs>
</svg>
@ -108,6 +118,7 @@ $navActive = static function (string $area) use ($path): string {
<p class="user-menu__who"><strong><?= e($user['first_name'] . ' ' . $user['last_name']) ?></strong>
<span><?= $isAdmin ? 'Administrator' : 'Mitarbeiter' ?></span></p>
<a href="<?= e(url('/account')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-user"/></svg>Mein Konto</a>
<button type="button" class="menu-button" data-install-app hidden><svg class="ico" aria-hidden="true"><use href="#i-download"/></svg>App installieren</button>
<?php if ($isAdmin): ?>
<a href="<?= e(url('/admin/users')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-users"/></svg>Benutzerverwaltung</a>
<?php endif; ?>