Files
kuentagym/frontend/index.html
T
dsantillan 45183c725f
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The splash is the photograph, and it is painted before the app exists
Two things about the launch screen on the phone.

**No mark on it.** The photograph is the screen now — the logo that sat in the middle is
gone, and so is the vignette that existed to keep that logo readable. Nothing to read, just
the picture, which is what was asked for.

**It no longer waits for React.** Until now the splash was a React element, so it could not
appear until the bundle had downloaded, parsed and mounted — on a phone that is the long
blank stretch between opening the app and seeing anything, and it is why the splash seemed
to arrive late and then flash past: by the time it rendered, the app was nearly ready.
index.html now paints the same photograph from inline styles, so it is on screen as soon as
the HTML is parsed, with the bundle still downloading behind it. React replaces the
container's contents when it mounts, and the two screens are identical — same image, same
object-fit, same base colour behind it while the picture decodes — so the handover cannot be
seen as anything but the app arriving.

The blank before even that is iOS's own launch screen, which is what apple-touch-startup-image
covers: production already serves all fourteen, so a PWA that still opens white is one that
was installed before those existed. Removing the icon from the home screen and adding it
again is what makes iOS pick them up — its launch images are read at install time, not on
every launch.
2026-09-23 12:05:27 -04:00

91 lines
7.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,user-scalable=no">
<title>KuentaGYM</title>
<meta name="description" content="Personal gym & body weight tracker">
<meta name="theme-color" content="#0c0e12">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="KuentaGYM">
<!-- use-credentials: browsers fetch the manifest without cookies, even same-origin; behind an auth
proxy (Authelia, Cloudflare Access, Teleport…) that fetch is a login redirect and the Home Screen
icon comes out generic. iOS 26 reads the icon from the manifest, so this is where it shows. -->
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="icon" type="image/png" href="icon-180.png">
<!-- iOS launch screens. An installed web app paints this before a line of our code runs, and
without it that screen is blank — the white flash on every open that no CSS can reach. Each
entry is one device's exact pixel size, generated from the same photograph as the in-app splash
by scripts/build-app-icons.mjs, which fails when this list and its own table drift apart.
iOS shows nothing at all when no entry matches, so the table matters more than the file count. -->
<link rel="apple-touch-startup-image" href="startup/750x1334@2.jpg" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" href="startup/1242x2208@3.jpg" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1125x2436@3.jpg" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/828x1792@2.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" href="startup/1242x2688@3.jpg" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1170x2532@3.jpg" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1179x2556@3.jpg" media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1206x2622@3.jpg" media="(device-width: 402px) and (device-height: 874px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1284x2778@3.jpg" media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1290x2796@3.jpg" media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1320x2868@3.jpg" media="(device-width: 440px) and (device-height: 956px) and (-webkit-device-pixel-ratio: 3)">
<link rel="apple-touch-startup-image" href="startup/1536x2048@2.jpg" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" href="startup/1668x2388@2.jpg" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" href="startup/2048x2732@2.jpg" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)">
<!-- The first paint must not be white. Until the app's stylesheet arrives the browser paints its
own default, which on a cold load — or while a service worker swaps in a new bundle — is a
white flash before the aura's dark base appears. This one rule is that base colour (index.css
keeps the real one, and overrides this the moment it loads, being later in the document).
The script below it does the same job for the two settings that change the look: the app reads
them after boot, which would otherwise flash the default theme at anybody who chose another.
It reads the same localStorage key the store writes (see store/useStore.js) and resolves
'system' exactly the way App.jsx does. Anything unexpected leaves the defaults in place. -->
<style>html,body{background:#100e0b}</style>
<script>
try {
var saved = JSON.parse(localStorage.getItem('gym_state_v1') || '{}')
var de = document.documentElement
var dark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
var theme = saved.theme === 'light' || saved.theme === 'dark' ? saved.theme : (dark ? 'dark' : 'light')
de.dataset.theme = theme
if (theme === 'light') document.head.insertAdjacentHTML('beforeend', '<style>html,body{background:#f2f2f7}</style>')
if (saved.accent) de.dataset.accent = saved.accent
} catch (e) { /* a browser with storage blocked still gets the app, just not the no-flash head start */ }
</script>
</head>
<body>
<!-- "Diamond Weave" aura — the atmosphere behind every screen.
Three stacked layers, two of them blurred and composited with mix-blend-mode against the BODY
background, which is why this container must never carry a background-color of its own: the
layers would blend against that instead of the page and the effect washes out. The base colour
lives on body in index.css (warm near-black in the dark theme; the usual light background in
the light theme, where the layers switch to `multiply` for the same reason).
It lives here rather than in React so it exists before the app boots — the splash has
something to sit on — and costs no render. Every layer is decorative: aria-hidden here, and
pointer-events:none in the CSS so it can never eat a tap. -->
<div class="aura" aria-hidden="true">
<div class="aura-layer-1"></div>
<div class="aura-layer-2"></div>
<div class="aura-layer-3"></div>
</div>
<div id="root">
<!-- The first thing the browser can paint at all. The splash React renders (`.boot-splash` in
index.css) cannot appear until the app's bundle has downloaded and run, and on a phone that
is the long blank stretch between opening the app and seeing anything. This is the same
photo with the same rules, written inline so it needs neither the stylesheet nor a line of
JavaScript, and React replaces the container's contents the moment it mounts — the two
screens are identical, so the handover is invisible.
The background behind the photo is the aura's base colour: the image takes a moment to
decode, and a dark frame is not a flash of white. -->
<div aria-hidden="true" style="position:fixed;inset:0;z-index:1;overflow:hidden;background:#100e0b">
<img src="splash.webp" alt="" style="position:absolute;inset:0;width:100%;height:100%;object-fit:cover">
</div>
</div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>