Compare commits

..

No commits in common. "1da79c128be066c63d5e360b052ead7a9e46ab9c" and "bc88b45ee15d72788dab83f27080cad5cc71eb54" have entirely different histories.

28 changed files with 127 additions and 949 deletions

View file

@ -9,8 +9,7 @@
<meta name="theme-color" content="#073d4a" media="(prefers-color-scheme: light)" /> <meta name="theme-color" content="#073d4a" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#0c1d21" media="(prefers-color-scheme: dark)" /> <meta name="theme-color" content="#0c1d21" media="(prefers-color-scheme: dark)" />
<!-- Theme before first paint, so a dark visitor never sees a white <!-- Theme before first paint, so a dark visitor never sees a white
flash: this browser's choice (ThemeToggle), else the system; flash: this browser's choice (ThemeToggle), else the system. -->
and the accessibility choices, for the same reason. -->
<script> <script>
try { try {
// Once: browser keys used to start "ngu-"; move them to "site-" // Once: browser keys used to start "ngu-"; move them to "site-"
@ -26,9 +25,6 @@
var t = localStorage.getItem("site-theme"); var t = localStorage.getItem("site-theme");
document.documentElement.dataset.theme = document.documentElement.dataset.theme =
t === "dark" || t === "light" ? t : matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; t === "dark" || t === "light" ? t : matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
// The accessibility panel's choices (AccessibilityPanel.tsx).
if (localStorage.getItem("site-font") === "dyslexic") document.documentElement.dataset.font = "dyslexic";
if (localStorage.getItem("site-reading") === "on") document.documentElement.dataset.reading = "on";
} catch (e) {} } catch (e) {}
</script> </script>
<!-- site:head-end --> <!-- site:head-end -->

View file

