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:
parent
ee61568911
commit
c74ad746f5
70 changed files with 829 additions and 596 deletions
|
|
@ -19,6 +19,7 @@ import { useId, useRef, useState, type KeyboardEvent } from 'react'
|
|||
|
||||
import HomeLink, { isExternal } from './HomeLink.tsx'
|
||||
import type { FrontPagePath } from '../../../lib/useFrontPage.ts'
|
||||
import { withAlpha, accentText } from '../../../lib/color.ts'
|
||||
|
||||
type PathfinderProps = {
|
||||
id: string
|
||||
|
|
@ -62,17 +63,17 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
}
|
||||
|
||||
return (
|
||||
<section id={id} className="py-24" style={{ background: '#ffffff' }}>
|
||||
<section id={id} className="py-24" style={{ background: 'var(--color-surface)' }}>
|
||||
<div className="mx-auto max-w-6xl px-6">
|
||||
<div className="grid gap-12 lg:grid-cols-12">
|
||||
<div className="lg:col-span-5">
|
||||
<p className="text-xs font-bold uppercase tracking-[0.3em] text-[#0f7183]">
|
||||
<p className="text-xs font-bold uppercase tracking-[0.3em] text-link">
|
||||
I’m looking to…
|
||||
</p>
|
||||
<h2 className="mt-3 font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">
|
||||
<h2 className="mt-3 font-display text-4xl font-extrabold text-ink md:text-5xl">
|
||||
{title}
|
||||
</h2>
|
||||
{blurb && <p className="mt-4 text-lg text-[#4a6b72]">{blurb}</p>}
|
||||
{blurb && <p className="mt-4 text-lg text-muted">{blurb}</p>}
|
||||
|
||||
<div
|
||||
role="tablist"
|
||||
|
|
@ -100,18 +101,18 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
className="group flex items-center gap-4 rounded-2xl border-2 px-5 py-4 text-left transition-all duration-300"
|
||||
style={{
|
||||
borderColor: on ? color : 'rgba(19,139,160,0.12)',
|
||||
background: on ? `${color}12` : '#ffffff',
|
||||
background: on ? `${withAlpha(color, 7)}` : 'var(--color-surface)',
|
||||
transform: on ? 'translateX(8px)' : undefined,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="flex h-12 w-12 shrink-0 items-center justify-center rounded-xl text-2xl transition-transform duration-300 group-hover:scale-110"
|
||||
style={{ background: on ? color : `${color}1f` }}
|
||||
style={{ background: on ? color : `${withAlpha(color, 12)}` }}
|
||||
aria-hidden="true"
|
||||
>
|
||||
{option.icon || '•'}
|
||||
</span>
|
||||
<span className="font-display text-xl font-bold" style={{ color: on ? color : '#073d4a' }}>
|
||||
<span className="font-display text-xl font-bold" style={{ color: on ? accentText(color) : 'var(--color-ink)' }}>
|
||||
{option.label}
|
||||
</span>
|
||||
<span
|
||||
|
|
@ -133,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
role="tabpanel"
|
||||
aria-labelledby={`${base}-tab-${selected}`}
|
||||
className="relative overflow-hidden rounded-[2rem] p-8 md:p-10 lg:col-span-7"
|
||||
style={{ background: `linear-gradient(155deg, ${accent}14, ${accent}05 60%, #ffffff)` }}
|
||||
style={{ background: withAlpha(accent, 5) }}
|
||||
>
|
||||
<span
|
||||
className="pointer-events-none absolute -right-6 -top-10 select-none text-[10rem] leading-none opacity-10"
|
||||
|
|
@ -143,7 +144,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
</span>
|
||||
|
||||
{path.blurb && (
|
||||
<p className="hp-pop relative max-w-md font-display text-2xl font-semibold leading-snug text-[#073d4a]">
|
||||
<p className="hp-pop relative max-w-md font-display text-2xl font-semibold leading-snug text-ink">
|
||||
{path.blurb}
|
||||
</p>
|
||||
)}
|
||||
|
|
@ -157,20 +158,20 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
>
|
||||
<HomeLink
|
||||
url={action.url}
|
||||
className="group flex h-full flex-col rounded-2xl bg-white p-6 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
|
||||
className="group flex h-full flex-col rounded-2xl bg-surface p-6 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
|
||||
>
|
||||
<span className="flex items-start gap-2 font-display text-lg font-bold text-[#073d4a]">
|
||||
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink">
|
||||
{action.label}
|
||||
<span
|
||||
className="ml-auto transition-transform group-hover:translate-x-1"
|
||||
style={{ color: accent }}
|
||||
style={{ color: accentText(accent) }}
|
||||
aria-hidden="true"
|
||||
>
|
||||
{isExternal(action.url) ? '↗' : '→'}
|
||||
</span>
|
||||
</span>
|
||||
{action.description && (
|
||||
<span className="mt-2 text-sm leading-relaxed text-[#4a6b72]">
|
||||
<span className="mt-2 text-sm leading-relaxed text-muted">
|
||||
{action.description}
|
||||
</span>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue