Write the site in US English

color, center, canceled, labeled, recognize and the rest, in UI
text, help text, comments, docs and names (ColorInput, QrCenter).
Migration 053 renames the two Site settings color CHECKs, whose
names are the messages the admin shows. Kept: events.status's
stored value 'cancelled' (shown as canceled), aria-labelledby,
schema.org's EventCancelled, and old migrations as they ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-30 13:23:56 -05:00
parent 38aff34c97
commit 2ad65cdc15
60 changed files with 182 additions and 148 deletions

View file

@ -3,7 +3,7 @@
NGU's dove, lifted from the original home page. The path and its
two transforms are the drawing as exported, untouched; only the
wrapper changed, sized by the caller, coloured by currentColor,
wrapper changed, sized by the caller, colored by currentColor,
and hidden from screen readers since it's decoration wherever
it appears.

View file

@ -2,7 +2,7 @@
LOGO
An <img> for a logo or mark that may not exist: no src, or a file
that 404s, and it draws `fallback` instead (initials, a colour dot,
that 404s, and it draws `fallback` instead (initials, a color dot,
or nothing). `src` is already resolved (mediaUrl in media.ts). An
upload loads its 640px copy first (useSmallImage). Decorative by
default (alt ""), since a logo sits next to the name it stands for.

View file

@ -1,7 +1,7 @@
/* ═══════════════════════════════════════════════════════════════
ORG LOGO
An organization's logo, or its initials in a square in its colour
An organization's logo, or its initials in a square in its color
when there's no file or it fails to load. Decorative: the name is
always right beside it. Used by the organization lists and the
group map.

View file

@ -345,7 +345,7 @@ function buildTeamGroups(
return [
{
id: data.team.id,
// One unlabelled team needs no heading; several always do.
// One unlabeled team needs no heading; several always do.
label: teamCount > 1 || spec.label ? name : undefined,
accent,
people: data.people,

View file

@ -6,7 +6,7 @@ import type { Platform } from '../lib/platforms.ts'
PLATFORM ICON
The brand mark for a link's platform (links.platform), drawn in
currentColor so it takes the colour of the button it sits in.
currentColor so it takes the color of the button it sits in.
Anything that isn't one of PLATFORMS in lib/platforms.ts, blank
included, draws nothing, so a caller can always pass the field
straight through.

View file

@ -3,7 +3,7 @@
A QR code as an <svg>, sized by its container.
`centre` puts something on a badge over the middle: the NGU dove,
`center` puts something on a badge over the middle: the NGU dove,
or an image (an SVG from src/assets/qr, passed as a data: URL).
With anything there, the code switches to high error correction
so the modules under the badge are recovered when it's scanned
@ -17,7 +17,7 @@
doesn't, this just draws what it's given.
Everything is drawn in the SVG itself (no CSS, and an image is
embedded rather than linked), so the element serialises to a
embedded rather than linked), so the element serializes to a
file that looks the same outside the page. `ref` reaches the
<svg> for exactly that.
═══════════════════════════════════════════════════════════════ */
@ -42,11 +42,11 @@ const BADGE = 0.24
/* DoveMark's own viewBox is 72.87 × 48.57. */
const DOVE_ASPECT = 72.867699 / 48.568241
export type QrCentre = { kind: 'dove'; color?: string } | { kind: 'image'; src: string } | null
export type QrCenter = { kind: 'dove'; color?: string } | { kind: 'image'; src: string } | null
export default function QrCode({
value,
centre = null,
center = null,
ink = QR_INK,
paper = QR_PAPER,
label,
@ -54,7 +54,7 @@ export default function QrCode({
className,
}: {
value: string
centre?: QrCentre
center?: QrCenter
ink?: string
paper?: string
/** Accessible name for the image, e.g. "QR code for /retreats". */
@ -62,7 +62,7 @@ export default function QrCode({
ref?: Ref<SVGSVGElement>
className?: string
}) {
const level = centre ? 'H' : 'M'
const level = center ? 'H' : 'M'
const matrix = useMemo(() => qrMatrix(value, level), [value, level])
const path = useMemo(() => qrPath(matrix, MARGIN), [matrix])
@ -86,7 +86,7 @@ export default function QrCode({
<rect width={total} height={total} fill={paper} />
<path d={path} fill={ink} />
{centre && (
{center && (
<g shapeRendering="auto">
<rect
x={badgeAt}
@ -98,17 +98,17 @@ export default function QrCode({
stroke={ink}
strokeWidth={0.35}
/>
{centre.kind === 'dove' ? (
{center.kind === 'dove' ? (
<DoveMark
x={(total - doveWidth) / 2}
y={(total - doveHeight) / 2}
width={doveWidth}
height={doveHeight}
style={{ color: centre.color ?? QR_DOVE }}
style={{ color: center.color ?? QR_DOVE }}
/>
) : (
<image
href={centre.src}
href={center.src}
x={(total - imageSize) / 2}
y={(total - imageSize) / 2}
width={imageSize}

View file

@ -6,7 +6,7 @@
choice, else the system setting) so a dark visitor never sees a
white flash. Pressing this makes an explicit choice and remembers
it; until then the site follows the system, including a change
made while the page is open. Colours come from the tokens in
made while the page is open. Colors come from the tokens in
index.css.
═══════════════════════════════════════════════════════════════ */

View file

@ -140,7 +140,7 @@ const inputLocked =
/* ── Dotted paths ────────────────────────────────────────────── */
/* What an empty colour field shows in its swatch and placeholder:
/* What an empty color field shows in its swatch and placeholder:
the field's own default (a value, or one worked out from the row),
else the brand teal. */
function colorPlaceholder(field, row): string {

View file

@ -10,7 +10,7 @@
sends it (FeedbackForm's fixedType), with an email required.
'general' isn't offered anywhere; it's the server's fallback for
a type it doesn't recognise, so old rows still read sensibly.
a type it doesn't recognize, so old rows still read sensibly.
═══════════════════════════════════════════════════════════════ */
export const FEEDBACK_TYPES = [

View file

@ -12,16 +12,16 @@
--font-display: 'Poppins', sans-serif;
--font-body: 'Montserrat', sans-serif;
/* ── Colour tokens ─────────────────────────────────────────────
/* ── Color tokens ─────────────────────────────────────────────
Named for what they do, not what they look like, because dark
mode (below) swaps the values. Use them as utilities
(text-muted, bg-surface, border-brand/20) or, in a style prop,
as var(--color-muted). Every text colour passes WCAG AA (4.5:1)
as var(--color-muted). Every text color passes WCAG AA (4.5:1)
on surface, tint and tint-soft in both modes.
A colour that must stay the same in both modes (white text on
a dark band, a platform's own colour) stays a literal. Colours
that arrive as data (page accents, event and region colours) go
A color that must stay the same in both modes (white text on
a dark band, a platform's own color) stays a literal. Colors
that arrive as data (page accents, event and region colors) go
through withAlpha() and accentText() in src/lib/color.ts. */
--color-ink: #073d4a; /* headings */
--color-body: #26454c; /* body text */
@ -47,7 +47,7 @@
--shadow-2xl: 0 25px 50px -12px rgb(4 38 46 / 0.3);
}
/* How much of an accent colour its text keeps (src/lib/color.ts,
/* How much of an accent color its text keeps (src/lib/color.ts,
accentText): all of it on light, half (the rest white) on dark. */
:root {
--accent-text-mix: 100%;

View file

@ -83,7 +83,7 @@ export const events = {
label: "Type",
options: ["retreat", "class", "workshop", "meeting", "other"],
},
{ key: "status", label: "Status", options: ["upcoming", "past", "cancelled"] },
{ key: "status", label: "Status", options: ["upcoming", "past", ["cancelled", "canceled"]] },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
@ -128,7 +128,7 @@ export const events = {
path: "status",
label: "Status",
widget: "select",
options: ["upcoming", "past", "cancelled"],
options: ["upcoming", "past", ["cancelled", "canceled"]],
blankLabel: "Default: derive from end date",
},
{
@ -146,7 +146,7 @@ export const events = {
fields: [
{ path: "event_logo", label: "Event logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true },
{ path: "org_logo", label: "Org logo override", widget: "image", folder: "logos", resolve: mediaUrl, full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "color", label: "Color", widget: "color" },
{
path: "card_image",
label: "Card background",

View file

@ -55,7 +55,7 @@ export const frontPage = {
label: "Background",
widget: "select",
options: [
["brand", "Brand: animated colour and the dove"],
["brand", "Brand: animated color and the dove"],
["photos", "Photos: cycles through the photos below"],
],
blankLabel: "Default: brand",

View file

@ -41,7 +41,7 @@ export const organizations = {
{ path: "name", label: "Name", required: true },
{ path: "short_name", label: "Short name" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "color", label: "Color", widget: "color" },
{ path: "logo", label: "Logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true },
],
},

View file

@ -228,10 +228,10 @@ export const linksChild = {
organization or a person, never both, which the CHECK on
event_hosts enforces and this form can only ask nicely about.
The first row supplies the logo and colour when the event sets
The first row supplies the logo and color when the event sets
neither, so the order here is data rather than a display choice.
A person supplies neither: there is no colour on a person and a
headshot is not a logo, so a person-hosted event with no colour
A person supplies neither: there is no color on a person and a
headshot is not a logo, so a person-hosted event with no color
of its own falls through to the section default. */
export const hostsChild = {
key: "event_hosts",

View file

@ -12,7 +12,7 @@ const SITE_PAGES: [string, string][] = Object.entries(siteConfiguration.pages).m
/* The palette an admin can change, in the order the dropdown lists
it: token and label. The defaults come from the server's list
(server/src/themeDefaults.js), which the build checks against
src/index.css, so there's one copy of each colour to change. */
src/index.css, so there's one copy of each color to change. */
const THEME_LABELS: [string, string][] = [
["ink", "Headings"],
["body", "Body text"],
@ -162,15 +162,15 @@ export const siteSettings = {
children: [
{
key: "colors",
label: "Colours",
note: "Change any of the site's colours, for light mode, dark mode or both; a blank keeps the default. Saving refuses a palette that would make text hard to read (under 4.5:1). Changes show on the next page load.",
addLabel: "Change a colour",
title: (row) => THEME_COLORS.find(([token]) => token === row.token)?.[1] ?? "New colour",
label: "Colors",
note: "Change any of the site's colors, for light mode, dark mode or both; a blank keeps the default. Saving refuses a palette that would make text hard to read (under 4.5:1). Changes show on the next page load.",
addLabel: "Change a color",
title: (row) => THEME_COLORS.find(([token]) => token === row.token)?.[1] ?? "New color",
blank: { token: "", light: "", dark: "" },
fields: [
{
path: "token",
label: "Colour",
label: "Color",
widget: "select",
options: THEME_COLORS.map(([token, label]) => [token, label]),
required: true,

View file

@ -46,7 +46,7 @@ export const teams = {
},
{ path: "name", label: "Name", required: true, help: "Board, Leadership Team" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "color", label: "Color", widget: "color" },
{ path: "logo", label: "Logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true },
],
},

View file

@ -1,14 +1,14 @@
/* ═══════════════════════════════════════════════════════════════
COLOR
Two helpers for colours that arrive as data (a page's accent, an
event's or region's colour), so they work with the theme tokens
Two helpers for colors that arrive as data (a page's accent, an
event's or region's color), so they work with the theme tokens
in index.css as well as with hex.
withAlpha(color, 20) is that colour at 20% opacity, for tints and
withAlpha(color, 20) is that color at 20% opacity, for tints and
borders. It replaces `${color}33`, which only works on hex.
accentText(color) is that colour as text: itself in light mode,
accentText(color) is that color as text: itself in light mode,
mixed halfway to white in dark mode (--accent-text-mix), so an
accent picked for a white page still reads on a dark one.
═══════════════════════════════════════════════════════════════ */
@ -19,8 +19,8 @@ export const withAlpha = (color: string, percent: number): string =>
export const accentText = (color: string): string =>
`color-mix(in srgb, ${color} var(--accent-text-mix), #ffffff)`
/* Text for on top of a colour that arrives as data: white or deep
ink, whichever has more contrast (WCAG), so a pale colour an admin
/* Text for on top of a color that arrives as data: white or deep
ink, whichever has more contrast (WCAG), so a pale color an admin
picks still gets readable text. Anything that isn't #rrggbb (a
CSS variable, say) gets white, which suits the site's own dark
accents. */
@ -40,8 +40,8 @@ export function readableOn(color: string): string {
/* ── The site's accents ──────────────────────────────────────────
BRAND is the teal every page uses as its accent; it's the button
token, so the admin's palette (Site settings → Colours) reaches it.
ACCENTS are the other section colours a page may give a band, all
token, so the admin's palette (Site settings → Colors) reaches it.
ACCENTS are the other section colors a page may give a band, all
from the same family and all readable as text on white and on the
tints (5:1 or better). Use these rather than a new hex. */
export const BRAND = 'var(--color-action)'

View file

@ -4,7 +4,7 @@
Turns the link an admin pastes into the URL an <iframe> can
load. People paste the page they're looking at (a YouTube watch
or live link, a Facebook video, a Vimeo page), not the embed
form, so those are recognised and rewritten. Anything else that
form, so those are recognized and rewritten. Anything else that
is https is assumed to already be an embed URL and passed
through; anything that isn't https is refused, so the hero never
frames a plain-http or javascript: URL.

View file

@ -7,7 +7,7 @@
What this is not: event_scopes. A scope owns presentation:
Retreats.tsx keys its title, accent and background on the id, so
an unrecognised scope_id makes an event vanish with no error,
an unrecognized scope_id makes an event vanish with no error,
which is why that one is a real table with a real foreign key. A
type carries no presentation of its own and an unknown value
renders as its own name, so a CHECK is enough.

View file

@ -18,7 +18,7 @@
── On missing ids ──
Every builder takes an id the caller believed it had. When it
doesn't, the old behaviour was to interpolate the string
doesn't, the old behavior was to interpolate the string
"undefined" into a path, render a link to it, mount a page and
fetch /api/organizations/undefined, four steps between the
mistake and any sign of it, none of which name the component

View file

@ -9,7 +9,7 @@
const { organizations } = useOrganizations("partner");
const { organizations } = useOrganizations(); // all
Every organization has the same card surface, name, colour,
Every organization has the same card surface, name, color,
logo, description, links. What differs by kind sits under
`details`, so a list component can render the common parts
without knowing what it's holding:

View file

@ -27,7 +27,7 @@ export function qrMatrix(text: string, level: QrLevel): QrMatrix {
return { size: modules.size, dark: (row, col) => modules.get(row, col) === 1 }
}
/* The dark modules as one SVG path, a run of horizontal neighbours
/* The dark modules as one SVG path, a run of horizontal neighbors
per subpath, offset by the quiet zone. One element instead of a
rect per module keeps the markup (and the SVG download) small. */
export function qrPath(matrix: QrMatrix, margin: number): string {

View file

@ -6,7 +6,7 @@
const { data, error, loading } = useResource("/events");
Note the `ignore` flag rather than an AbortController: the
request is shared and cached, so cancelling it would throw away
request is shared and cached, so canceling it would throw away
work another component may still want. We just stop writing
state after unmount.
═══════════════════════════════════════════════════════════════ */

View file

@ -170,7 +170,7 @@ function RecipientRow({ recipient, accent }: { recipient: Recipient; accent: str
/* awarded_on may be a partial date, so this takes the leading year
rather than parsing. A full date would be false precision on a
row backfilled from a programme booklet. */
row backfilled from a program booklet. */
function year(date?: string | null): string | null {
if (!date) return null
const match = /^(\d{4})/.exec(date)

View file

@ -64,7 +64,7 @@ const ROLE_LABEL: Record<string, string> = {
const STATUS_LABEL: Record<string, string> = {
upcoming: 'Upcoming',
past: 'Past',
cancelled: 'Cancelled',
cancelled: 'Canceled',
}
export default function EventDetail() {
@ -131,7 +131,7 @@ export default function EventDetail() {
},
]
// A cancelled series has no next meeting, whatever its dates say.
// A canceled series has no next meeting, whatever its dates say.
const upcoming =
event.status === 'cancelled'
? []

View file

@ -20,7 +20,7 @@ const SECTIONS = [
id: 'make',
title: 'Make a QR code',
blurb:
'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the centre and the colours; a warning shows if the code might not scan.',
'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the center and the colors; a warning shows if the code might not scan.',
accent: BRAND,
background: 'var(--color-tint)',
content: (

View file

@ -159,7 +159,7 @@ function RequestFiles({ row, canWrite, canRemove }) {
);
}
/* A content request's details (049), labelled from requestTypes.ts;
/* A content request's details (049), labeled from requestTypes.ts;
keys it no longer knows are shown as they are. */
function RequestDetails({ row }) {
const entries = Object.entries(row.details ?? {});

View file

@ -181,7 +181,7 @@ export default function AdminLayout() {
</div>
{/* Subnav. Only drawn where there is something to draw, so
Events and People don't get an empty grey strip. */}
Events and People don't get an empty gray strip. */}
{subnav.length > 0 && (
<div className="border-t border-brand/10 bg-tint-soft">
<div className="mx-auto flex max-w-5xl flex-wrap gap-6 px-6 py-2.5 text-sm">

View file

@ -22,7 +22,7 @@ import { ApiError, get } from "../../lib/api.ts";
/* What a ?error= from the Google callback means, in the words the
person at the login page needs. */
const GOOGLE_ERRORS: Record<string, string> = {
cancelled: "Google sign-in was cancelled.",
canceled: "Google sign-in was canceled.",
expired: "That sign-in took too long or was already used. Try again.",
no_account:
"There's no admin account for that Google account. Ask a superadmin to add your email.",

View file

@ -131,7 +131,7 @@ export default function EntityEdit() {
return `${slugify(parts.join(" "))}-`;
};
// What to show greyed out before then: org_id becomes "org-".
// What to show grayed out before then: org_id becomes "org-".
const prefixHint = qualifierPaths.length
? `${qualifierPaths.map((path) => path.replace(/_id$/, "")).join("-")}-`
: "";

View file

@ -151,7 +151,7 @@ export const TOOLS_NAV = {
{
to: "/qr",
label: "QR code generator",
blurb: "Codes for flyers, slides and signs: any page or link, in your choice of colours.",
blurb: "Codes for flyers, slides and signs: any page or link, in your choice of colors.",
},
],
};

View file

@ -576,7 +576,7 @@ function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accen
function Bar({ seg, accent }: { seg: Segment; accent: string }) {
const color = seg.event.color || accent
const cancelled = seg.event.status === 'cancelled'
const canceled = seg.event.status === 'cancelled'
return (
<Link
@ -585,7 +585,7 @@ function Bar({ seg, accent }: { seg: Segment; accent: string }) {
className={`pointer-events-auto flex items-center gap-1 truncate px-2 text-xs font-semibold text-white transition-[filter] hover:brightness-110 ${
seg.continuesBefore ? 'ml-0 rounded-l-none' : 'ml-1 rounded-l-md'
} ${seg.continuesAfter ? 'mr-0 rounded-r-none' : 'mr-1 rounded-r-md'} ${
cancelled ? 'line-through opacity-60' : ''
canceled ? 'line-through opacity-60' : ''
}`}
style={{
gridColumn: `${seg.col + 1} / span ${seg.span}`,
@ -711,7 +711,7 @@ function EventLine({ item, accent }: { item: Occurrence; accent: string }) {
const { event } = item
const color = event.color || accent
const where = event.location_label || (event.is_online ? 'Online' : null)
const cancelled = event.status === 'cancelled'
const canceled = event.status === 'cancelled'
return (
<Link
@ -720,9 +720,9 @@ function EventLine({ item, accent }: { item: Occurrence; accent: string }) {
>
<span className="mt-1.5 h-3 w-3 shrink-0 rounded-full" style={{ background: color }} aria-hidden="true" />
<span className="min-w-0">
<span className={`block font-semibold group-hover:underline ${cancelled ? 'line-through' : ''}`}>
<span className={`block font-semibold group-hover:underline ${canceled ? 'line-through' : ''}`}>
{event.title}
{cancelled && <span className="ml-2 text-xs font-bold uppercase text-danger no-underline">Cancelled</span>}
{canceled && <span className="ml-2 text-xs font-bold uppercase text-danger no-underline">Canceled</span>}
</span>
<span className="block text-sm" style={{ color: BODY }}>
{[

View file

@ -36,7 +36,7 @@ import { accentText, withAlpha, readableOn, BRAND } from '../../lib/color.ts'
fires only for an event with no host at all. */
const DEFAULT_ORG_LOGO = null;
const INK = "var(--color-ink)"; // button text: the card colour is only a border
const INK = "var(--color-ink)"; // button text: the card color is only a border
const CARD_BG = "var(--color-surface)"; // sits under every card, photo or not
/* Laid over a card's background image so black text reads on any
@ -186,7 +186,7 @@ export function Card({
filter: past ? "saturate(0.75)" : "none",
pointerEvents: interactive ? "auto" : "none",
}}
// A card shown but not in play (a carousel neighbour, a collapsed
// A card shown but not in play (a carousel neighbor, a collapsed
// past event) keeps its links out of the tab order too.
inert={!interactive}
>
@ -277,7 +277,7 @@ export function Card({
compact ? "gap-2" : "gap-3"
} ${links.length === 0 ? "mt-4" : ""}`}
>
{/* Button text takes the card's colour (the event's own,
{/* Button text takes the card's color (the event's own,
or the band's default, teal unless the page sets one),
the same as the border, rather than the card's black. */}
{links.map(item => (
@ -464,7 +464,7 @@ export default function EventListCards({
);
/* Open on the first upcoming event. The list is empty on the
first render, so this can't be a useState initialiser, it has
first render, so this can't be a useState initializer, it has
to wait for the data and then run once. Clearing the guard when
the list empties means a refetch re-seeds. */
const seeded = useRef(false);

View file

@ -17,7 +17,7 @@ import { scrollBehavior } from "../../lib/motion.ts";
Filtered to groups, and unlike the other sections that isn't
a prop. A map only makes sense for organizations that sit
somewhere, and it reads regions off the same data to colour the
somewhere, and it reads regions off the same data to color the
tiles, so "plot partners instead" isn't a filter change, it's a
different component. Named for the view rather than the filter
so that stays visible.
@ -49,7 +49,7 @@ const INK = "var(--color-body)";
const FALLBACK_COLOR = "#4a6b72";
/* organizations.color is nullable; an SVG fill left undefined paints
black, so an uncoloured region takes the same fallback as a card. */
black, so an uncolored region takes the same fallback as a card. */
const colorOf = (item) => item.color || FALLBACK_COLOR;
const US_TITLE = "US Unity Regions";

View file

@ -19,7 +19,7 @@ import { accentText } from '../../lib/color.ts'
A stack of organizations, each collapsed to a line and
expandable for the rest. Every row carries two ways out: an
arrow through to that organization's page on this site, and a
labelled button out to its own site when it has one.
labeled button out to its own site when it has one.
Nothing here is region-specific. It asks for a kind and renders
what comes back, so the same section lists partners or groups

View file

@ -8,10 +8,10 @@
Which the page or record itself
Section for a main page with a subnav, optionally one of
its #sections
Centre nothing, the NGU dove, or any SVG in
Center nothing, the NGU dove, or any SVG in
src/assets/qr (drop a file there and it's offered;
it's embedded in the code, so downloads carry it)
Colours the code, its background, and the dove. A warning
Colors the code, its background, and the dove. A warning
appears when the pair is unlikely to scan: too
little contrast, or a light code on a dark ground
@ -27,13 +27,13 @@
Codes point at SITE_ORIGIN, never at wherever this page is open,
so one made on localhost still works on a poster.
Downloads are the on-screen <svg> itself: serialised for the SVG,
Downloads are the on-screen <svg> itself: serialized for the SVG,
drawn onto a canvas for the PNG. Neither needs a server.
═══════════════════════════════════════════════════════════════ */
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import QrCode, { QR_DOVE, QR_INK, QR_PAPER, type QrCentre } from '../../components/QrCode.tsx'
import QrCode, { QR_DOVE, QR_INK, QR_PAPER, type QrCenter } from '../../components/QrCode.tsx'
import { NAV_ACTIONS, PAGE_LINKS, PAGE_SECTIONS } from '../../navConfig.ts'
import { awardHref, blogHref, eventHref, orgHref, personHref, teamHref } from '../../lib/hrefs.ts'
import { siteUrl } from '../../lib/site.ts'
@ -59,31 +59,31 @@ const KINDS: Array<[Kind, string]> = [
['custom', 'A link I type'],
]
/* The centres on offer: the dove, then every SVG in src/assets/qr,
/* The centers on offer: the dove, then every SVG in src/assets/qr,
named after its file ("ngu-circle.svg" → "Ngu circle"). Read as
text and turned into data: URLs so they sit inside the code's own
SVG. */
const CENTRE_FILES = import.meta.glob<string>('../../assets/qr/*.svg', {
const CENTER_FILES = import.meta.glob<string>('../../assets/qr/*.svg', {
eager: true,
query: '?raw',
import: 'default',
})
type CentreOption = { id: string; label: string; centre: (dove: string) => QrCentre }
type CenterOption = { id: string; label: string; center: (dove: string) => QrCenter }
const toDataUrl = (svg: string) =>
`data:image/svg+xml;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(svg)))}`
const CENTRES: CentreOption[] = [
{ id: 'none', label: 'Nothing', centre: () => null },
{ id: 'dove', label: 'NGU dove', centre: (color) => ({ kind: 'dove', color }) },
...Object.entries(CENTRE_FILES)
const CENTERS: CenterOption[] = [
{ id: 'none', label: 'Nothing', center: () => null },
{ id: 'dove', label: 'NGU dove', center: (color) => ({ kind: 'dove', color }) },
...Object.entries(CENTER_FILES)
.sort(([a], [b]) => a.localeCompare(b))
.map(([path, svg]) => {
const name = path.split('/').pop()!.replace(/\.svg$/i, '')
const label = name.replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase())
const src = toDataUrl(svg)
return { id: `file:${name}`, label, centre: () => ({ kind: 'image', src }) as QrCentre }
return { id: `file:${name}`, label, center: () => ({ kind: 'image', src }) as QrCenter }
}),
]
@ -258,7 +258,7 @@ export default function QrCodeMaker() {
const [path, setPath] = useState('/')
const [section, setSection] = useState('')
const [custom, setCustom] = useState('')
const [centreId, setCentreId] = useState('dove')
const [centerId, setCenterId] = useState('dove')
const [ink, setInk] = useState(QR_INK)
const [paper, setPaper] = useState(QR_PAPER)
const [doveColor, setDoveColor] = useState(QR_DOVE)
@ -283,8 +283,8 @@ export default function QrCodeMaker() {
const target = kind === 'custom' ? typed : selected ? `${selected.path}${section}` : null
const url = kind === 'custom' ? typed : target ? siteUrl(target) : null
const centreOption = CENTRES.find((c) => c.id === centreId) ?? CENTRES[0]
const centre = centreOption.centre(doveColor)
const centerOption = CENTERS.find((c) => c.id === centerId) ?? CENTERS[0]
const center = centerOption.center(doveColor)
const warning = scanWarning(ink, paper)
useEffect(() => setCopied(false), [url])
@ -381,8 +381,8 @@ export default function QrCodeMaker() {
</Select>
)}
<Select id="qr-centre" label="In the centre" value={centreId} onChange={setCentreId}>
{CENTRES.map((c) => (
<Select id="qr-center" label="In the center" value={centerId} onChange={setCenterId}>
{CENTERS.map((c) => (
<option key={c.id} value={c.id}>
{c.label}
</option>
@ -390,12 +390,12 @@ export default function QrCodeMaker() {
</Select>
<fieldset>
<legend className="text-sm font-medium text-body">Colours</legend>
<legend className="text-sm font-medium text-body">Colors</legend>
<div className="mt-2 flex flex-wrap items-end gap-5">
<ColourInput id="qr-ink" label="Code" value={ink} onChange={setInk} />
<ColourInput id="qr-paper" label="Background" value={paper} onChange={setPaper} />
{centreOption.id === 'dove' && (
<ColourInput id="qr-dove" label="Dove" value={doveColor} onChange={setDoveColor} />
<ColorInput id="qr-ink" label="Code" value={ink} onChange={setInk} />
<ColorInput id="qr-paper" label="Background" value={paper} onChange={setPaper} />
{centerOption.id === 'dove' && (
<ColorInput id="qr-dove" label="Dove" value={doveColor} onChange={setDoveColor} />
)}
{(ink !== QR_INK || paper !== QR_PAPER || doveColor !== QR_DOVE) && (
<button
@ -408,7 +408,7 @@ export default function QrCodeMaker() {
className="pb-2 text-sm underline"
style={{ color: accentText(BRAND) }}
>
Reset colours
Reset colors
</button>
)}
</div>
@ -446,7 +446,7 @@ export default function QrCodeMaker() {
<QrCode
ref={svgRef}
value={url}
centre={centre}
center={center}
ink={ink}
paper={paper}
label={`QR code for ${url}`}
@ -490,8 +490,8 @@ const inputClass =
'w-full rounded-xl border border-muted/50 bg-surface px-4 py-3 text-body ' +
'outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25'
/* A colour well with its hex beside it, both editable. */
function ColourInput({
/* A color well with its hex beside it, both editable. */
function ColorInput({
id,
label,
value,
@ -519,7 +519,7 @@ function ColourInput({
/>
<input
type="text"
aria-label={`${label} colour, as hex`}
aria-label={`${label} color, as hex`}
value={text}
onChange={(e) => {
setText(e.target.value)

View file

@ -6,8 +6,8 @@
Backdrop, what fills the background:
brand drifting colour and slow concentric rings (many
circles, one centre) with the dove at that centre
brand drifting color and slow concentric rings (many
circles, one center) with the dove at that center
photos the hero photos, crossfading with a slow zoom, a
progress bar per photo and a pause button (anything
that moves on its own for more than five seconds
@ -222,7 +222,7 @@ function BrandBackdrop() {
</radialGradient>
</defs>
{/* The rings are faint; the dove at their centre is not, so
{/* The rings are faint; the dove at their center is not, so
the opacity sits on the rings rather than the whole SVG. */}
<g opacity="0.16">
<g className="hp-rings" fill="none" stroke="#ffffff">
@ -239,7 +239,7 @@ function BrandBackdrop() {
</g>
{/* Outside the rotating groups, so it stays upright while the
rings turn around it. 64 × 42.7 at the centre fits inside
rings turn around it. 64 × 42.7 at the center fits inside
the innermost ring (r 40) with room to float. */}
<circle cx="200" cy="200" r="46" fill="url(#hp-dove-glow)" />
<g className="hp-dove" style={{ color: '#ffffff' }} opacity="0.9">
@ -451,7 +451,7 @@ function VideoFrame({
/* ── Featured event ──────────────────────────────────────────── */
/* The event's own card for the hero: its background photo (or its
colour), then what, when and where, then its buttons and a way
color), then what, when and where, then its buttons and a way
to its page. The first action link is the filled button, since
it's usually Register. */
function EventPanel({ event }: { event: HeroEvent }) {

View file

@ -29,7 +29,7 @@ type PathfinderProps = {
paths: FrontPagePath[]
}
/* One accent per position, cycling. Paths are data; colour is
/* One accent per position, cycling. Paths are data; color is
presentation, so it's assigned here rather than stored. */
/* A path's icon: a key from src/data/pathIcons.ts, drawn from
Phosphor. A path saved before the list existed may hold an emoji;

View file

@ -33,7 +33,7 @@
to { transform: translate(-10%, -15%) scale(1.2); }
}
/* Concentric rings: many circles, one centre. */
/* Concentric rings: many circles, one center. */
.hp-rings {
animation: hp-spin 90s linear infinite;
transform-origin: 50% 50%;
@ -44,7 +44,7 @@
to { transform: rotate(360deg); }
}
/* The dove at the rings' centre bobs gently rather than turning. */
/* The dove at the rings' center bobs gently rather than turning. */
.hp-dove {
animation: hp-bob 6s ease-in-out infinite;
transform-box: fill-box;