Installable as an app (PWA): manifests, offline-only service worker, icons

This commit is contained in:
Astra 2026-10-03 12:22:33 +01:00
parent b26360e8f3
commit 44708d5f3c
16 changed files with 246 additions and 0 deletions

View file

@ -144,6 +144,25 @@ connect, so a rename on the same IP loses the old name. `sql/players-ips-name-hi
on its player page and in name search. SimpleAdmin needs no changes. Run it once against the
SimpleAdmin database; the file has the revert. Names are still only recorded at connect.
### Installing as an app
The site is a PWA, so Chrome on Android (and desktop Chrome or Edge) offers to install it: menu >
**Add to Home screen** / **Install app**. The public site and the staff panel install as separate
apps (`/manifest.webmanifest` opens on `/`, `/admin.webmanifest` on `/admin`); install the staff one
from the staff panel or its sign-in page. Installing needs the site on HTTPS. The service worker
(`assets/sw.js`, served at `/sw.js`) caches only an offline page, never data.
The icons are rendered from `assets/icon.svg` and `assets/icon-maskable.svg` (the brand mark kept
inside the maskable safe zone). After changing either:
```
cd internal/web/assets
rsvg-convert -w 192 -h 192 icon.svg -o icon-192.png
rsvg-convert -w 512 -h 512 icon.svg -o icon-512.png
rsvg-convert -w 512 -h 512 icon-maskable.svg -o icon-maskable-512.png
rsvg-convert -w 180 -h 180 icon-maskable.svg -o apple-touch-icon.png
```
## Limitations and caveats
- **Tested against a real MySQL 8.4** with SimpleAdmin 1.8.2b's migrations applied, and a fake game