diff --git a/docs/dev.md b/docs/dev.md index de1984e..f625e1c 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -39,3 +39,4 @@ switches the directory app to the Google Sheets source. At startup the directory - `web/directory` — directory app page templates and static assets - `tools/screenshot` — dev-site page capture, see [screenshots.md](screenshots.md) - `tools/columns` — print the column names of each directory table in the configured source +- `tools/splash` — extract the original app's iOS splash screens into `web/static/brand/splash` diff --git a/docs/plan.md b/docs/plan.md index db71ecd..8dc0e51 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -4,7 +4,6 @@ What remains to build. Current behavior is documented in `docs/dev.md`, `docs/da ## Directory app -- Installable-app plumbing: manifest, icons, and meta tags per `docs/pwa.md`. - Self-service flows: photo and pronunciation upload, address update, opt-out. ## Hosting and deployment diff --git a/docs/pwa.md b/docs/pwa.md index 5a18578..1659fa1 100644 --- a/docs/pwa.md +++ b/docs/pwa.md @@ -11,10 +11,10 @@ The directory is used from phone home screens, so Heliosian ships as an installa ## What Heliosian serves -- `manifest.webmanifest` from the binary: name, short name, `display: standalone`, `start_url: /`, theme and background color `#014E54`, icons 192 and 512 as `any` plus maskable variants (maskable art keeps the lockup inside the safe zone on a full-bleed teal square). -- Base template meta: `theme-color`, `viewport` including `viewport-fit=cover`, the two `apple-mobile-web-app-*` tags, and a 180px `apple-touch-icon`. +- `manifest.webmanifest` at `/static/manifest.webmanifest` — under `/static/` because browsers fetch manifests without credentials and that path bypasses the sign-in wall. `scope` and `start_url` are `/`; name, `display: standalone`, theme and background color `#014E54`; icons 192 and 512 as `any` plus a 512 maskable (the maskable art keeps the lockup inside the safe zone on a full-bleed teal square). The server registers the `application/manifest+json` MIME type. +- Both page templates (app and login) carry the manifest link, `theme-color` (light surface on the app page, teal on login), `viewport` including `viewport-fit=cover` and `user-scalable=no`, the two `apple-mobile-web-app-*` tags, 16/32 favicons, and the `apple-touch-icon`. - HTTPS comes with Cloud Run; installability requires it. -- Splash screens for iOS are pre-rendered at the device-size matrix like the original; until that exists, launches show a plain background, which is acceptable. +- Splash screens for iOS: both templates carry the original's full `apple-touch-startup-image` battery — 32 pre-rendered PNGs (the logo lockup on teal) covering every iPhone/iPad class in both orientations, served from `/static/brand/splash/`. `tools/splash` regenerates them by extracting the link matrix and images from the captured original page source. - A service worker is optional for install on current Chromium and adds offline shell caching; if added, it stays minimal — cache the static shell, never cache directory data (community data must not persist on shared devices beyond the session's needs). - `start_url` must resolve for a signed-out user by landing on the sign-in flow, then into the app. diff --git a/main.go b/main.go index 0ed9dc0..8887a9f 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "crypto/rand" "encoding/json" "log" + "mime" "net/http" "os" "strings" @@ -82,6 +83,9 @@ func mapsKey(envName, file string) string { } func main() { + if err := mime.AddExtensionType(".webmanifest", "application/manifest+json"); err != nil { + log.Fatalf("[ERROR] register manifest mime type: %v", err) + } authn := auth.New(clientID(), sessionKey()) serverKey := mapsKey("GOOGLE_MAPS_SERVER_KEY", "creds/geocoding.key") browserKey := mapsKey("GOOGLE_MAPS_BROWSER_KEY", "creds/maps.key") diff --git a/tools/splash/main.go b/tools/splash/main.go new file mode 100644 index 0000000..accf9ef --- /dev/null +++ b/tools/splash/main.go @@ -0,0 +1,62 @@ +// Command splash extracts the original app's ios splash screens into web/static/brand/splash. +package main + +import ( + "fmt" + "io" + "log" + "net/http" + "net/url" + "os" + "regexp" + "strings" +) + +func main() { + raw, err := os.ReadFile("screenshots/brand/page-source.html") + if err != nil { + log.Fatalf("[ERROR] read page source: %v", err) + } + blobs := regexp.MustCompile(`decodeURIComponent\("([^"]+)"\)`).FindAllStringSubmatch(string(raw), -1) + links := [][]string{} + linkRE := regexp.MustCompile(`\n", media, name) + } +} diff --git a/web/directory/index.html b/web/directory/index.html index 844613a..39a5f8f 100644 --- a/web/directory/index.html +++ b/web/directory/index.html @@ -2,10 +2,48 @@
- + + +