@ -11,7 +11,6 @@
}, },
"dependencies": { "dependencies": {
"@fontsource/montserrat": "^5.3.0", "@fontsource/montserrat": "^5.3.0",
"@fontsource/opendyslexic": "^5.3.0",
"@fontsource/poppins": "^5.3.0", "@fontsource/poppins": "^5.3.0",
"@phosphor-icons/react": "^2.1.10", "@phosphor-icons/react": "^2.1.10",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",

8
pnpm-lock.yaml generated
View file

@ -11,9 +11,6 @@ importers:
'@fontsource/montserrat': '@fontsource/montserrat':
specifier: ^5.3.0 specifier: ^5.3.0
version: 5.3.0 version: 5.3.0
'@fontsource/opendyslexic':
specifier: ^5.3.0
version: 5.3.0
'@fontsource/poppins': '@fontsource/poppins':
specifier: ^5.3.0 specifier: ^5.3.0
version: 5.3.0 version: 5.3.0
@ -69,9 +66,6 @@ packages:
'@fontsource/montserrat@5.3.0': '@fontsource/montserrat@5.3.0':
resolution: {integrity: sha512-iQPDtZOnmM5ih4JBGaMSXisRap0ixb9bAUw2hDtY7EjVfaqiiNlKtVuJl9XclxUwtwMMHNcWXfQR6zI9x05+Tg==} resolution: {integrity: sha512-iQPDtZOnmM5ih4JBGaMSXisRap0ixb9bAUw2hDtY7EjVfaqiiNlKtVuJl9XclxUwtwMMHNcWXfQR6zI9x05+Tg==}
'@fontsource/opendyslexic@5.3.0':
resolution: {integrity: sha512-BVYIW/ghc1U2iAghhYTN+GFWiZ3lnCy8Jf2KkZC23aHQHBNcMqKT718zckfqVxRx4qsXJmIMPWvczirRuhmtsg==}
'@fontsource/poppins@5.3.0': '@fontsource/poppins@5.3.0':
resolution: {integrity: sha512-cms1nM7U6SN8epIV1WMVOV8VsA645aSm3wHfzIQnkk188U341ThbJGSl2Sv54V29gnDbT2arMPfLzvVIIVCceQ==} resolution: {integrity: sha512-cms1nM7U6SN8epIV1WMVOV8VsA645aSm3wHfzIQnkk188U341ThbJGSl2Sv54V29gnDbT2arMPfLzvVIIVCceQ==}
@ -792,8 +786,6 @@ snapshots:
'@fontsource/montserrat@5.3.0': {} '@fontsource/montserrat@5.3.0': {}
'@fontsource/opendyslexic@5.3.0': {}
'@fontsource/poppins@5.3.0': {} '@fontsource/poppins@5.3.0': {}
'@jridgewell/gen-mapping@0.3.13': '@jridgewell/gen-mapping@0.3.13':

View file

@ -80,7 +80,6 @@ const AdminHome = lazyPage(() => import("./pages/admin/AdminHome.tsx"))
const AdminFeedback = lazyPage(() => import("./pages/admin/AdminFeedback.tsx")) const AdminFeedback = lazyPage(() => import("./pages/admin/AdminFeedback.tsx"))
const AdminMedia = lazyPage(() => import("./pages/admin/AdminMedia.tsx")) const AdminMedia = lazyPage(() => import("./pages/admin/AdminMedia.tsx"))
const AdminClips = lazyPage(() => import("./pages/admin/AdminClips.tsx")) const AdminClips = lazyPage(() => import("./pages/admin/AdminClips.tsx"))
const AdminNewsletter = lazyPage(() => import("./pages/admin/AdminNewsletter.tsx"))
const EntityList = lazyPage(() => import("./pages/admin/EntityList.tsx")) const EntityList = lazyPage(() => import("./pages/admin/EntityList.tsx"))
const EntityEdit = lazyPage(() => import("./pages/admin/EntityEdit.tsx")) const EntityEdit = lazyPage(() => import("./pages/admin/EntityEdit.tsx"))
@ -134,7 +133,6 @@ export default function App() {
<Route path="data-requests" element={<AdminFeedback kind="privacy" />} /> <Route path="data-requests" element={<AdminFeedback kind="privacy" />} />
<Route path="requests" element={<AdminFeedback kind="content" />} /> <Route path="requests" element={<AdminFeedback kind="content" />} />
<Route path="media" element={<AdminMedia />} /> <Route path="media" element={<AdminMedia />} />
<Route path="newsletter" element={<AdminNewsletter />} />
<Route element={<RequireRole role="admin" />}> <Route element={<RequireRole role="admin" />}>
<Route path="clips" element={<AdminClips />} /> <Route path="clips" element={<AdminClips />} />
</Route> </Route>

View file

@ -1,168 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
ACCESSIBILITY PANEL
A button fixed to the bottom right of every public page, opening
two switches that change how the whole site reads:
Dyslexia-friendly font every typeface becomes OpenDyslexic
(self-hosted, index.css)
Reading mode the design steps back: no background
circles, motion or shadows, one column,
larger text and plain underlined links,
the same content throughout
Each is a data attribute on <html> (data-font, data-reading) that
index.css styles, saved in this browser (site-font, site-reading)
and set again before the first paint by index.html, so a page
never flashes the other look. Blocked storage just means the
choice lasts until the tab closes.
The panel closes on Escape, on the button again, or a click
anywhere else, and gives focus back to the button.
═══════════════════════════════════════════════════════════════ */
import { PersonArmsSpread, X } from '@phosphor-icons/react'
import { useEffect, useId, useRef, useState } from 'react'
/* A setting: its <html> attribute, storage key, the value that turns
it on, and its words. */
const SETTINGS = [
{
attribute: 'font',
key: 'site-font',
on: 'dyslexic',
label: 'Dyslexia-friendly font',
help: 'Letters shaped to be easier to tell apart.',
},
{
attribute: 'reading',
key: 'site-reading',
on: 'on',
label: 'Reading mode',
help: 'A plain, single column with larger text and no motion.',
},
] as const
type Setting = (typeof SETTINGS)[number]
const isOn = (setting: Setting) => document.documentElement.dataset[setting.attribute] === setting.on
function apply(setting: Setting, on: boolean) {
const root = document.documentElement
if (on) root.dataset[setting.attribute] = setting.on
else delete root.dataset[setting.attribute]
try {
if (on) localStorage.setItem(setting.key, setting.on)
else localStorage.removeItem(setting.key)
} catch {
// Storage blocked: the choice holds for this page view.
}
}
export default function AccessibilityPanel() {
const [open, setOpen] = useState(false)
const [state, setState] = useState(() => Object.fromEntries(SETTINGS.map((s) => [s.key, isOn(s)])))
const rootRef = useRef<HTMLDivElement>(null)
const buttonRef = useRef<HTMLButtonElement>(null)
const panelId = useId()
useEffect(() => {
if (!open) return undefined
const close = () => {
setOpen(false)
buttonRef.current?.focus()
}
const onKey = (event: KeyboardEvent) => {
if (event.key === 'Escape') close()
}
const onPointer = (event: PointerEvent) => {
if (!rootRef.current?.contains(event.target as Node)) setOpen(false)
}
document.addEventListener('keydown', onKey)
document.addEventListener('pointerdown', onPointer)
return () => {
document.removeEventListener('keydown', onKey)
document.removeEventListener('pointerdown', onPointer)
}
}, [open])
const toggle = (setting: Setting) => {
const next = !state[setting.key]
apply(setting, next)
setState((current) => ({ ...current, [setting.key]: next }))
}
return (
<div ref={rootRef} className="fixed right-4 bottom-4 z-50 print:hidden">
{open && (
<div
id={panelId}
role="region"
aria-label="Accessibility"
className="absolute right-0 bottom-full mb-3 w-[min(20rem,calc(100vw-2rem))] border border-brand/20 bg-raised p-4 shadow-xl"
>
<div className="flex items-center justify-between gap-4">
<h2 className="font-display text-base font-bold text-ink">Accessibility</h2>
<button
type="button"
onClick={() => {
setOpen(false)
buttonRef.current?.focus()
}}
className="btn flex h-10 w-10 items-center justify-center text-muted hover:bg-tint"
aria-label="Close accessibility options"
>
<X size={18} weight="bold" aria-hidden="true" />
</button>
</div>
<ul className="mt-3 space-y-3">
{SETTINGS.map((setting) => {
const on = state[setting.key]
const labelId = `${panelId}-${setting.attribute}`
return (
<li key={setting.key} className="flex items-start gap-3">
<button
type="button"
role="switch"
aria-checked={on}
aria-labelledby={labelId}
onClick={() => toggle(setting)}
className={`relative mt-0.5 h-6 w-11 shrink-0 rounded-full border-2 transition-colors ${
on ? 'border-action bg-action' : 'border-muted/50 bg-surface'
}`}
>
<span
aria-hidden="true"
className={`absolute top-0.5 h-4 w-4 rounded-full transition-transform ${
on ? 'translate-x-5 bg-white' : 'translate-x-0.5 bg-muted'
}`}
/>
</button>
<span>
<span id={labelId} className="block font-semibold text-ink">
{setting.label}
</span>
<span className="block text-sm text-muted">{setting.help}</span>
</span>
</li>
)
})}
</ul>
</div>
)}
<button
ref={buttonRef}
type="button"
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
aria-controls={open ? panelId : undefined}
aria-label="Accessibility options"
className="btn flex h-12 w-12 items-center justify-center bg-action text-white shadow-lg transition-colors hover:bg-action-hover"
>
<PersonArmsSpread size={26} weight="bold" aria-hidden="true" />
</button>
</div>
)
}

View file

@ -5,7 +5,7 @@ import { Link } from "react-router-dom";
ARROW LINK ARROW LINK
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
export default function ArrowLink({ to, label, color, size = "h-10 w-10" }) { export default function ArrowLink({ to, label, color, size = "h-9 w-9" }) {
return ( return (
<Link <Link
to={to} to={to}

View file

@ -29,12 +29,12 @@ export default function Banner() {
return ( return (
<div <div
className="relative w-full py-2.5 pr-12 pl-4 text-center sm:px-12" className="relative w-full px-12 py-2.5 text-center"
style={{ background: "rgba(0, 16, 17, 0.95)" }} style={{ background: "rgba(0, 47, 57, 0.95)" }}
role="region" role="region"
aria-label="Site announcement" aria-label="Site announcement"
> >
<p className="text-xs text-white/85 sm:text-sm"> <p className="text-sm text-white/85">
{SITE_BANNER.content.map((part, i) => { {SITE_BANNER.content.map((part, i) => {
if (!part.href) return <span key={i}>{part.text}</span>; if (!part.href) return <span key={i}>{part.text}</span>;
return part.external ? ( return part.external ? (
@ -53,7 +53,7 @@ export default function Banner() {
<button <button
onClick={dismiss} onClick={dismiss}
aria-label="Dismiss announcement" aria-label="Dismiss announcement"
className="absolute right-1 top-1/2 -translate-y-1/2 p-3 text-white/50 hover:text-white hover:bg-white/10 transition-colors" className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 text-white/50 hover:text-white hover:bg-white/10 transition-colors"
> >
<X className="w-4 h-4" weight="bold" aria-hidden="true" /> <X className="w-4 h-4" weight="bold" aria-hidden="true" />
</button> </button>

View file

@ -34,12 +34,11 @@ const Footer_Links = [
const footerLinkClass = const footerLinkClass =
"text-white/65 hover:text-[#9cc47c] text-sm transition-colors"; "text-white/65 hover:text-[#9cc47c] text-sm transition-colors";
// inline-block with a little height of its own, so a finger can hit it.
const pageLinkClass = const pageLinkClass =
"inline-block py-1 text-white/80 hover:text-[#9cc47c] text-sm font-semibold transition-colors"; "text-white/80 hover:text-[#9cc47c] text-sm font-semibold transition-colors";
const sectionLinkClass = const sectionLinkClass =
"inline-block py-1 text-white/65 hover:text-[#9cc47c] text-sm transition-colors"; "text-white/65 hover:text-[#9cc47c] text-sm transition-colors";
const headingClass = "text-white/90 text-sm font-semibold mb-4"; const headingClass = "text-white/90 text-sm font-semibold mb-4";
@ -93,7 +92,7 @@ export default function Footer() {
</Link> </Link>
{sections.length > 0 && ( {sections.length > 0 && (
<ul className="mt-1 flex flex-col"> <ul className="mt-2 flex flex-col gap-1.5">
{sections.map((section) => ( {sections.map((section) => (
<li key={section.hash}> <li key={section.hash}>
<Link <Link

View file

@ -7,7 +7,6 @@ import siteLogo from "../assets/logos/NGU_Logo.svg";
import Footer from "./Footer.tsx"; import Footer from "./Footer.tsx";
import PrivacyNotice from "./PrivacyNotice.tsx"; import PrivacyNotice from "./PrivacyNotice.tsx";
import PageBackdrop from "./PageBackdrop.tsx"; import PageBackdrop from "./PageBackdrop.tsx";
import AccessibilityPanel from "./AccessibilityPanel.tsx";
import ThemeToggle from "./ThemeToggle.tsx"; import ThemeToggle from "./ThemeToggle.tsx";
import { scrollBehavior } from "../lib/motion.ts"; import { scrollBehavior } from "../lib/motion.ts";
@ -290,13 +289,12 @@ export default function Layout() {
<div inert={mobileMenuOpen} className="print:hidden"> <div inert={mobileMenuOpen} className="print:hidden">
<Footer /> <Footer />
<PrivacyNotice /> <PrivacyNotice />
<AccessibilityPanel />
</div> </div>
{/* Mobile menu */} {/* Mobile menu */}
{mobileMenuOpen && ( {mobileMenuOpen && (
<div <div
className="fixed inset-0 z-[60] flex flex-col items-center [justify-content:safe_center] overflow-y-auto py-16" className="fixed inset-0 z-[60] flex flex-col items-center justify-center overflow-y-auto py-16"
style={{ background: "rgba(0, 58, 69, 0.97)" }} style={{ background: "rgba(0, 58, 69, 0.97)" }}
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
@ -304,7 +302,7 @@ export default function Layout() {
> >
<button <button
ref={closeMenuRef} ref={closeMenuRef}
className="absolute top-3 right-4 p-2 text-white text-3xl" className="absolute top-5 right-6 text-white text-3xl"
aria-label="Close menu" aria-label="Close menu"
onClick={() => setMobileMenuOpen(false)} onClick={() => setMobileMenuOpen(false)}
> >

View file

@ -102,7 +102,7 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
{/* Page header */} {/* Page header */}
<div className="pt-24 pb-12 px-6"> <div className="pt-24 pb-12 px-6">
<div className="max-w-6xl mx-auto"> <div className="max-w-6xl mx-auto">
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold [overflow-wrap:anywhere] hyphens-auto" style={{ color: accentText(BRAND) }}> <h1 className="text-5xl md:text-6xl font-bold" style={{ color: accentText(BRAND) }}>
{title} {title}
</h1> </h1>
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>} {intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}

View file

@ -66,16 +66,6 @@
border-left: 1px solid var(--pl-rule); border-left: 1px solid var(--pl-rule);
} }
/* Everyone on one line (fitsOneRow in PeopleTiles.tsx): the groups
share it by head count, and the tiles narrow to fit. */
.pl__groups[data-row="one"] {
flex-wrap: nowrap;
}
.pl__groups[data-row="one"] .pl__group {
flex: var(--pl-share) 1 0;
}
.pl__group-head { .pl__group-head {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -314,17 +304,27 @@
box-shadow: var(--shadow-lg); box-shadow: var(--shadow-lg);
} }
.pl__bio--anchored[data-align="end"] {
left: auto;
right: 0;
}
.pl__bio--anchored::before { .pl__bio--anchored::before {
content: ''; content: '';
position: absolute; position: absolute;
top: -11px; top: -11px;
left: var(--pl-notch, calc(var(--pl-w) / 2 - 8px)); left: calc(var(--pl-w) / 2 - 8px);
width: 16px; width: 16px;
height: 8px; height: 8px;
background: var(--pl-accent); background: var(--pl-accent);
clip-path: polygon(50% 0, 100% 100%, 0 100%); clip-path: polygon(50% 0, 100% 100%, 0 100%);
} }
.pl__bio--anchored[data-align="end"]::before {
left: auto;
right: calc(var(--pl-w) / 2 - 8px);
}
.pl__bio { .pl__bio {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -356,8 +356,8 @@
.pl__close { .pl__close {
flex: 0 0 auto; flex: 0 0 auto;
width: 2.5rem; width: 1.75rem;
height: 2.5rem; height: 1.75rem;
border: 1px solid var(--pl-frame-edge); border: 1px solid var(--pl-frame-edge);
border-radius: var(--btn-radius); border-radius: var(--btn-radius);
background: var(--color-surface); background: var(--color-surface);

View file

@ -56,10 +56,7 @@ import "./PeopleTiles.css";
* Rows fill (balancedColumns): as many tiles across as fit, never * Rows fill (balancedColumns): as many tiles across as fit, never
* fewer than 2 or more than 10, one fewer when that would leave a * fewer than 2 or more than 10, one fewer when that would leave a
* lone tile on the last row. When 2 don't fit at full size they * lone tile on the last row. When 2 don't fit at full size they
* shrink. And when everyone (every group, leads and members alike) * shrink.
* fits on one line with tiles at ONE_ROW_SHRINK of full width or
* wider, they all share that one line instead (fitsOneRow): a
* board of 7 reads as one row, not 5 and 2.
* *
* Details open in a panel right under the tile, over what follows * Details open in a panel right under the tile, over what follows
* (flipped to end at the tile's right edge when it would run off * (flipped to end at the tile's right edge when it would run off
@ -487,9 +484,6 @@ export function PeopleTilesView({
} }
const open = openKey ? findByKey(resolvedGroups, openKey) : null; const open = openKey ? findByKey(resolvedGroups, openKey) : null;
const oneRow =
room !== null && overflow !== "scroll" &&
fitsOneRow(resolvedGroups.map((group) => group.people.length), room.width, room.tile, room.gap);
const anchored = overflow !== "scroll"; const anchored = overflow !== "scroll";
const closePanel = () => { const closePanel = () => {
setOpenKey(null); setOpenKey(null);
@ -543,17 +537,13 @@ export function PeopleTilesView({
{...rest} {...rest}
> >
<span ref={probeRef} className="pl__probe" aria-hidden="true" /> <span ref={probeRef} className="pl__probe" aria-hidden="true" />
<div className="pl__groups" data-row={oneRow ? "one" : undefined}> <div className="pl__groups">
{resolvedGroups.map((group) => ( {resolvedGroups.map((group) => (
<section <section
key={group.id} key={group.id}
className="pl__group" className="pl__group"
style={ style={
{ group.accent ? ({ "--pl-accent": group.accent } as CSSProperties) : undefined
...(group.accent ? { "--pl-accent": group.accent } : null),
// Sharing one line: each group's width follows its head count.
...(oneRow ? { "--pl-share": group.people.length } : null),
} as CSSProperties
} }
aria-label={group.label || undefined} aria-label={group.label || undefined}
> >
@ -569,9 +559,7 @@ export function PeopleTilesView({
style={ style={
room room
? ({ ? ({
"--pl-cols": oneRow "--pl-cols": balancedColumns(group.people.length, room.width, room.tile, room.gap),
? group.people.length
: balancedColumns(group.people.length, room.width, room.tile, room.gap),
} as CSSProperties) } as CSSProperties)
: undefined : undefined
} }
@ -748,23 +736,15 @@ function DetailPanel({
onClose: () => void; onClose: () => void;
}) { }) {
const panelRef = useRef<HTMLDivElement>(null); const panelRef = useRef<HTMLDivElement>(null);
// How far the panel shifts from the tile's left edge, and where the const [alignEnd, setAlignEnd] = useState(false);
// notch sits on it, in px.
const [place, setPlace] = useState<{ shift: number; notch: number } | null>(null);
// Under the tile, starting at its left edge, slid left just enough // Under the tile, starting at its left edge unless that would run
// to stay 8px inside the screen on either side (a narrow phone // off the right of the screen; then ending at its right edge.
// included), with the notch kept under the tile's middle.
useLayoutEffect(() => { useLayoutEffect(() => {
if (!anchored || !panelRef.current) return; if (!anchored || !panelRef.current) return;
const tile = panelRef.current.parentElement?.getBoundingClientRect(); const tile = panelRef.current.parentElement?.getBoundingClientRect();
if (!tile) return;
const width = panelRef.current.offsetWidth; const width = panelRef.current.offsetWidth;
const screen = document.documentElement.clientWidth; if (tile) setAlignEnd(tile.left + width > document.documentElement.clientWidth - 16);
let shift = Math.min(0, screen - 8 - (tile.left + width));
shift = Math.max(shift, 8 - tile.left);
const notch = Math.min(Math.max(tile.width / 2 - shift - 8, 8), width - 24);
setPlace({ shift, notch });
}, [anchored]); }, [anchored]);
const org = resolveOrg(person.org); const org = resolveOrg(person.org);
@ -778,14 +758,10 @@ function DetailPanel({
ref={panelRef} ref={panelRef}
id={id} id={id}
className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"} className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"}
style={ data-align={alignEnd ? "end" : "start"}
{
...(tint ? { "--pl-accent": tint } : null),
...(place ? { left: `${place.shift}px`, "--pl-notch": `${place.notch}px` } : null),
} as CSSProperties
}
role="region" role="region"
aria-label={`About ${person.name}`} aria-label={`About ${person.name}`}
style={tint ? ({ "--pl-accent": tint } as CSSProperties) : undefined}
> >
<div className="pl__bio-head"> <div className="pl__bio-head">
<div> <div>
@ -858,36 +834,17 @@ function Chevron() {
/* ── Helpers ─────────────────────────────────────────────────── */ /* ── Helpers ─────────────────────────────────────────────────── */
/* How small a tile may get so a whole list shares one line. */
export const ONE_ROW_SHRINK = 0.75;
/* Whether every group fits side by side on one line, 10 tiles at most,
with tiles no smaller than ONE_ROW_SHRINK of full width. Groups are
divided by a gap, padding and a 1px rule (PeopleTiles.css). */
export function fitsOneRow(counts: number[], width: number, tile: number, gap: number): boolean {
const total = counts.reduce((sum, n) => sum + n, 0);
if (total < 2 || total > 10) return false;
const smallest = tile * ONE_ROW_SHRINK;
const tiles = counts.reduce((sum, n) => sum + n * smallest + (n - 1) * gap, 0);
const dividers = (counts.length - 1) * (gap * 3 + 1);
return tiles + dividers <= width;
}
/* Tiles across a row: as many as fit, at least 2 and at most 10 /* Tiles across a row: as many as fit, at least 2 and at most 10
(never more than there are). If that would leave one tile alone on (never more than there are). If that would leave one tile alone on
the last row, one fewer across, so the last row has two: 7 that fit the last row, one fewer across, so the last row has two: 7 that fit
6 across go 5 and 2. With only 2 across, a third, narrower column 6 across go 5 and 2. With only 2 across, a third, narrower column
takes the odd one instead, if tiles stay at least 60% of full takes the odd one instead (3 tiles on a phone go 3 across). */
width; on a narrow phone a lone last tile beats three unreadable
ones. */
export function balancedColumns(count: number, width: number, tile: number, gap: number): number { export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
if (count <= 1) return 1; if (count <= 1) return 1;
const fit = Math.floor((width + gap) / (tile + gap)); const fit = Math.floor((width + gap) / (tile + gap));
const cols = Math.min(count, 10, Math.max(2, fit)); const cols = Math.min(count, 10, Math.max(2, fit));
if (count % cols !== 1) return cols; if (count % cols !== 1) return cols;
if (cols > 2) return cols - 1; return cols > 2 ? cols - 1 : Math.min(count, 3);
const third = (width - 2 * gap) / 3;
return count >= 3 && third >= tile * 0.6 ? 3 : 2;
} }
/* A string id is a people slug; a numeric or missing one is a /* A string id is a people slug; a numeric or missing one is a

View file

@ -5,10 +5,9 @@
tracking cookies, and videos and maps from other companies wait tracking cookies, and videos and maps from other companies wait
for a click (VideoPlayer, HeroStage, ScheduleBlock). Because for a click (VideoPlayer, HeroStage, ScheduleBlock). Because
nothing loads before that, a notice is enough, rather than a nothing loads before that, a notice is enough, rather than a
consent banner that blocks the page. Analytics are Plausible, consent banner that blocks the page. If an embed ever loads on
self-hosted and cookieless, which needs no consent either. If an its own, or analytics are added, this has to become a real
embed ever loads on its own, or anything sets a tracking cookie, consent choice.
this has to become a real consent choice.
Closed is remembered in this browser; blocked storage just Closed is remembered in this browser; blocked storage just
means it shows again next time. means it shows again next time.
@ -43,7 +42,7 @@ export default function PrivacyNotice() {
<div <div
role="region" role="region"
aria-label="Privacy notice" aria-label="Privacy notice"
className="fixed bottom-20 left-4 right-4 z-40 sm:bottom-4 mx-auto max-w-md border border-brand/20 bg-surface p-4 text-sm text-body shadow-xl sm:right-auto" className="fixed bottom-4 left-4 right-4 z-40 mx-auto max-w-md border border-brand/20 bg-surface p-4 text-sm text-body shadow-xl sm:right-auto"
> >
<p> <p>
No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press

View file

@ -99,10 +99,8 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
return ( return (
<li className="border-b border-brand/10 last:border-b-0"> <li className="border-b border-brand/10 last:border-b-0">
{/* On a phone the time sits on its own line above the entry, <div className="flex gap-4 py-4 sm:gap-6">
leaving the title the full width. */} <p className="w-24 shrink-0 pt-0.5 text-sm font-semibold sm:w-32" style={{ color: accentText(accent) }}>
<div className="flex flex-wrap gap-x-4 gap-y-1 py-4 sm:flex-nowrap sm:gap-6">
<p className="w-full shrink-0 pt-0.5 text-sm font-semibold sm:w-32" style={{ color: accentText(accent) }}>
{entry.time} {entry.time}
</p> </p>
@ -133,7 +131,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
aria-expanded={open} aria-expanded={open}
aria-controls={panelId} aria-controls={panelId}
aria-label={open ? `Less about ${entry.text}` : `More about ${entry.text}`} aria-label={open ? `Less about ${entry.text}` : `More about ${entry.text}`}
className="h-10 w-10 shrink-0 btn border text-sm transition-colors hover:bg-tint" className="h-8 w-8 shrink-0 btn border text-sm transition-colors hover:bg-tint"
style={{ borderColor: `${withAlpha(accent, 33)}`, color: accentText(accent) }} style={{ borderColor: `${withAlpha(accent, 33)}`, color: accentText(accent) }}
> >
<CaretDown <CaretDown

View file

@ -5,8 +5,6 @@
@import '@fontsource/poppins/600.css'; @import '@fontsource/poppins/600.css';
@import '@fontsource/poppins/700.css'; @import '@fontsource/poppins/700.css';
@import '@fontsource/poppins/800.css'; /* the front page's stat numbers only */ @import '@fontsource/poppins/800.css'; /* the front page's stat numbers only */
@import '@fontsource/opendyslexic/400.css'; /* the accessibility panel's font, */
@import '@fontsource/opendyslexic/700.css'; /* only downloaded when chosen */
@import 'tailwindcss'; @import 'tailwindcss';
@ -112,13 +110,6 @@ html {
scroll-behavior: smooth; scroll-behavior: smooth;
} }
/* An email address is one long word: let it break anywhere rather
than push a button or card past a phone's edge. */
a[href^="mailto:"] {
overflow-wrap: anywhere;
max-width: 100%;
}
/* One visible focus ring for keyboard users, wherever a component /* One visible focus ring for keyboard users, wherever a component
doesn't draw its own. */ doesn't draw its own. */
:focus-visible { :focus-visible {
@ -218,62 +209,6 @@ iframe[src*="churchcenter"] {
--btn-radius: 0.5rem; --btn-radius: 0.5rem;
} }
/* ── Accessibility choices (AccessibilityPanel.tsx) ──────────────
Set on <html> before the first paint (index.html) and by the
panel. */
/* Dyslexia-friendly font: every typeface, headings and buttons too. */
:root[data-font="dyslexic"] {
--font-display: 'OpenDyslexic', sans-serif;
--font-body: 'OpenDyslexic', sans-serif;
}
:root[data-font="dyslexic"] body,
:root[data-font="dyslexic"] h1,
:root[data-font="dyslexic"] h2,
:root[data-font="dyslexic"] h3,
:root[data-font="dyslexic"] h4,
:root[data-font="dyslexic"] h5,
:root[data-font="dyslexic"] h6,
:root[data-font="dyslexic"] button,
:root[data-font="dyslexic"] input,
:root[data-font="dyslexic"] textarea,
:root[data-font="dyslexic"] select {
font-family: 'OpenDyslexic', sans-serif;
}
/* Reading mode: the same content with the design stepped back. No
background circles, motion or shadows; every layout one column,
narrower and larger, with plain underlined links. */
:root[data-reading="on"] {
font-size: 112.5%;
scroll-behavior: auto;
}
:root[data-reading="on"] .page-backdrop {
display: none;
}
:root[data-reading="on"] *,
:root[data-reading="on"] *::before,
:root[data-reading="on"] *::after {
animation: none !important;
transition: none !important;
box-shadow: none !important;
}
:root[data-reading="on"] main {
max-width: 48rem;
margin-inline: auto;
}
:root[data-reading="on"] main .grid {
grid-template-columns: minmax(0, 1fr) !important;
}
:root[data-reading="on"] main p,
:root[data-reading="on"] main li {
line-height: 1.75;
}
:root[data-reading="on"] main a {
text-decoration: underline;
text-underline-offset: 0.2em;
}
/* A notice where content would be (an empty section, a form's /* A notice where content would be (an empty section, a form's
note, "coming soon"): no box and no fill, just two thick brackets note, "coming soon"): no box and no fill, just two thick brackets
at opposite corners, top left and bottom right, like a at opposite corners, top left and bottom right, like a
@ -378,10 +313,7 @@ iframe[src*="churchcenter"] {
@container (max-width: 30rem) { @container (max-width: 30rem) {
.ev-grid { .ev-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
/* The logo gets its own row: without one, grid-area: image made
an extra column beside the text. */
grid-template-areas: grid-template-areas:
"image"
"org" "org"
"info" "info"
"desc"; "desc";

View file

@ -1,147 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
NEWSLETTER: email-ready HTML and plain text from picked items
The admin's Newsletter tool (AdminNewsletter.tsx) gathers events,
blog posts and featured cards; this turns them into one email to
paste into Mailchimp, Gmail or Church Center. Nothing is sent or
stored here.
Email clients ignore stylesheets, CSS variables and most layout,
so the HTML is tables with inline styles at 600px, images with
width and alt, and the palette written out as hex (the one place
the site's colors are literals: an inbox has no theme tokens). A
plain-text copy goes alongside for clients that show no HTML.
═══════════════════════════════════════════════════════════════ */
export type NewsletterItem = {
title: string
/** A line under the title: dates and place, a byline. */
meta?: string | null
text?: string | null
/** An absolute image URL. */
image?: string | null
/** An absolute link. */
href: string
cta: string
}
export type NewsletterSection = { heading: string; items: NewsletterItem[] }
export type Newsletter = {
title: string
intro?: string | null
sections: NewsletterSection[]
/** The site's address, for the header link and footer. */
origin: string
siteName: string
/** An absolute URL of the logo for the header. */
logo?: string | null
}
/* The palette as an inbox needs it. */
const COLOR = {
ink: '#001011',
body: '#003a45',
muted: '#3b5456',
teal: '#00748a',
page: '#f5f9f8',
card: '#ffffff',
rule: '#d6f5fa',
}
const FONT = "'Poppins', Helvetica, Arial, sans-serif"
const BODY_FONT = "'Montserrat', Helvetica, Arial, sans-serif"
const escape = (value: string) =>
value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
/* Paragraphs from text with blank lines between them. */
const paragraphs = (text: string, style: string) =>
text
.split(/\n\s*\n/)
.map((part) => part.trim())
.filter(Boolean)
.map((part) => `<p style="${style}">${escape(part).replace(/\n/g, '<br>')}</p>`)
.join('')
function itemHtml(item: NewsletterItem): string {
const image = item.image
? `<tr><td><a href="${escape(item.href)}"><img src="${escape(item.image)}" width="552" alt="" style="display:block;width:100%;max-width:552px;height:auto;border:0;"></a></td></tr>`
: ''
const meta = item.meta
? `<p style="margin:4px 0 0;font-family:${BODY_FONT};font-size:14px;line-height:20px;color:${COLOR.muted};">${escape(item.meta)}</p>`
: ''
const text = item.text
? paragraphs(item.text, `margin:12px 0 0;font-family:${BODY_FONT};font-size:15px;line-height:24px;color:${COLOR.body};`)
: ''
return `
<tr><td style="padding:0 24px 24px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${COLOR.card};border-left:4px solid ${COLOR.teal};">
${image}
<tr><td style="padding:20px 24px 24px;">
<h3 style="margin:0;font-family:${FONT};font-size:20px;line-height:26px;font-weight:700;color:${COLOR.ink};"><a href="${escape(item.href)}" style="color:${COLOR.ink};text-decoration:none;">${escape(item.title)}</a></h3>
${meta}${text}
<p style="margin:16px 0 0;"><a href="${escape(item.href)}" style="display:inline-block;padding:10px 20px;border-radius:8px;background:${COLOR.teal};color:#ffffff;font-family:${FONT};font-size:14px;font-weight:700;text-decoration:none;">${escape(item.cta)}</a></p>
</td></tr>
</table>
</td></tr>`
}
export function newsletterHtml(n: Newsletter): string {
const sections = n.sections
.filter((section) => section.items.length > 0)
.map(
(section) => `
<tr><td style="padding:16px 24px 12px;">
<h2 style="margin:0;padding-bottom:8px;border-bottom:2px solid ${COLOR.rule};font-family:${FONT};font-size:22px;line-height:28px;font-weight:700;color:${COLOR.teal};">${escape(section.heading)}</h2>
</td></tr>${section.items.map(itemHtml).join('')}`,
)
.join('')
const logo = n.logo
? `<a href="${escape(n.origin)}"><img src="${escape(n.logo)}" height="48" alt="${escape(n.siteName)}" style="display:block;height:48px;width:auto;border:0;"></a>`
: `<a href="${escape(n.origin)}" style="font-family:${FONT};font-size:18px;font-weight:700;color:#ffffff;text-decoration:none;">${escape(n.siteName)}</a>`
return `<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${escape(n.title)}</title>
</head>
<body style="margin:0;padding:0;background:${COLOR.page};">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${COLOR.page};">
<tr><td align="center" style="padding:24px 12px;">
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="width:100%;max-width:600px;background:${COLOR.page};">
<tr><td style="padding:20px 24px;background:${COLOR.body};">${logo}</td></tr>
<tr><td style="padding:28px 24px 8px;">
<h1 style="margin:0;font-family:${FONT};font-size:28px;line-height:34px;font-weight:700;color:${COLOR.ink};">${escape(n.title)}</h1>
${n.intro ? paragraphs(n.intro, `margin:12px 0 0;font-family:${BODY_FONT};font-size:16px;line-height:26px;color:${COLOR.body};`) : ''}
</td></tr>
${sections}
<tr><td style="padding:24px;border-top:2px solid ${COLOR.rule};font-family:${BODY_FONT};font-size:13px;line-height:20px;color:${COLOR.muted};">
${escape(n.siteName)}<br><a href="${escape(n.origin)}" style="color:${COLOR.teal};">${escape(n.origin.replace(/^https?:\/\//, ''))}</a>
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>`
}
export function newsletterText(n: Newsletter): string {
const lines = [n.title, '='.repeat(Math.min(n.title.length, 60)), '']
if (n.intro) lines.push(n.intro.trim(), '')
for (const section of n.sections) {
if (section.items.length === 0) continue
lines.push(section.heading.toUpperCase(), '')
for (const item of section.items) {
lines.push(item.title)
if (item.meta) lines.push(item.meta)
if (item.text) lines.push(item.text.trim())
lines.push(`${item.cta}: ${item.href}`, '')
}
}
lines.push('--', n.siteName, n.origin)
return lines.join('\n')
}

View file

@ -7,4 +7,4 @@
box or a build banner can read the same value later. box or a build banner can read the same value later.
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
export const SITE_VERSION = "NGU-Web.v1.10.4"; export const SITE_VERSION = "NGU-Web.v1.10.3";

View file

@ -24,7 +24,7 @@ const PAGE = sitePage("/privacy");
'privacy', in Admin → Forms → Data requests. 'privacy', in Admin → Forms → Data requests.
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
const LAST_UPDATED = "September 30, 2026"; const LAST_UPDATED = "September 29, 2026";
const link = "underline underline-offset-2 text-link"; const link = "underline underline-offset-2 text-link";
@ -105,13 +105,8 @@ const PARTS: LegalPart[] = [
], ],
list: [ list: [
<> <>
<strong>Giving</strong> is handled by Church Center (Planning Center), at{" "} <strong>Giving</strong> is handled by Church Center (Planning Center). Payment details go to them,
<a href="https://ngu.churchcenteronline.com" className="text-link underline underline-offset-2"> not to us.
ngu.churchcenteronline.com
</a>
. Payment details go to them, not to us. Church Center's script loads when you open our Giving page,
and its giving form opens when you press Give; Church Center may use Google Analytics in that form,
under its own privacy policy.
</>, </>,
<> <>
<strong>Videos</strong> come from YouTube, Facebook or Vimeo, and <strong>maps</strong> from Google <strong>Videos</strong> come from YouTube, Facebook or Vimeo, and <strong>maps</strong> from Google
@ -137,7 +132,7 @@ const PARTS: LegalPart[] = [
id: "cookies", id: "cookies",
heading: "Cookies and browser storage", heading: "Cookies and browser storage",
body: [ body: [
"This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which pages are read, we use Plausible Analytics, which we host ourselves on our own server: it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in your own browser so it works the way you left it:", "This site doesn't use advertising, analytics or tracking cookies. It keeps a few small things in your own browser so it works the way you left it:",
], ],
list: [ list: [
"That you closed the announcement banner or the privacy notice.", "That you closed the announcement banner or the privacy notice.",

View file

@ -1,292 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
NEWSLETTER (Tools)
Builds an email newsletter from what's already on the site: tick
upcoming events, published blog posts and the front page's
featured cards, write a title and an intro, and copy the result,
email-ready HTML or plain text, into Mailchimp, Gmail or Church
Center (or download it as a file). Nothing is sent or saved here;
the builder is src/lib/newsletter.ts.
Picked blog posts are read from their public pages, so only a
post visitors can open makes it in, with its excerpt and cover.
Links and images are the live site's (SITE_ORIGIN), since an
email is read far from this admin.
═══════════════════════════════════════════════════════════════ */
import { Check, Copy, DownloadSimple } from '@phosphor-icons/react'
import { useEffect, useMemo, useState } from 'react'
import { get } from '../../lib/api.ts'
import { useEvents } from '../../lib/eventData.ts'
import { useFrontPage, type FeaturedCard } from '../../lib/useFrontPage.ts'
import type { BlogPostRecord } from '../../lib/useBlog.ts'
import { blogHref, eventHref, refHref } from '../../lib/hrefs.ts'
import { mediaUrl } from '../../lib/media.ts'
import { SITE_NAME, SITE_ORIGIN, siteUrl } from '../../lib/site.ts'
import { seriesLabel } from '../../lib/eventSeries.ts'
import { useWideAdminPage } from '../../lib/adminWidth.tsx'
import { newsletterHtml, newsletterText, type NewsletterItem } from '../../lib/newsletter.ts'
const MUTED = 'var(--color-muted)'
const input =
'w-full border border-muted/25 bg-surface px-3 py-2 text-sm text-body outline-none focus:border-brand focus:ring-2 focus:ring-brand/25'
const button =
'btn inline-flex items-center gap-2 border border-brand px-4 py-2 text-sm text-link transition-colors hover:bg-tint disabled:opacity-50'
/* An address on the live site, whatever it started as. */
const absolute = (path: string | null | undefined) => (path ? siteUrl(path) : null)
const imageFor = (file: string | null | undefined) => absolute(mediaUrl(file))
type PostRow = { id: string; title: string; published_on?: string | null; is_published: number; is_listed: number }
function featuredHref(card: FeaturedCard): string | null {
if (card.kind === 'record' && card.ref) return refHref(card.ref.kind, card.ref.id, card.ref.org_kind)
return card.url
}
export default function AdminNewsletter() {
useWideAdminPage()
const [title, setTitle] = useState('')
const [intro, setIntro] = useState('')
const [pickedEvents, setPickedEvents] = useState<Set<string>>(new Set())
const [pickedPosts, setPickedPosts] = useState<Set<string>>(new Set())
const [pickedCards, setPickedCards] = useState<Set<number>>(new Set())
const [posts, setPosts] = useState<PostRow[] | null>(null)
const [postDetails, setPostDetails] = useState<Record<string, BlogPostRecord>>({})
const [copied, setCopied] = useState<'html' | 'text' | null>(null)
const { events, loading: eventsLoading } = useEvents({ status: 'upcoming' })
const { data: frontPage } = useFrontPage()
const cards = frontPage?.featured ?? []
useEffect(() => {
get('/admin/blog_posts?limit=200', { ttl: 0 })
.then((data: { rows: PostRow[] }) => setPosts(data.rows.filter((row) => row.is_published && row.is_listed)))
.catch(() => setPosts([]))
}, [])
// A picked post's public page: its excerpt and cover, and proof it's live.
useEffect(() => {
for (const id of pickedPosts) {
if (postDetails[id]) continue
get(`/blog/${encodeURIComponent(id)}`)
.then((data: { post: BlogPostRecord }) => setPostDetails((current) => ({ ...current, [id]: data.post })))
.catch(() => {})
}
}, [pickedPosts, postDetails])
const toggle = <T,>(set: Set<T>, value: T, update: (next: Set<T>) => void) => {
const next = new Set(set)
if (next.has(value)) next.delete(value)
else next.add(value)
update(next)
}
const newsletter = useMemo(() => {
const eventItems: NewsletterItem[] = events
.filter((event) => pickedEvents.has(event.id))
.map((event) => ({
title: event.title,
meta: [seriesLabel(event.series, event.starts_on) ?? event.date_label, event.is_online && !event.location_label ? 'Online' : event.location_label]
.filter(Boolean)
.join(', '),
text: event.tagline ?? event.description?.[0] ?? null,
image: imageFor(event.card_image),
href: siteUrl(eventHref(event.id)),
cta: 'Event details',
}))
const postItems: NewsletterItem[] = (posts ?? [])
.filter((row) => pickedPosts.has(row.id) && postDetails[row.id])
.map((row) => {
const post = postDetails[row.id]
const byline = post.authors.map((a) => a.name).concat(post.guest ? [post.guest.name] : []).join(', ')
return {
title: post.title,
meta: byline ? `By ${byline}` : null,
text: post.excerpt ?? null,
image: imageFor(post.cover_image),
href: siteUrl(blogHref(post.id)),
cta: 'Read the post',
}
})
const cardItems: NewsletterItem[] = cards
.map((card, index) => ({ card, index, href: featuredHref(card) }))
.filter(({ index, href }) => pickedCards.has(index) && href)
.map(({ card, href }) => ({
title: card.title ?? 'Featured',
meta: card.eyebrow ?? null,
text: card.blurb ?? null,
image: card.image ? imageFor(card.image.file) : null,
href: absolute(href) ?? href!,
cta: card.kind === 'video' ? 'Watch' : 'Learn more',
}))
const content = {
title: title.trim() || `News from ${SITE_NAME}`,
intro: intro.trim() || null,
origin: SITE_ORIGIN,
siteName: SITE_NAME,
// The site's logo is an SVG, which Gmail and Outlook don't show,
// so the header is the site name in type. A PNG logo could go here.
logo: null,
sections: [
{ heading: 'Coming up', items: eventItems },
{ heading: 'From the blog', items: postItems },
{ heading: 'Featured', items: cardItems },
],
}
return { html: newsletterHtml(content), text: newsletterText(content), count: eventItems.length + postItems.length + cardItems.length }
}, [title, intro, events, pickedEvents, posts, pickedPosts, postDetails, cards, pickedCards])
async function copy(kind: 'html' | 'text') {
try {
await navigator.clipboard.writeText(kind === 'html' ? newsletter.html : newsletter.text)
setCopied(kind)
window.setTimeout(() => setCopied(null), 2000)
} catch {
setCopied(null)
}
}
function download() {
const blob = new Blob([newsletter.html], { type: 'text/html' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = `newsletter-${new Date().toISOString().slice(0, 10)}.html`
link.click()
URL.revokeObjectURL(link.href)
}
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-link">Newsletter</h1>
<p className="text-sm" style={{ color: MUTED }}>
Pick what to include, then copy the email into Mailchimp, Gmail or Church Center.
</p>
</div>
<div className="mt-6 grid gap-8 lg:grid-cols-[minmax(0,26rem)_minmax(0,1fr)]">
<div className="space-y-6">
<section className="space-y-3 border-l-4 border-brand bg-raised p-5 shadow-sm">
<label className="block text-sm font-semibold text-body">
Title
<input value={title} onChange={(e) => setTitle(e.target.value)} placeholder={`News from ${SITE_NAME}`} className={`mt-1 ${input}`} />
</label>
<label className="block text-sm font-semibold text-body">
Intro
<textarea
value={intro}
onChange={(e) => setIntro(e.target.value)}
rows={4}
placeholder="eg. A few things coming up this month…"
className={`mt-1 resize-y ${input}`}
/>
</label>
</section>
<PickList
title="Upcoming events"
empty={eventsLoading ? 'Loading…' : 'No upcoming events.'}
options={events.map((event) => ({ value: event.id, label: event.title, detail: event.date_label }))}
picked={pickedEvents}
onToggle={(value) => toggle(pickedEvents, value, setPickedEvents)}
/>
<PickList
title="Blog posts"
empty={posts ? 'No published posts.' : 'Loading…'}
options={(posts ?? []).map((post) => ({ value: post.id, label: post.title, detail: post.published_on }))}
picked={pickedPosts}
onToggle={(value) => toggle(pickedPosts, value, setPickedPosts)}
/>
<PickList
title="Featured cards (front page)"
empty="No featured cards."
options={cards.map((card, index) => ({ value: index, label: card.title ?? card.url ?? 'Card', detail: card.kind }))}
picked={pickedCards}
onToggle={(value) => toggle(pickedCards, value, setPickedCards)}
/>
</div>
<div>
<div className="flex flex-wrap gap-3">
<button type="button" onClick={() => copy('html')} className={button} disabled={newsletter.count === 0}>
{copied === 'html' ? <Check weight="bold" aria-hidden="true" /> : <Copy weight="bold" aria-hidden="true" />}
{copied === 'html' ? 'Copied' : 'Copy HTML'}
</button>
<button type="button" onClick={() => copy('text')} className={button} disabled={newsletter.count === 0}>
{copied === 'text' ? <Check weight="bold" aria-hidden="true" /> : <Copy weight="bold" aria-hidden="true" />}
{copied === 'text' ? 'Copied' : 'Copy plain text'}
</button>
<button type="button" onClick={download} className={button} disabled={newsletter.count === 0}>
<DownloadSimple weight="bold" aria-hidden="true" />
Download .html
</button>
</div>
<p className="mt-2 text-xs" style={{ color: MUTED }}>
{newsletter.count === 0
? 'Tick at least one item to build the email.'
: `${newsletter.count} item${newsletter.count === 1 ? '' : 's'}. In Mailchimp, paste the HTML into a Code block or "Paste in code".`}
</p>
<iframe
title="Newsletter preview"
srcDoc={newsletter.html}
sandbox=""
className="mt-4 h-[70vh] w-full border border-brand/20 bg-white"
/>
</div>
</div>
</div>
)
}
function PickList<T extends string | number>({
title,
empty,
options,
picked,
onToggle,
}: {
title: string
empty: string
options: Array<{ value: T; label: string; detail?: string | null }>
picked: Set<T>
onToggle: (value: T) => void
}) {
return (
<section className="border-l-4 border-brand bg-raised p-5 shadow-sm">
<h2 className="text-base font-bold text-ink">{title}</h2>
{options.length === 0 ? (
<p className="mt-2 text-sm" style={{ color: MUTED }}>
{empty}
</p>
) : (
<ul className="mt-2 max-h-72 space-y-1 overflow-y-auto">
{options.map((option) => (
<li key={String(option.value)}>
<label className="flex cursor-pointer items-start gap-3 px-2 py-1.5 hover:bg-tint-soft">
<input
type="checkbox"
checked={picked.has(option.value)}
onChange={() => onToggle(option.value)}
className="mt-1 h-4 w-4 accent-[var(--color-action)]"
/>
<span className="min-w-0">
<span className="block text-sm text-ink">{option.label}</span>
{option.detail && (
<span className="block text-xs" style={{ color: MUTED }}>
{option.detail}
</span>
)}
</span>
</label>
</li>
))}
</ul>
)}
</section>
)
}

View file

@ -148,11 +148,6 @@ export const TOOLS_NAV = {
blurb: "Cut clips from our YouTube and Facebook videos: trimmed, reshaped for Reels, or audio only.", blurb: "Cut clips from our YouTube and Facebook videos: trimmed, reshaped for Reels, or audio only.",
minRole: "admin", minRole: "admin",
}, },
{
to: "/admin/newsletter",
label: "Newsletter",
blurb: "An email newsletter from upcoming events, blog posts and featured cards, ready to paste into Mailchimp or Gmail.",
},
{ {
to: "/qr", to: "/qr",
label: "QR code generator", label: "QR code generator",

View file

@ -190,25 +190,25 @@ export function Card({
// past event) keeps its links out of the tab order too. // past event) keeps its links out of the tab order too.
inert={!interactive} inert={!interactive}
> >
<div className={`flex-1 flex flex-col ${compact ? "p-6 sm:p-8" : "p-6 sm:p-10"}`}> <div className={`flex-1 flex flex-col ${compact ? "p-8" : "p-10"}`}>
{compact ? ( {compact ? (
/* ── GRID CARD: layout driven by .ev-grid container queries ── */ /* ── GRID CARD: layout driven by .ev-grid container queries ── */
<div className="ev-grid mb-2"> <div className="ev-grid mb-2">
<Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" /> <Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" />
<div className="ev-info"> <div className="ev-info">
{typeBadge} {typeBadge}
<h3 className="text-2xl sm:text-3xl font-bold leading-tight [overflow-wrap:anywhere]"> <h3 className="text-3xl font-bold leading-tight">
<TitleLink ev={ev} linked={linked}> <TitleLink ev={ev} linked={linked}>
{ev.title} {ev.title}
</TitleLink> </TitleLink>
</h3> </h3>
{ev.theme && ( {ev.theme && (
<p className="text-lg sm:text-xl font-bold">"{ev.theme}"</p> <p className="text-xl font-normal font-bold">"{ev.theme}"</p>
)} )}
{ev.date_label && <p className="text-lg sm:text-xl">{ev.date_label}</p>} {ev.date_label && <p className="text-xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-xl">{schedule}</p>} {schedule && <p className="text-xl">{schedule}</p>}
{ev.location_label && ( {ev.location_label && (
<p className="text-lg sm:text-xl">{ev.location_label}</p> <p className="text-xl">{ev.location_label}</p>
)} )}
</div> </div>
<Logo <Logo
@ -225,18 +225,18 @@ export function Card({
<div className="md:col-span-2"> <div className="md:col-span-2">
<Logo src={orgLogo} className="h-15 w-auto mb-6" /> <Logo src={orgLogo} className="h-15 w-auto mb-6" />
{typeBadge} {typeBadge}
<h3 className="text-2xl sm:text-4xl font-bold [overflow-wrap:anywhere]"> <h3 className="text-4xl font-bold">
<TitleLink ev={ev} linked={linked}> <TitleLink ev={ev} linked={linked}>
{ev.title} {ev.title}
</TitleLink> </TitleLink>
</h3> </h3>
{ev.theme && ( {ev.theme && (
<p className="text-lg sm:text-2xl font-bold">"{ev.theme}"</p> <p className="text-2xl font-normal font-bold">"{ev.theme}"</p>
)} )}
{ev.date_label && <p className="text-lg sm:text-2xl">{ev.date_label}</p>} {ev.date_label && <p className="text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-2xl">{schedule}</p>} {schedule && <p className="text-2xl">{schedule}</p>}
{ev.location_label && ( {ev.location_label && (
<p className="text-lg sm:text-2xl">{ev.location_label}</p> <p className="text-2xl">{ev.location_label}</p>
)} )}
</div> </div>
<div className="md:col-span-1 flex items-center justify-end"> <div className="md:col-span-1 flex items-center justify-end">
@ -496,18 +496,6 @@ export default function EventListCards({
const prev = () => setIndex(i => Math.max(0, i - 1)); const prev = () => setIndex(i => Math.max(0, i - 1));
const next = () => setIndex(i => Math.min(events.length - 1, i + 1)); const next = () => setIndex(i => Math.min(events.length - 1, i + 1));
// A sideways swipe of 40px or more on a touch screen turns the carousel.
const swipeFrom = useRef<number | null>(null);
const onTouchStart = (e: React.TouchEvent) => { swipeFrom.current = e.touches[0]?.clientX ?? null; };
const onTouchEnd = (e: React.TouchEvent) => {
const from = swipeFrom.current;
swipeFrom.current = null;
const to = e.changedTouches[0]?.clientX;
if (from == null || to == null || Math.abs(to - from) < 40) return;
if (to < from) next();
else prev();
};
// Arrows and dots follow the section accent, not the active card. // Arrows and dots follow the section accent, not the active card.
const arrowStyle = enabled => ({ const arrowStyle = enabled => ({
border: `1px solid ${accent}`, border: `1px solid ${accent}`,
@ -628,7 +616,7 @@ export default function EventListCards({
<button <button
onClick={() => setShowPast(v => !v)} onClick={() => setShowPast(v => !v)}
aria-expanded={showPast} aria-expanded={showPast}
className="btn flex items-center gap-2 py-2.5 px-6 transition-all duration-200 hover:scale-105" className="flex items-center gap-2 py-2.5 px-6 font-bold transition-all duration-200 hover:scale-105"
style={{ border: `1px solid ${accent}`, color: accentText(accent) }} style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
> >
{showPast {showPast
@ -643,7 +631,7 @@ export default function EventListCards({
) : ( ) : (
/* ── CAROUSEL VIEW ── */ /* ── CAROUSEL VIEW ── */
<> <>
<div className="relative mb-6" onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}> <div className="relative mb-6">
<div <div
className="overflow-hidden" className="overflow-hidden"
style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }} style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }}
@ -685,7 +673,7 @@ export default function EventListCards({
onClick={prev} onClick={prev}
disabled={index === 0} disabled={index === 0}
aria-label="Previous event" aria-label="Previous event"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100" className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index > 0)} style={arrowStyle(index > 0)}
> >
<CaretLeft size={20} weight="bold" aria-hidden="true" /> <CaretLeft size={20} weight="bold" aria-hidden="true" />
@ -694,7 +682,7 @@ export default function EventListCards({
onClick={next} onClick={next}
disabled={index === events.length - 1} disabled={index === events.length - 1}
aria-label="Next event" aria-label="Next event"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100" className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index < events.length - 1)} style={arrowStyle(index < events.length - 1)}
> >
<CaretRight size={20} weight="bold" aria-hidden="true" /> <CaretRight size={20} weight="bold" aria-hidden="true" />
@ -704,45 +692,20 @@ export default function EventListCards({
</div> </div>
{events.length > 1 && ( {events.length > 1 && (
<div className="flex flex-wrap items-center justify-center"> <div className="flex justify-center gap-2">
{/* On a phone the side arrows would sit on the card's text,
so they move down here, beside the dots. */}
<button
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index > 0)}
>
<CaretLeft size={18} weight="bold" aria-hidden="true" />
</button>
{events.map((e, i) => ( {events.map((e, i) => (
<button <button
key={e.id} key={e.id}
onClick={() => setIndex(i)} onClick={() => setIndex(i)}
aria-label={`Go to ${e.title}`} aria-label={`Go to ${e.title}`}
aria-current={i === index ? "true" : undefined} aria-current={i === index ? "true" : undefined}
// A 40px tap target around the small dot it draws. className="h-2.5 rounded-full transition-all duration-200"
className="flex h-10 items-center px-1" style={{
> width: i === index ? "1.5rem" : "0.625rem",
<span background: i === index ? accent : withAlpha("var(--color-muted)", 40),
className="block h-2.5 rounded-full transition-all duration-200" }}
style={{ />
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
</button>
))} ))}
<button
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index < events.length - 1)}
>
<CaretRight size={18} weight="bold" aria-hidden="true" />
</button>
</div> </div>
)} )}
</> </>

View file

@ -44,14 +44,14 @@ function OrgCard({ org, accent, pageLabel, siteLabel }) {
return ( return (
<div <div
className="p-4 sm:p-6 h-full flex flex-col transition-transform duration-200 hover:scale-[1.01]" className="p-6 h-full flex flex-col transition-transform duration-200 hover:scale-[1.01]"
style={{ border: `1px solid ${color}`, background: "var(--color-surface)" }} style={{ border: `1px solid ${color}`, background: "var(--color-surface)" }}
> >
<div className="flex items-start gap-3 sm:gap-4"> <div className="flex items-start gap-4">
<OrgLogo org={org} color={color} size="h-10 w-10 sm:h-14 sm:w-14" /> <OrgLogo org={org} color={color} />
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<h3 className="text-lg sm:text-xl font-bold leading-tight [overflow-wrap:anywhere]" style={{ color }}> <h3 className="text-xl font-bold leading-tight" style={{ color }}>
{org.name} {org.name}
</h3> </h3>
{subtitle && ( {subtitle && (

View file

@ -470,16 +470,16 @@ function RegionBlock({
function GroupCard({ group, color, open, onOpen }) { function GroupCard({ group, color, open, onOpen }) {
return ( return (
<div <div
className="p-4 flex flex-wrap items-start gap-3 sm:gap-4 transition-all duration-200" className="p-4 flex items-start gap-4 transition-all duration-200"
style={{ style={{
border: `1px solid ${color}`, border: `1px solid ${color}`,
background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)", background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)",
}} }}
> >
<OrgLogo org={group} color={color} size="h-10 w-10 sm:h-14 sm:w-14" /> <OrgLogo org={group} color={color} />
<div className="min-w-[8rem] flex-1"> <div className="min-w-0 flex-1">
<p className="font-bold leading-tight [overflow-wrap:anywhere]">{group.name}</p> <p className="font-bold leading-tight">{group.name}</p>
<p className="text-sm" style={{ color: FALLBACK_COLOR }}> <p className="text-sm" style={{ color: FALLBACK_COLOR }}>
{group.location_label} {group.location_label}
</p> </p>
@ -494,12 +494,12 @@ function GroupCard({ group, color, open, onOpen }) {
detail panel in place, the arrow leaves for the group's detail panel in place, the arrow leaves for the group's
own page. Keeping them distinct beats one control that own page. Keeping them distinct beats one control that
does different things depending on where you click. */} does different things depending on where you click. */}
<div className="ml-auto shrink-0 flex items-center gap-2"> <div className="shrink-0 flex items-center gap-2">
<button <button
onClick={onOpen} onClick={onOpen}
aria-expanded={open} aria-expanded={open}
aria-label={`${open ? "Hide" : "View"} details for ${group.name}`} aria-label={`${open ? "Hide" : "View"} details for ${group.name}`}
className="h-10 w-10 btn flex items-center justify-center transition-transform duration-200 hover:scale-110" className="h-9 w-9 btn flex items-center justify-center transition-transform duration-200 hover:scale-110"
style={{ style={{
border: `1px solid ${color}`, border: `1px solid ${color}`,
color, color,
@ -540,21 +540,21 @@ function GroupDetail({ group, region, onClose }) {
return ( return (
<div <div
className="p-4 sm:p-6 mb-6" className="p-6 mb-6"
style={{ border: `2px solid ${colorOf(region)}`, background: `color-mix(in srgb, ${colorOf(region)} 6%, var(--color-raised))` }} style={{ border: `2px solid ${colorOf(region)}`, background: `color-mix(in srgb, ${colorOf(region)} 6%, var(--color-raised))` }}
> >
<div className="flex items-start gap-4"> <div className="flex items-start gap-4">
<OrgLogo org={group} color={colorOf(region)} size="h-12 w-12 sm:h-20 sm:w-20" /> <OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className="text-xl sm:text-2xl font-display font-bold leading-tight [overflow-wrap:anywhere]">{group.name}</p> <p className="text-2xl font-display font-bold leading-tight">{group.name}</p>
<p style={{ color: FALLBACK_COLOR }}>{group.location_label}</p> <p style={{ color: FALLBACK_COLOR }}>{group.location_label}</p>
</div> </div>
<button <button
onClick={onClose} onClick={onClose}
aria-label="Close details" aria-label="Close details"
className="shrink-0 h-10 w-10 btn flex items-center justify-center text-lg transition-transform duration-200 hover:scale-110" className="shrink-0 h-8 w-8 btn flex items-center justify-center text-lg transition-transform duration-200 hover:scale-110"
style={{ border: `1px solid ${colorOf(region)}`, color: colorOf(region) }} style={{ border: `1px solid ${colorOf(region)}`, color: colorOf(region) }}
> >
<X size={20} weight="bold" aria-hidden="true" /> <X size={20} weight="bold" aria-hidden="true" />
@ -844,19 +844,13 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
shell( shell(
<div className="grid grid-cols-1 lg:grid-cols-[1.45fr_1fr] gap-10 items-stretch"> <div className="grid grid-cols-1 lg:grid-cols-[1.45fr_1fr] gap-10 items-stretch">
{/* Map */} {/* Map */}
<div className="min-w-0"> <div>
{/* On a phone the map keeps a readable size (tiles big enough <RegionMap
to read and tap) and scrolls sideways in its own box. */} slices={slices}
<div className="-mx-6 overflow-x-auto px-6 sm:mx-0 sm:px-0"> groupCounts={groupCounts}
<div className="min-w-[34rem] sm:min-w-0"> onPick={pickArea}
<RegionMap {...shared}
slices={slices} />
groupCounts={groupCounts}
onPick={pickArea}
{...shared}
/>
</div>
</div>
<Legend <Legend
domestic={domestic} domestic={domestic}
international={international} international={international}

View file

@ -544,13 +544,6 @@ a.site-tl__entry--featured:hover {
opacity: 1; opacity: 1;
} }
/* A touch screen has no hover to bring it up, so it reads in full. */
@media (hover: none) {
.site-tl__upcomingList {
opacity: 1;
}
}
@keyframes site-tl-rise { @keyframes site-tl-rise {
from { from {
opacity: 0; opacity: 0;

View file

@ -141,7 +141,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
}} }}
> >
{featured.map((item, index) => ( {featured.map((item, index) => (
<li key={item.id} className="w-[min(19rem,80vw)] shrink-0 md:w-[22rem]"> <li key={item.id} className="w-[19rem] shrink-0 md:w-[22rem]">
<RailCard <RailCard
item={item} item={item}
showYear={index === 0 || year(item) !== year(featured[index - 1])} showYear={index === 0 || year(item) !== year(featured[index - 1])}
@ -149,7 +149,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
</li> </li>
))} ))}
<li className="w-[min(19rem,80vw)] shrink-0 md:w-[22rem]"> <li className="w-[19rem] shrink-0 md:w-[22rem]">
<div className="flex h-full flex-col"> <div className="flex h-full flex-col">
<div className="h-12" /> <div className="h-12" />
<Link <Link

View file

@ -74,9 +74,7 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
return ( return (
<section <section
id="hero" id="hero"
className={`relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 ${ className="relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 pb-16"
backdrop === 'photos' ? 'pb-36 sm:pb-28' : 'pb-16'
}`}
style={{ background: DEEP }} style={{ background: DEEP }}
> >
{backdrop === 'photos' ? ( {backdrop === 'photos' ? (
@ -159,8 +157,8 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
about two lines. */} about two lines. */}
<h1 <h1
className={`hp-rise font-display font-bold leading-[1.02] tracking-tight ${ className={`hp-rise font-display font-bold leading-[1.02] tracking-tight ${
beside ? 'text-4xl md:text-5xl' : 'text-4xl sm:text-5xl md:text-6xl lg:text-7xl' beside ? 'text-4xl md:text-5xl' : 'text-5xl md:text-6xl lg:text-7xl'
} [overflow-wrap:anywhere]`} }`}
style={{ animationDelay: '60ms' }} style={{ animationDelay: '60ms' }}
> >
{hero.headline} {hero.headline}
@ -188,13 +186,12 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
Both set: one cell in two halves, the primary filled on the left Both set: one cell in two halves, the primary filled on the left
and the secondary clear on the right, split by a slash (the and the secondary clear on the right, split by a slash (the
filled half's slanted edge, which the clear half tucks under). filled half's slanted edge, which the clear half tucks under).
On a phone the halves stack instead, filled on top, since two One set: that one alone, in its own style. */
labels side by side don't fit; the slash starts at sm (home.css,
.hp-split). One set: that one alone, in its own style. */
const SLANT = '1.75rem'
const PRIMARY_FILL = '#f0bd4f' const PRIMARY_FILL = '#f0bd4f'
const PRIMARY_TEXT = '#001011' const PRIMARY_TEXT = '#001011'
const HALF = 'relative flex items-center justify-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]' const HALF = 'relative flex items-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]'
type HeroLink = Hero['primary'] type HeroLink = Hero['primary']
@ -203,15 +200,24 @@ function HeroActions({ primary, secondary }: { primary: HeroLink; secondary: Her
if (primary && secondary) { if (primary && secondary) {
return ( return (
<div className="hp-split btn max-w-full overflow-hidden border border-white/35"> <div className="btn inline-flex max-w-full overflow-hidden border border-white/35">
<HomeLink <HomeLink
url={primary.url} url={primary.url}
className={`hp-split__primary ${HALF} z-10 hover:brightness-95`} className={`${HALF} z-10 hover:brightness-95`}
style={{ background: PRIMARY_FILL, color: PRIMARY_TEXT }} style={{
background: PRIMARY_FILL,
color: PRIMARY_TEXT,
paddingRight: `calc(2rem + ${SLANT})`,
clipPath: `polygon(0 0, 100% 0, calc(100% - ${SLANT}) 100%, 0 100%)`,
}}
> >
{primary.label} {primary.label}
</HomeLink> </HomeLink>
<HomeLink url={secondary.url} className={`hp-split__secondary ${HALF} text-white hover:bg-white/10`}> <HomeLink
url={secondary.url}
className={`${HALF} text-white hover:bg-white/10`}
style={{ marginLeft: `-${SLANT}`, paddingLeft: `calc(2rem + ${SLANT})` }}
>
{secondary.label} {arrow} {secondary.label} {arrow}
</HomeLink> </HomeLink>
</div> </div>
@ -317,8 +323,8 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
)} )}
{slides.length > 1 && ( {slides.length > 1 && (
<div className="ml-auto flex flex-wrap items-center justify-end gap-x-1 gap-y-0"> <div className="ml-auto flex items-center gap-3">
<div className="flex flex-wrap justify-end"> <div className="flex gap-1.5">
{slides.map((slide, i) => ( {slides.map((slide, i) => (
<button <button
key={`${slide.media}-${i}`} key={`${slide.media}-${i}`}
@ -326,18 +332,15 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
onClick={() => setIndex(i)} onClick={() => setIndex(i)}
aria-label={`Show photo ${i + 1} of ${slides.length}`} aria-label={`Show photo ${i + 1} of ${slides.length}`}
aria-current={i === index} aria-current={i === index}
// A 40px tap target around the thin bar it draws. className="h-1.5 w-10 overflow-hidden bg-white/25"
className="flex h-10 w-11 items-center px-0.5"
> >
<span className="block h-1.5 w-full overflow-hidden bg-white/25"> <span
<span // Re-keyed per index so the fill restarts on every change.
// Re-keyed per index so the fill restarts on every change. key={`${index}-${i}`}
key={`${index}-${i}`} className={`hp-progress block h-full bg-white ${
className={`hp-progress block h-full bg-white ${ i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : '' } ${paused ? 'hp-progress--paused' : ''}`}
} ${paused ? 'hp-progress--paused' : ''}`} />
/>
</span>
</button> </button>
))} ))}
</div> </div>
@ -345,7 +348,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
type="button" type="button"
onClick={() => setPaused((p) => !p)} onClick={() => setPaused((p) => !p)}
aria-label={paused ? 'Play slideshow' : 'Pause slideshow'} aria-label={paused ? 'Play slideshow' : 'Pause slideshow'}
className="ml-2 flex h-10 w-10 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10" className="flex h-8 w-8 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10"
> >
{paused ? <Play size={14} weight="fill" aria-hidden="true" /> : <Pause size={14} weight="fill" aria-hidden="true" />} {paused ? <Play size={14} weight="fill" aria-hidden="true" /> : <Pause size={14} weight="fill" aria-hidden="true" />}
</button> </button>

View file

@ -55,14 +55,14 @@ export default function StatsBand({ id, title, blurb, stats }: StatsBandProps) {
</h2> </h2>
{blurb && <p className="mt-3 max-w-2xl text-white/70">{blurb}</p>} {blurb && <p className="mt-3 max-w-2xl text-white/70">{blurb}</p>}
<dl className="mt-12 grid grid-cols-2 gap-x-4 gap-y-14 sm:gap-x-8 md:grid-cols-4"> <dl className="mt-12 grid grid-cols-2 gap-x-8 gap-y-14 md:grid-cols-4">
{stats.map((stat, index) => ( {stats.map((stat, index) => (
<div <div
key={`${stat.label}-${index}`} key={`${stat.label}-${index}`}
className={`hp-stat border-l border-white/15 pl-4 sm:pl-6 ${seen ? 'hp-stat--in' : ''}`} className={`hp-stat border-l border-white/15 pl-6 ${seen ? 'hp-stat--in' : ''}`}
style={{ transitionDelay: `${index * 120}ms` }} style={{ transitionDelay: `${index * 120}ms` }}
> >
<dd className="font-display text-4xl font-extrabold leading-none text-white sm:text-5xl md:text-6xl"> <dd className="font-display text-5xl font-extrabold leading-none text-white md:text-6xl">
<CountUp value={stat.value} run={seen} /> <CountUp value={stat.value} run={seen} />
{stat.suffix && <span className="text-[#f0bd4f]">{stat.suffix}</span>} {stat.suffix && <span className="text-[#f0bd4f]">{stat.suffix}</span>}
</dd> </dd>

View file

@ -19,32 +19,6 @@
to { opacity: 1; transform: none; } to { opacity: 1; transform: none; }
} }
/* ── Hero: the split button cell (HeroStage.tsx, HeroActions) ────
Stacked on a phone; from sm, side by side and cut by a slash:
the filled half's slanted right edge, the clear half tucked under
it by the slant's width. */
.hp-split {
display: flex;
flex-direction: column;
}
@media (min-width: 40rem) {
.hp-split {
display: inline-flex;
flex-direction: row;
--hp-slant: 1.75rem;
}
.hp-split__primary {
padding-right: calc(2rem + var(--hp-slant));
clip-path: polygon(0 0, 100% 0, calc(100% - var(--hp-slant)) 100%, 0 100%);
}
.hp-split__secondary {
margin-left: calc(var(--hp-slant) * -1);
padding-left: calc(2rem + var(--hp-slant));
}
}
/* ── Hero: photos ────────────────────────────────────────────── */ /* ── Hero: photos ────────────────────────────────────────────── */
.hp-slide { .hp-slide {