Files
inbuxa-webmail/web/index.html
T
jcoffey-dev 769992687b
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m3s
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
ci / announce (pull_request) Skipped
Show the loading view before the app starts (#134)
Opening the app drew nothing until the bundle had downloaded and React
mounted: #root was empty. index.html now holds the loading view inside
#root, so it shows before any JavaScript runs and React replaces it when
it mounts. It's the admin console's: the inbuxa mark bouncing, with the
spinner under it, and no text, since nothing can be translated yet.

The app shows the same view, AppLoading, while the session is checked
and the account's settings load, in place of the bare spinner, so the
handover doesn't move anything. Its rules sit in index.html because the
stylesheet arrives with the bundle. Until a theme is applied they use the
default theme's colors written out; the stylesheet's :root holds the
light values, which would flash before applyTheme() runs. After that they
follow the theme. The bounce and the spin stop for reduced motion.

The mark is inbuxa's on a renamed instance too: its name isn't known until
the server answers.

Fixes #134
2026-11-20 15:08:49 -07:00

58 lines
3.4 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" />
<meta name="color-scheme" content="light dark" />
<!--
One tag, no media query: applyTheme() keeps it in step with the chosen
theme, which a media query cannot do — it only knows what the OS prefers,
not what the user picked here. There used to be two, both with media
attributes, which meant the selector in applyTheme (:not([media])) matched
neither and the color never moved off whatever the OS implied.
The initial value is the default theme's background, so the browser chrome
is right from the first paint rather than only once JS has run.
-->
<meta name="theme-color" content="#0d2430" />
<meta name="description" content="ihasmail - fast, friendly JMAP webmail for Stalwart" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" href="/favicon.ico?v=2026-09-27a" sizes="any" />
<link rel="icon" type="image/png" sizes="64x64" href="/img/favicon-64.png?v=2026-09-27a" />
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png?v=2026-09-27a" />
<link rel="manifest" href="/manifest.webmanifest" />
<title>inbuxa</title>
<!--
#134: the loading view, drawn before any JavaScript runs. It sits inside
#root, so React replaces it when it mounts, and AppLoading (ui/misc.tsx)
draws the same thing while the session is checked, so the handover
doesn't move anything. Its rules live here rather than in app.css because
the stylesheet arrives with the bundle. Until a theme is applied it uses
the default theme's colors (ihasmail, dark), written out, not the
stylesheet's :root, whose light values would flash before applyTheme()
runs; from then on, the theme's own. No text: nothing
here can be translated yet. The mark is inbuxa's even on a renamed
instance, whose name isn't known until the server answers.
-->
<style>
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: #0d2430; }
.boot-mark { width: 48px; height: auto; animation: boot-bounce 1.4s infinite; }
.boot-ring { width: 20px; height: 20px; box-sizing: border-box; border: 2px solid #2e6a7a; border-top-color: #46cac3; border-radius: 50%; animation: boot-spin .7s linear infinite; }
[data-theme] .boot { background: var(--bg); }
[data-theme] .boot-ring { border-color: var(--border-strong); border-top-color: var(--accent); }
@keyframes boot-bounce {
0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); }
50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); }
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-mark, .boot-ring { animation: none; } }
</style>
</head>
<body>
<div id="root"><div class="boot" aria-hidden="true"><img class="boot-mark" src="/img/inbuxa-mark.png?v=2026-09-27a" alt="" /><span class="boot-ring"></span></div></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>