Add colour tokens, dark mode and drop gradients

- Colour tokens in index.css named by role (ink, body, muted, link,
  brand, action, surface, tint, danger), used everywhere instead of hex
- Dark mode: follows the system, a header toggle (site and admin)
  overrides it and is remembered; set before first paint in index.html
- Data colours go through src/lib/color.ts: withAlpha for tints,
  accentText (lighter on dark) for text in an accent, readableOn for
  text on one, so an admin's pale colour still reads
- Migration 040 drops events.gradient: a card is its photo or plain,
  with its colour as the border; other decorative gradients are solid
- The countdown and a hero event without a photo mix their colour
  toward ink behind white text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:42:59 -05:00
parent ee61568911
commit c74ad746f5
70 changed files with 829 additions and 596 deletions

View file

@ -36,8 +36,8 @@ const GOOGLE_ERRORS: Record<string, string> = {
};
const fieldClass =
"w-full rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 text-[#26454c] " +
"outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
"w-full rounded-xl border border-muted/25 bg-surface px-4 py-3 text-body " +
"outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25";
export default function AdminLogin() {
const { login } = useAuth();
@ -85,23 +85,23 @@ export default function AdminLogin() {
}
return (
<div className="flex min-h-screen items-center justify-center bg-[#eef9fb] px-6 py-16">
<div className="flex min-h-screen items-center justify-center bg-tint px-6 py-16">
<div className="w-full max-w-sm">
<h1 className="text-3xl font-bold text-[#0f7183]">NGU admin</h1>
<p className="mt-2 text-sm text-[#4a6b72]">
<h1 className="text-3xl font-bold text-link">NGU admin</h1>
<p className="mt-2 text-sm text-muted">
Sign in to edit the site.
</p>
<form
onSubmit={handleSubmit}
noValidate
className="mt-8 rounded-2xl border border-[#138ba0]/20 bg-white p-6"
className="mt-8 rounded-2xl border border-brand/20 bg-surface p-6"
>
{google && (
<>
<a
href={`/api/auth/google?next=${encodeURIComponent(destination)}`}
className="flex items-center justify-center gap-3 rounded-full border border-[#4a6b72]/30 px-6 py-3 font-semibold text-[#26454c] transition-colors hover:bg-[#eef9fb]"
className="flex items-center justify-center gap-3 rounded-full border border-muted/30 px-6 py-3 font-semibold text-body transition-colors hover:bg-tint"
>
<svg viewBox="0 0 48 48" className="h-5 w-5" aria-hidden="true">
<path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.4-.4-3.5z" />
@ -111,17 +111,17 @@ export default function AdminLogin() {
</svg>
Sign in with Google
</a>
<div className="my-6 flex items-center gap-3 text-xs text-[#4a6b72]">
<span className="h-px flex-1 bg-[#4a6b72]/20" />
<div className="my-6 flex items-center gap-3 text-xs text-muted">
<span className="h-px flex-1 bg-muted/20" />
or with a password
<span className="h-px flex-1 bg-[#4a6b72]/20" />
<span className="h-px flex-1 bg-muted/20" />
</div>
</>
)}
<label
htmlFor="admin-email"
className="block text-sm font-medium text-[#26454c]"
className="block text-sm font-medium text-body"
>
Email
</label>
@ -137,7 +137,7 @@ export default function AdminLogin() {
<label
htmlFor="admin-password"
className="mt-5 block text-sm font-medium text-[#26454c]"
className="mt-5 block text-sm font-medium text-body"
>
Password
</label>
@ -153,7 +153,7 @@ export default function AdminLogin() {
{error && (
<p
role="alert"
className="mt-5 rounded-xl border border-[#b3261e]/30 bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]"
className="mt-5 rounded-xl border border-danger/30 bg-danger-tint px-4 py-3 text-sm text-danger"
>
{error}
</p>
@ -162,14 +162,14 @@ export default function AdminLogin() {
<button
type="submit"
disabled={busy || !email || !password}
className="mt-6 w-full rounded-full bg-[#0f7183] px-6 py-3 font-semibold text-white transition-colors hover:bg-[#0b5c6a] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40 disabled:cursor-not-allowed disabled:bg-[#4a6b72]/25"
className="mt-6 w-full rounded-full bg-action px-6 py-3 font-semibold text-white transition-colors hover:bg-action-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 disabled:cursor-not-allowed disabled:bg-muted/25"
>
{busy ? "Signing in…" : "Sign in"}
</button>
</form>
<p className="mt-6 text-center text-xs text-[#4a6b72]">
<p className="mt-6 text-center text-xs text-muted">
Accounts are created on the server. Ask whoever runs the box.
</p>
</div>