Compare commits

...

3 commits

Author SHA1 Message Date
Zaldimmar
2df908f7c4 Backdrop: four parallax layers, laid out per page, tones per top-level section
Sixteen circles in four layers, big and slow at the back to small
and quicker at the front, each rising by its share of the page's
scroll (none at the page's own speed); how far is measured from the
page's height, so the back layer visibly moves on a long page. Each
path gets its own seeded arrangement. The tone moves on only when a
new top-level section arrives, and eases over 2.4s. Dark shades are
chosen so text passes 4.5:1 however many circles overlap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:28:55 -05:00
Zaldimmar
e5c14dffa3 Timeline on a brown branch with leaf-colored decade tags; solid featured entries; admin home in two alternating colors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:26:38 -05:00
Zaldimmar
a397f3eac0 Overhaul fixes: raised cards, balanced people rows, solid map, small button radius
- Cards sit on a raised surface (white, or a touch of tint in dark
  mode) with a shadow: featured cards, the connect block, people
  tiles. tint-soft is a faint teal again, not green.
- Buttons: a small plain radius everywhere; no superellipse.
- Video stills use YouTube's 16:9 frame (the 4:3 one cropped as a
  fallback), have small rounded corners, and show a round, centered
  play button on hover or focus (always on touch screens).
- People tiles: rows balanced between 2 and 10 across, never ending
  on a lone tile where it can be helped.
- Map tiles and region tags are solid, dimmed by color, not opacity.
- Admin: white (surface) background, header and footer as wide as
  the content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:24:36 -05:00
19 changed files with 400 additions and 201 deletions

View file

@ -72,7 +72,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
- **Colors are tokens, not hex.** Admins can override any token (Panel → Site settings → Colors). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. Use the utilities from `src/index.css` (`text-ink`, `text-body`, `text-muted`, `text-link`, `bg-surface`, `bg-tint`, `bg-action`, `border-brand/20`...) so dark mode works; a literal only for something that must look the same in both modes (white on a dark band, a platform's color). Data colors (accents, event and region colors) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`. - **Colors are tokens, not hex.** Admins can override any token (Panel → Site settings → Colors). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. Use the utilities from `src/index.css` (`text-ink`, `text-body`, `text-muted`, `text-link`, `bg-surface`, `bg-tint`, `bg-action`, `border-brand/20`...) so dark mode works; a literal only for something that must look the same in both modes (white on a dark band, a platform's color). Data colors (accents, event and region colors) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`.
- **Icons are Phosphor** (`@phosphor-icons/react`), weight `bold` (or `fill` for play/star). No hand-drawn `<svg>` icons and no Unicode glyphs as icons (× › ▶ →). Brand marks are the exception: `DoveMark`, `PlatformIcon`, the Google logo, the group map. - **Icons are Phosphor** (`@phosphor-icons/react`), weight `bold` (or `fill` for play/star). No hand-drawn `<svg>` icons and no Unicode glyphs as icons (× › ▶ →). Brand marks are the exception: `DoveMark`, `PlatformIcon`, the Google logo, the group map.
- **Accents come from `src/lib/color.ts`:** `BRAND` (the teal, via the button token so the admin palette reaches it) and `ACCENTS` (deep, green, olive), all from `PALETTE` (the site's 16-color grid). Not a new hex in a page. - **Accents come from `src/lib/color.ts`:** `BRAND` (the teal, via the button token so the admin palette reaches it) and `ACCENTS` (deep, green, olive), all from `PALETTE` (the site's 16-color grid). Not a new hex in a page.
- **No rounded corners.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a superellipse via `corner-shape`; `var(--btn-radius)` in plain CSS), and things round by nature (dots, radio marks). A note in place of content (empty section, "coming soon") uses the `notice` utility, not a dashed border. Nothing glows: no blur blobs, no glow shadows. - **Corners: square.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a small `var(--btn-radius)` corner, also for plain CSS), video players (small rounded) and things round by nature (dots, radio marks, the play button). A note in place of content (empty section, "coming soon") uses the `notice` utility (corner brackets), not a dashed border. Cards sit on `bg-raised` with a shadow so they stand off the page. Nothing glows: no blur blobs, no glow shadows.
- **Sections paint no background.** `PageBackdrop` (in Layout) draws the page's palette circles behind every public page; a band that needs its own color (the hero, the stats band, the footer) is a deliberate exception. - **Sections paint no background.** `PageBackdrop` (in Layout) draws the page's palette circles behind every public page; a band that needs its own color (the hero, the stats band, the footer) is a deliberate exception.
- **No em-dashes** (U+2014) anywhere: UI text, help text, comments, docs, commit messages. Use a colon, comma or parentheses. An empty table cell shows `-`. - **No em-dashes** (U+2014) anywhere: UI text, help text, comments, docs, commit messages. Use a colon, comma or parentheses. An empty table cell shows `-`.
- **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`. - **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`.

View file

@ -277,7 +277,7 @@ The numbers band's "Number Source" dropdown works the same way:
| The site's colors, light and dark | the database over `src/index.css` | Admin → Panel → Site settings → Colors (superadmins): pick a color, set its light and/or dark value; saving refuses anything that makes text hard to read. The defaults are `THEME_DEFAULTS` in `server/src/themeDefaults.js` (the admin and the contrast check read it) and the same values as CSS in `src/index.css`; the build stops if the two differ. The admin's labels for them are `THEME_LABELS` in `src/lib/adminSchema/siteSettings.ts`. Change a token's value in both modes and every use follows. Use the token utilities (`text-muted`, `bg-surface`, `border-brand/20`) or `var(--color-…)`, not hex. A color that arrives as data (a page accent, an event's or region's color) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. | | The site's colors, light and dark | the database over `src/index.css` | Admin → Panel → Site settings → Colors (superadmins): pick a color, set its light and/or dark value; saving refuses anything that makes text hard to read. The defaults are `THEME_DEFAULTS` in `server/src/themeDefaults.js` (the admin and the contrast check read it) and the same values as CSS in `src/index.css`; the build stops if the two differ. The admin's labels for them are `THEME_LABELS` in `src/lib/adminSchema/siteSettings.ts`. Change a token's value in both modes and every use follows. Use the token utilities (`text-muted`, `bg-surface`, `border-brand/20`) or `var(--color-…)`, not hex. A color that arrives as data (a page accent, an event's or region's color) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. |
| The icons a Front page "Find your way in" path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. | | The icons a Front page "Find your way in" path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. |
| A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. | | A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. |
| The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's circles and tones are in `src/components/PageBackdrop.css`; the admin home's group colors are `GROUPS` in `src/pages/admin/AdminHome.tsx`. | | The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. |
| Timeline leaf colors (green now, autumn going back) | `leafColor` in `src/lib/color.ts` | The green, gold and autumn stops, and `LEAF_TURNED_BY` (2000), the year before which every leaf is fully turned. | | Timeline leaf colors (green now, autumn going back) | `leafColor` in `src/lib/color.ts` | The green, gold and autumn stops, and `LEAF_TURNED_BY` (2000), the year before which every leaf is fully turned. |
| Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. | | Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. |
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. | | Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |

View file

@ -23,7 +23,7 @@ export const THEME_DEFAULTS = {
"action-hover": ["#001011", "#004552"], "action-hover": ["#001011", "#004552"],
surface: ["#fcfffd", "#001011"], surface: ["#fcfffd", "#001011"],
tint: ["#c2f6ff", "#004552"], tint: ["#c2f6ff", "#004552"],
"tint-soft": ["#dfebd6", "#27371b"], "tint-soft": ["#e8fcfe", "#00252b"],
danger: ["#b3261e", "#ff8a80"], danger: ["#b3261e", "#ff8a80"],
"danger-tint": ["#fdf3f2", "#3b1714"], "danger-tint": ["#fdf3f2", "#3b1714"],
}; };

View file

@ -112,7 +112,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
return ( return (
<li <li
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${ className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-raised transition-colors hover:bg-tint-soft ${
large ? 'lg:col-span-2 lg:row-span-2' : '' large ? 'lg:col-span-2 lg:row-span-2' : ''
}`} }`}
> >
@ -134,7 +134,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) { export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
const leadLarge = cards.length >= 3 const leadLarge = cards.length >= 3
return ( return (
<div className="overflow-hidden"> <div className="overflow-hidden shadow-md">
<ul className="-mr-[4px] -mb-[4px] grid sm:grid-cols-2 lg:grid-cols-3"> <ul className="-mr-[4px] -mb-[4px] grid sm:grid-cols-2 lg:grid-cols-3">
{cards.map((card, index) => ( {cards.map((card, index) => (
<Card <Card

View file

@ -163,7 +163,7 @@ export default function Layout() {
// container, and then nothing inside it can be position: sticky // container, and then nothing inside it can be position: sticky
// (a blog post's contents column scrolled away with the page). // (a blog post's contents column scrolled away with the page).
<div <div
className="relative min-h-screen overflow-x-clip" className="min-h-screen overflow-x-clip"
style={{ "--header-h": `${headerHeight}px` } as React.CSSProperties} style={{ "--header-h": `${headerHeight}px` } as React.CSSProperties}
> >
<a <a

View file

@ -1,93 +1,84 @@
/* ═══════════════════════════════════════════════════════════════ /* ═══════════════════════════════════════════════════════════════
PAGE BACKDROP: the circles and their tones (PageBackdrop.tsx) PAGE BACKDROP: the circles, their layers and shades
(PageBackdrop.tsx places them)
Flat fills only: no blur, no gradient, no glow. Light mode uses Flat fills only: no blur, no gradient, no glow. Light mode uses
the palette's four palest shades, dark mode its dark shades at the palette's four palest shades at 60%, dark mode its dark
45% opacity over the ink background. Every text token reads at shades (two deepened a step) at 30% over the ink background.
4.5:1 or better on any of them, even where three overlap (the Every text token reads at 4.5:1 or better on each shade even at
lowest, 4.8:1, is the danger red in dark mode). full strength, so however many circles overlap, text stays
readable (the lowest, 4.66:1, is the danger red on #004552).
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
/* Spans the whole page (Layout's root is its containing block), so
the section circles sit at points down the document; the window
layer inside it is fixed. */
.page-backdrop { .page-backdrop {
position: absolute;
inset: 0;
z-index: -1;
overflow: hidden; /* the section circles, never the fixed layer */
pointer-events: none;
--pb-opacity: 0.7;
--pb-a: #c2f6ff;
--pb-b: #dfebd6;
--pb-c: #c2ffd6;
--pb-d: #c2fbff;
--pb-e: #dfebd6;
}
.page-backdrop__window {
position: fixed; position: fixed;
inset: 0; inset: 0;
z-index: -1;
overflow: hidden; overflow: hidden;
pointer-events: none;
--pb-opacity: 0.6;
--pb-0: #c2f6ff;
--pb-1: #dfebd6;
--pb-2: #c2ffd6;
--pb-3: #c2fbff;
} }
/* A circle's place: across by its left, down its layer's whole
travel (the window plus how far the layer rises), centered on
that point. */
.page-backdrop__circle { .page-backdrop__circle {
position: absolute; position: absolute;
width: var(--pb-size);
height: var(--pb-size);
top: calc(var(--pb-top) * (100vh + var(--pb-scroll, 0px) * var(--pb-speed)) - var(--pb-size) / 2);
border-radius: 50%; border-radius: 50%;
opacity: var(--pb-opacity); opacity: var(--pb-opacity);
transition: background-color 1.4s cubic-bezier(0.16, 1, 0.3, 1); transition: background-color 2.4s ease-in-out;
} }
/* Slow: fixed to the window. */ /* Each layer rises by its share of the page's scroll as the page
.page-backdrop__circle--a { width: 70vmax; height: 70vmax; left: -24vmax; top: -16vmax; background: var(--pb-a); --pb-drift: -22vh; } scrolls: the back slowest, none as fast as the page. */
.page-backdrop__circle--b { width: 50vmax; height: 50vmax; right: -18vmax; top: 34vh; background: var(--pb-b); --pb-drift: -40vh; }
/* Section: placed down the page, moving with it. */
.page-backdrop__circle--c { width: 42vmax; height: 42vmax; left: 34vw; top: 18%; background: var(--pb-c); }
.page-backdrop__circle--d { width: 32vmax; height: 32vmax; left: -8vmax; top: 48%; background: var(--pb-d); }
.page-backdrop__circle--e { width: 36vmax; height: 36vmax; right: -6vmax; top: 74%; background: var(--pb-e); }
/* The slow circles drift up across the whole scroll of the page. */
@supports (animation-timeline: scroll()) { @supports (animation-timeline: scroll()) {
.page-backdrop__circle--a, .page-backdrop__circle {
.page-backdrop__circle--b { animation: page-backdrop-rise linear both;
animation: page-backdrop-drift linear both;
animation-timeline: scroll(root block); animation-timeline: scroll(root block);
} }
} }
@keyframes page-backdrop-drift { @keyframes page-backdrop-rise {
to { to {
transform: translateY(var(--pb-drift)); transform: translateY(calc(var(--pb-scroll, 0px) * var(--pb-speed) * -1));
} }
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
.page-backdrop__circle--a, .page-backdrop__circle {
.page-backdrop__circle--b {
animation: none; animation: none;
} }
} }
/* Tones, one per section in turn: the same shades, swapped around. */ /* Dark mode: the dark shades. Two blocks as in index.css: the
.page-backdrop[data-tone="1"] { --pb-a: #dfebd6; --pb-b: #c2ffd6; --pb-c: #c2f6ff; --pb-d: #dfebd6; --pb-e: #c2fbff; } toggle's choice, or the system's when there is none. */
.page-backdrop[data-tone="2"] { --pb-a: #c2ffd6; --pb-b: #c2fbff; --pb-c: #dfebd6; --pb-d: #c2f6ff; --pb-e: #c2ffd6; } :root[data-theme="dark"] .page-backdrop {
.page-backdrop[data-tone="3"] { --pb-a: #c2fbff; --pb-b: #c2f6ff; --pb-c: #c2ffd6; --pb-d: #dfebd6; --pb-e: #c2f6ff; } --pb-opacity: 0.3;
--pb-0: #004552;
/* Dark mode: the dark shades, the same turns. Two blocks as in --pb-1: #27371b;
index.css: the toggle's choice, or the system's when there is none. */ --pb-2: #003f45; /* #004c52 deepened */
:root[data-theme="dark"] .page-backdrop { --pb-opacity: 0.45; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; } --pb-3: #00441a; /* #00521b deepened */
:root[data-theme="dark"] .page-backdrop[data-tone="1"] { --pb-a: #27371b; --pb-b: #004c52; --pb-c: #004552; --pb-d: #27371b; --pb-e: #00521b; } }
:root[data-theme="dark"] .page-backdrop[data-tone="2"] { --pb-a: #004c52; --pb-b: #00521b; --pb-c: #27371b; --pb-d: #004552; --pb-e: #004c52; }
:root[data-theme="dark"] .page-backdrop[data-tone="3"] { --pb-a: #00521b; --pb-b: #004552; --pb-c: #004c52; --pb-d: #27371b; --pb-e: #004552; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .page-backdrop { --pb-opacity: 0.45; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; } :root:not([data-theme="light"]) .page-backdrop {
:root:not([data-theme="light"]) .page-backdrop[data-tone="1"] { --pb-a: #27371b; --pb-b: #004c52; --pb-c: #004552; --pb-d: #27371b; --pb-e: #00521b; } --pb-opacity: 0.3;
:root:not([data-theme="light"]) .page-backdrop[data-tone="2"] { --pb-a: #004c52; --pb-b: #00521b; --pb-c: #27371b; --pb-d: #004552; --pb-e: #004c52; } --pb-0: #004552;
:root:not([data-theme="light"]) .page-backdrop[data-tone="3"] { --pb-a: #00521b; --pb-b: #004552; --pb-c: #004c52; --pb-d: #27371b; --pb-e: #004552; } --pb-1: #27371b;
--pb-2: #003f45; /* #004c52 deepened */
--pb-3: #00441a; /* #00521b deepened */
}
} }
@media print { @media print {
.page-backdrop { display: none; } .page-backdrop {
display: none;
}
} }

View file

@ -1,69 +1,127 @@
/* ═══════════════════════════════════════════════════════════════ /* ═══════════════════════════════════════════════════════════════
PAGE BACKDROP PAGE BACKDROP
One background behind every public page: large flat circles in One background behind every public page: flat circles in the
the palette's light shades (its dark ones in dark mode), palette's light shades (its dark ones in dark mode), overlapping.
overlapping. Sections paint nothing of their own, so it runs Sections paint nothing of their own, so it runs behind all of
behind all of them; cards keep their solid surface. them; cards keep their own raised surface.
Two kinds of circle, for depth as the page scrolls: Depth: the circles sit in LAYERS, back to front, each rising at
slow fixed to the window, drifting up slower than the page its own fraction of the page's scroll: big and slow at the back,
(a CSS scroll-driven animation, PageBackdrop.css) small and quicker at the front, none as fast as the page itself.
section placed down the page itself, so they travel with the The rise is a CSS scroll-driven animation (PageBackdrop.css) over
sections they sit behind --pb-scroll, the page's scrollable height, which is measured here
Without scroll-driven animations, or under reduced motion, the whenever the page changes size (no scroll listener). Without
slow circles simply stay put. scroll-driven animations, or under reduced motion, they stay put.
As the visitor moves through a page the circles change tone: the Each page gets its own arrangement: sizes and places come from a
section crossing the middle of the window picks one of TONES (its generator seeded with the path, so a page looks the same every
place on the page, in turn), and the circles ease to that tone's visit and different from its neighbors.
colors. Watched with an IntersectionObserver, so nothing runs
while the page sits still. Under reduced motion the change is
instant (index.css stops every transition).
Every text color passes 4.5:1 on every shade used here, overlaps As the visitor reaches a new section (a top-level one, not one
included, in both modes: the light shades are the palette's nested inside another) the circles change tone: each moves to the
palest, and the dark ones sit at partial opacity. next shade in turn, easing slowly. Watched with an
IntersectionObserver; under reduced motion the change is instant
(index.css stops every transition).
Every text color passes 4.5:1 on every shade here, however many
circles overlap (see PageBackdrop.css for the opacities).
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
import { useEffect, useRef } from 'react' import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react'
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
import './PageBackdrop.css' import './PageBackdrop.css'
/** How many tones PageBackdrop.css defines (data-tone 0 to 3). */ /** How many shades PageBackdrop.css defines (--pb-0 to --pb-3). */
const TONES = 4 const SHADES = 4
const SLOW = ['a', 'b']
const SECTION = ['c', 'd', 'e'] /* Back to front: how many circles, how big (vmax), and how much of
the page's scroll the layer rises by. */
const LAYERS = [
{ count: 3, size: [46, 70], speed: 0.14 },
{ count: 4, size: [26, 42], speed: 0.28 },
{ count: 4, size: [16, 26], speed: 0.45 },
{ count: 5, size: [8, 15], speed: 0.65 },
]
type Circle = { layer: number; size: number; left: number; top: number; shade: number; speed: number }
/* A small seeded generator (mulberry32), so a path always draws the
same circles. */
function seeded(text: string) {
let seed = 0
for (const char of text) seed = (Math.imul(seed, 31) + char.charCodeAt(0)) | 0
return () => {
seed = (seed + 0x6d2b79f5) | 0
let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t
return ((t ^ (t >>> 14)) >>> 0) / 4294967296
}
}
function arrange(path: string): Circle[] {
const random = seeded(path)
return LAYERS.flatMap((layer, index) =>
Array.from({ length: layer.count }, (_, i) => ({
layer: index,
size: layer.size[0] + random() * (layer.size[1] - layer.size[0]),
// Spread across the width, and down the layer's full travel:
// one slice of it per circle, placed somewhere in its slice.
left: -15 + random() * 100,
top: (i + random()) / layer.count,
shade: Math.floor(random() * SHADES),
speed: layer.speed,
})),
)
}
export default function PageBackdrop() { export default function PageBackdrop() {
const ref = useRef<HTMLDivElement>(null) const ref = useRef<HTMLDivElement>(null)
const { pathname } = useLocation() const { pathname } = useLocation()
const [tone, setTone] = useState(0)
const circles = useMemo(() => arrange(pathname), [pathname])
// The page's scrollable height, for how far each layer travels.
useEffect(() => {
const backdrop = ref.current
if (!backdrop) return undefined
const measure = () => {
const scroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight)
backdrop.style.setProperty('--pb-scroll', `${scroll}px`)
}
measure()
const observer = new ResizeObserver(measure)
observer.observe(document.body)
return () => observer.disconnect()
}, [])
// A new top-level section reaching the window's middle moves the tone on.
useEffect(() => { useEffect(() => {
const main = document.getElementById('main') const main = document.getElementById('main')
const backdrop = ref.current if (!main) return undefined
if (!main || !backdrop) return undefined
backdrop.dataset.tone = '0' setTone(0)
let watched: Element[] = [] let watched: Element[] = []
// The band crossing the window's middle line sets the tone.
const observer = new IntersectionObserver( const observer = new IntersectionObserver(
(entries) => { (entries) => {
for (const entry of entries) { for (const entry of entries) {
if (!entry.isIntersecting) continue if (!entry.isIntersecting) continue
const index = watched.indexOf(entry.target) const index = watched.indexOf(entry.target)
if (index >= 0) backdrop.dataset.tone = String(index % TONES) if (index >= 0) setTone(index % SHADES)
} }
}, },
{ rootMargin: '-50% 0px -50% 0px', threshold: 0 }, { rootMargin: '-50% 0px -50% 0px', threshold: 0 },
) )
// Pages draw their sections as their data arrives, so the list // Pages draw their sections as their data arrives, so the list
// is gathered again whenever main's content changes. // is gathered again whenever main's content changes. Only the
// outermost: a timeline's decades are sections inside one.
const collect = () => { const collect = () => {
observer.disconnect() observer.disconnect()
watched = Array.from(main.querySelectorAll('section')) watched = Array.from(main.querySelectorAll('section')).filter(
(section) => !section.parentElement?.closest('section'),
)
watched.forEach((section) => observer.observe(section)) watched.forEach((section) => observer.observe(section))
} }
collect() collect()
@ -83,13 +141,20 @@ export default function PageBackdrop() {
return ( return (
<div ref={ref} className="page-backdrop" aria-hidden="true"> <div ref={ref} className="page-backdrop" aria-hidden="true">
<div className="page-backdrop__window"> {circles.map((circle, i) => (
{SLOW.map((name) => ( <span
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} /> key={i}
))} className={`page-backdrop__circle page-backdrop__circle--${circle.layer}`}
</div> style={
{SECTION.map((name) => ( {
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} /> '--pb-size': `${circle.size.toFixed(1)}vmax`,
left: `${circle.left.toFixed(1)}vw`,
'--pb-top': circle.top,
'--pb-speed': circle.speed,
background: `var(--pb-${(circle.shade + tone) % SHADES})`,
} as CSSProperties
}
/>
))} ))}
</div> </div>
) )

View file

@ -13,13 +13,14 @@
/* color */ /* color */
--pl-accent: var(--color-link); --pl-accent: var(--color-link);
--pl-frame-bg: var(--color-surface); --pl-frame-bg: var(--color-raised);
--pl-frame-edge: color-mix(in srgb, var(--color-brand) 45%, transparent); --pl-frame-edge: color-mix(in srgb, var(--color-brand) 45%, transparent);
--pl-photo-bg: color-mix(in srgb, var(--color-muted) 15%, var(--color-surface)); --pl-photo-bg: color-mix(in srgb, var(--color-muted) 15%, var(--color-surface));
--pl-ink: var(--color-ink); --pl-ink: var(--color-ink);
--pl-muted: var(--color-muted); --pl-muted: var(--color-muted);
--pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent); --pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent);
position: relative;
container-type: inline-size; container-type: inline-size;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -93,6 +94,32 @@
list-style: none; list-style: none;
} }
/* Balanced rows (PeopleTiles.tsx sets --pl-cols once it has measured):
a grid of equal columns, each at most a tile wide, shrinking only
when two won't fit. */
.pl__row[style*="--pl-cols"] {
display: grid;
grid-template-columns: repeat(var(--pl-cols), minmax(0, var(--pl-w)));
}
.pl[data-align="center"] .pl__row[style*="--pl-cols"] {
justify-content: center;
}
.pl__row[style*="--pl-cols"] .pl__tile {
width: 100%;
max-width: var(--pl-w);
}
/* Measures one tile's width and the gap for the balancing. */
.pl__probe {
position: absolute;
visibility: hidden;
width: var(--pl-w);
height: var(--pl-gap);
pointer-events: none;
}
.pl[data-overflow="scroll"] .pl__row { .pl[data-overflow="scroll"] .pl__row {
flex-wrap: nowrap; flex-wrap: nowrap;
overflow-x: auto; overflow-x: auto;
@ -142,6 +169,7 @@
padding: var(--pl-pad); padding: var(--pl-pad);
padding-bottom: calc(var(--pl-pad) * 1.6); padding-bottom: calc(var(--pl-pad) * 1.6);
background: var(--pl-frame-bg); background: var(--pl-frame-bg);
box-shadow: var(--shadow-sm);
transition: transform 160ms ease, background-color 160ms ease; transition: transform 160ms ease, background-color 160ms ease;
} }
@ -332,7 +360,6 @@
height: 1.75rem; 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);
corner-shape: squircle;
background: var(--color-surface); background: var(--color-surface);
color: var(--pl-muted); color: var(--pl-muted);
font-size: 1.1rem; font-size: 1.1rem;

View file

@ -53,6 +53,10 @@ import "./PeopleTiles.css";
* lines of name (and two of title), so a row's cards are one * lines of name (and two of title), so a row's cards are one
* height. The list as a whole has the frame, not each tile. * height. The list as a whole has the frame, not each tile.
* *
* Rows are balanced (balancedColumns): as many tiles across as fit,
* but never fewer than 2 or more than 10, and spread so the last
* row isn't a lone tile. When 2 don't fit at full size they shrink.
*
* 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
* the screen), and close on Escape, the tile again, or a click * the screen), and close on Escape, the tile again, or a click
@ -413,6 +417,7 @@ export function PeopleTilesView({
// the down arrow, and the details panel shows it whole. // the down arrow, and the details panel shows it whole.
const [clipped, setClipped] = useState<ReadonlySet<string>>(() => new Set()); const [clipped, setClipped] = useState<ReadonlySet<string>>(() => new Set());
const rootRef = useRef<HTMLDivElement>(null); const rootRef = useRef<HTMLDivElement>(null);
const probeRef = useRef<HTMLSpanElement>(null);
const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md"; const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md";
const features = SIZE_FEATURES[resolvedSize]; const features = SIZE_FEATURES[resolvedSize];
@ -433,6 +438,27 @@ export function PeopleTilesView({
.filter((group) => group.people.length > 0); .filter((group) => group.people.length > 0);
}, [groups, people]); }, [groups, people]);
const hasPeople = resolvedGroups.length > 0;
// How much room a row has, and one tile's width and gap there, in
// px: the probe carries --pl-w and --pl-gap, so the CSS stays the
// one place that sizes tiles.
const [room, setRoom] = useState<{ width: number; tile: number; gap: number } | null>(null);
useLayoutEffect(() => {
const root = rootRef.current;
const probe = probeRef.current;
if (!root || !probe || overflow === "scroll") return undefined;
const measure = () => {
const padding = parseFloat(getComputedStyle(root).paddingLeft) * 2;
setRoom({ width: root.clientWidth - padding, tile: probe.offsetWidth, gap: probe.offsetHeight });
};
measure();
const observer = new ResizeObserver(measure);
observer.observe(root);
return () => observer.disconnect();
}, [overflow, hasPeople]);
// A click anywhere outside the list closes the panel. // A click anywhere outside the list closes the panel.
useEffect(() => { useEffect(() => {
if (!openKey) return undefined; if (!openKey) return undefined;
@ -509,6 +535,7 @@ export function PeopleTilesView({
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
{...rest} {...rest}
> >
<span ref={probeRef} className="pl__probe" aria-hidden="true" />
<div className="pl__groups"> <div className="pl__groups">
{resolvedGroups.map((group) => ( {resolvedGroups.map((group) => (
<section <section
@ -526,7 +553,16 @@ export function PeopleTilesView({
</header> </header>
)} )}
<ul className="pl__row"> <ul
className="pl__row"
style={
room
? ({
"--pl-cols": balancedColumns(group.people.length, room.width, room.tile, room.gap),
} as CSSProperties)
: undefined
}
>
{group.people.map((person, index) => { {group.people.map((person, index) => {
const key = keyFor(group, person, index); const key = keyFor(group, person, index);
const expandable = (features.details && hasDetails(person)) || clipped.has(key); const expandable = (features.details && hasDetails(person)) || clipped.has(key);
@ -797,6 +833,19 @@ function Chevron() {
/* ── Helpers ─────────────────────────────────────────────────── */ /* ── Helpers ─────────────────────────────────────────────────── */
/* Tiles across a row: as many as fit, at least 2 and at most 10
(never more than there are), then evened out so the rows come
out as close to equal as they can: 5 tiles that fit 4 across go
3 and 2, not 4 and 1. If one tile would still be left alone (3
where only 2 fit), one more, narrower, column takes it. */
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
if (count <= 1) return 1;
const fit = Math.floor((width + gap) / (tile + gap));
const most = Math.min(count, 10, Math.max(2, fit));
const cols = Math.ceil(count / Math.ceil(count / most));
return count % cols === 1 && cols < Math.min(count, 10) ? cols + 1 : cols;
}
/* 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
hand-written entry with no page behind it. */ hand-written entry with no page behind it. */
function profileHref(person: Person): string | null { function profileHref(person: Person): string | null {

View file

@ -5,14 +5,17 @@
page loads no iframes until someone asks for one. Used by the page loads no iframes until someone asks for one. Used by the
featured cards and the video content block. featured cards and the video content block.
The still is the caller's image, else YouTube's own thumbnail, The still is the caller's image, else YouTube's own thumbnail
else a plain dark panel. A link that embeds.ts can't turn into a (its 16:9 one, falling back to the 4:3 one cropped), else a plain
dark panel. The play button shows on hover or keyboard focus, and
always on a touch screen, which can't hover. Small rounded
corners, as the only rounded thing besides buttons and dots. A link that embeds.ts can't turn into a
player (not https, or not a host it knows how to frame) still player (not https, or not a host it knows how to frame) still
goes somewhere: the still becomes a link to it. goes somewhere: the still becomes a link to it.
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
import { Play } from '@phosphor-icons/react' import { Play } from '@phosphor-icons/react'
import { useState } from 'react' import { useState, type SyntheticEvent } from 'react'
import HomeLink from '../pages/sections/home/HomeLink.tsx' import HomeLink from '../pages/sections/home/HomeLink.tsx'
import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts' import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
@ -37,36 +40,42 @@ export default function VideoPlayer({
if (playing && source) { if (playing && source) {
const live = playingSource(source) const live = playingSource(source)
return live.kind === 'file' ? ( return live.kind === 'file' ? (
<video src={live.src} controls autoPlay playsInline className={`aspect-video w-full bg-black ${className}`} /> <video src={live.src} controls autoPlay playsInline className={`aspect-video w-full rounded-md bg-black ${className}`} />
) : ( ) : (
<iframe <iframe
src={live.src} src={live.src}
title={title || 'Video'} title={title || 'Video'}
allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
allowFullScreen allowFullScreen
className={`aspect-video w-full border-0 bg-black ${className}`} className={`aspect-video w-full rounded-md border-0 bg-black ${className}`}
/> />
) )
} }
const image = still ?? videoThumbnail(url) const image = still ?? videoThumbnail(url)
// YouTube's 16:9 still is missing for some videos; its 4:3 one never is.
const fallBack = (event: SyntheticEvent<HTMLImageElement>) => {
const img = event.currentTarget
if (img.src.endsWith('/hq720.jpg')) img.src = img.src.replace(/hq720\.jpg$/, 'hqdefault.jpg')
}
const face = ( const face = (
<> <span className={`relative block overflow-hidden rounded-md ${className}`}>
{image ? ( {image ? (
<img src={image} alt="" loading="lazy" className={`aspect-video w-full object-cover ${className}`} /> <img src={image} alt="" loading="lazy" onError={fallBack} className="block aspect-video w-full object-cover" />
) : ( ) : (
<div className={`aspect-video w-full bg-[#004552] ${className}`} /> <span className="block aspect-video w-full bg-[#004552]" />
)} )}
<span <span
aria-hidden="true" aria-hidden="true"
className="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/25" className="video-play absolute inset-0 flex items-center justify-center transition-colors group-hover:bg-black/20 group-focus-visible:bg-black/20"
> >
<span className="flex h-16 w-16 items-center justify-center btn bg-white/90 shadow-lg transition-transform group-hover:scale-110"> <span className="flex h-16 w-16 items-center justify-center rounded-full bg-white/95 shadow-lg transition-transform group-hover:scale-105">
<Play className="ml-1 h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" /> <Play className="h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" />
</span>
</span> </span>
</span> </span>
</>
) )
if (!source) { if (!source) {

View file

@ -32,10 +32,15 @@
--color-action-hover: #001011; --color-action-hover: #001011;
--color-surface: #fcfffd; /* page and cards */ --color-surface: #fcfffd; /* page and cards */
--color-tint: #c2f6ff; /* tinted sections and panels */ --color-tint: #c2f6ff; /* tinted sections and panels */
--color-tint-soft: #dfebd6; /* hover rows, faint panels */ --color-tint-soft: #e8fcfe; /* hover rows, faint panels */
--color-danger: #b3261e; --color-danger: #b3261e;
--color-danger-tint: #fdf3f2; --color-danger-tint: #fdf3f2;
/* Cards: a step off the page so they read as sitting on it (white
here; a touch of tint in dark mode, below). Derived rather than
an admin token, so it follows the palette. With a shadow. */
--color-raised: #ffffff;
/* Tailwind's shadows, tinted with the site's deep ink instead of /* Tailwind's shadows, tinted with the site's deep ink instead of
black, so a card's shadow belongs to the page. */ black, so a card's shadow belongs to the page. */
--shadow-2xs: 0 1px rgb(0 16 17 / 0.05); --shadow-2xs: 0 1px rgb(0 16 17 / 0.05);
@ -69,9 +74,10 @@
--color-action-hover: #004552; --color-action-hover: #004552;
--color-surface: #001011; --color-surface: #001011;
--color-tint: #004552; --color-tint: #004552;
--color-tint-soft: #27371b; --color-tint-soft: #00252b;
--color-danger: #ff8a80; --color-danger: #ff8a80;
--color-danger-tint: #3b1714; --color-danger-tint: #3b1714;
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
--accent-text-mix: 50%; --accent-text-mix: 50%;
color-scheme: dark; color-scheme: dark;
} }
@ -86,9 +92,10 @@
--color-action-hover: #004552; --color-action-hover: #004552;
--color-surface: #001011; --color-surface: #001011;
--color-tint: #004552; --color-tint: #004552;
--color-tint-soft: #27371b; --color-tint-soft: #00252b;
--color-danger: #ff8a80; --color-danger: #ff8a80;
--color-danger-tint: #3b1714; --color-danger-tint: #3b1714;
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
--accent-text-mix: 50%; --accent-text-mix: 50%;
color-scheme: dark; color-scheme: dark;
} }
@ -168,7 +175,7 @@ h1, h2, h3, h4, h5, h6 {
--color-brand: #008fa8; --color-brand: #008fa8;
--color-surface: #fcfffd; --color-surface: #fcfffd;
--color-tint: #c2f6ff; --color-tint: #c2f6ff;
--color-tint-soft: #dfebd6; --color-tint-soft: #e8fcfe;
--color-danger: #b3261e; --color-danger: #b3261e;
--color-danger-tint: #fdf3f2; --color-danger-tint: #fdf3f2;
--accent-text-mix: 100%; --accent-text-mix: 100%;
@ -195,18 +202,12 @@ iframe[src*="churchcenter"] {
} }
/* Corners, one rule for the site: none. Everything is square except /* Corners, one rule for the site: none. Everything is square except
buttons, which get a superellipse (the btn utility below, or buttons (the btn utility below, or var(--btn-radius) in plain CSS)
var(--btn-radius) with corner-shape in plain CSS), and things that and video players, which get a small radius, and things that are
are round by nature: dots and radio marks. Browsers without round by nature: dots, radio marks, the play button. */
corner-shape draw the button corner as a small plain radius. */
:root { :root {
--btn-radius: 0.5rem; --btn-radius: 0.5rem;
} }
@supports (corner-shape: squircle) {
:root {
--btn-radius: 1.25rem;
}
}
/* 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
@ -238,13 +239,26 @@ iframe[src*="churchcenter"] {
} }
} }
/* Buttons, and links drawn as buttons: Poppins Bold, superellipse /* A video's play button (VideoPlayer.tsx) waits for a hover or
keyboard focus where the device can hover; on a touch screen it
always shows, since there is nothing to hover with. */
@media (hover: hover) {
.video-play > span {
opacity: 0;
transition: opacity 160ms ease, transform 160ms ease;
}
.group:hover .video-play > span,
.group:focus-visible .video-play > span {
opacity: 1;
}
}
/* Buttons, and links drawn as buttons: Poppins Bold, small rounded
corners. Color, size and border stay with each button. */ corners. Color, size and border stay with each button. */
@utility btn { @utility btn {
font-family: var(--font-display); font-family: var(--font-display);
font-weight: 700; font-weight: 700;
border-radius: var(--btn-radius); border-radius: var(--btn-radius);
corner-shape: squircle;
} }
/* Scrollbar hide */ /* Scrollbar hide */

View file

@ -95,18 +95,30 @@ export function paletteFill(name: string): { background: string; color: string }
full autumn at 2000; every year before 2000 is fully turned. The full autumn at 2000; every year before 2000 is fully turned. The
green is the palette's, deepened so a leaf stands out on the green is the palette's, deepened so a leaf stands out on the
page; the autumn shades are the one set of colors outside the page; the autumn shades are the one set of colors outside the
palette, since the palette has none. */ palette, since the palette has none. A hex, so readableOn can
const LEAF_GREEN = 'color-mix(in oklch, #00b83d 60%, #00521b)' pick text for something filled with it (a decade's tag). */
const LEAF_GREEN = '#008f2f' // #00b83d deepened toward #00521b
const LEAF_GOLD = '#c98a0b' const LEAF_GOLD = '#c98a0b'
const LEAF_AUTUMN = '#b8461b' const LEAF_AUTUMN = '#b8461b'
const LEAF_TURNED_BY = 2000 const LEAF_TURNED_BY = 2000
function mixHex(from: string, to: string, amount: number): string {
const channel = (hex: string, i: number) => parseInt(hex.slice(i, i + 2), 16)
return (
'#' +
[1, 3, 5]
.map((i) => Math.round(channel(from, i) + (channel(to, i) - channel(from, i)) * amount))
.map((value) => value.toString(16).padStart(2, '0'))
.join('')
)
}
export function leafColor(year: number, thisYear = new Date().getFullYear()): string { export function leafColor(year: number, thisYear = new Date().getFullYear()): string {
if (year < LEAF_TURNED_BY) return LEAF_AUTUMN if (year < LEAF_TURNED_BY) return LEAF_AUTUMN
const span = Math.max(1, thisYear - LEAF_TURNED_BY) const span = Math.max(1, thisYear - LEAF_TURNED_BY)
const turned = Math.min(1, Math.max(0, (thisYear - year) / span)) const turned = Math.min(1, Math.max(0, (thisYear - year) / span))
// Green to gold over the first half of the span, gold to autumn over the second. // Green to gold over the first half of the span, gold to autumn over the second.
return turned <= 0.5 return turned <= 0.5
? `color-mix(in oklch, ${LEAF_GOLD} ${Math.round(turned * 200)}%, ${LEAF_GREEN})` ? mixHex(LEAF_GREEN, LEAF_GOLD, turned * 2)
: `color-mix(in oklch, ${LEAF_AUTUMN} ${Math.round((turned - 0.5) * 200)}%, ${LEAF_GOLD})` : mixHex(LEAF_GOLD, LEAF_AUTUMN, (turned - 0.5) * 2)
} }

View file

@ -131,7 +131,10 @@ export function videoThumbnail(raw?: string | null): string | null {
if (!raw) return null if (!raw) return null
try { try {
const id = youtubeId(new URL(raw.trim())) const id = youtubeId(new URL(raw.trim()))
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hqdefault.jpg` : null // hq720 is a 16:9 frame; hqdefault (every video has one) is 4:3
// with black bars baked in, so it's only the fallback (VideoPlayer
// swaps to it if hq720 is missing, and crops it to 16:9).
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hq720.jpg` : null
} catch { } catch {
return null return null
} }

View file

@ -11,9 +11,10 @@
Forms, Tools, and Panel, which only exists for superadmins. Forms, Tools, and Panel, which only exists for superadmins.
It asks for the wide admin column (adminWidth.tsx), like the It asks for the wide admin column (adminWidth.tsx), like the
editor, so the cards run three across on a wide screen. Each editor, so the cards run three across on a wide screen. The
block takes a color from the palette (GROUPS), tinting its blocks alternate between two palette colors (BLOCK_COLORS),
cards and drawing its bar, so the groups read apart at a glance. tinting their cards and drawing their bars, so neighboring groups
read apart at a glance.
The right-hand panel is deliberately inert. Nothing here The right-hand panel is deliberately inert. Nothing here
fetches, so the landing page can't be slow or half-broken on fetches, so the landing page can't be slow or half-broken on
@ -46,7 +47,7 @@ function NavCard({ item, color }) {
return ( return (
<div <div
className="group relative flex flex-col border-l-4 p-5 transition-colors hover:brightness-[0.97]" className="group relative flex flex-col border-l-4 p-5 shadow-sm transition-shadow hover:shadow-md"
style={{ borderColor: color, background: tintOf(color) }} style={{ borderColor: color, background: tintOf(color) }}
> >
<div className="flex items-baseline gap-3"> <div className="flex items-baseline gap-3">
@ -112,13 +113,12 @@ function PanelSection({ title, children }) {
/* The header's groups, in its order, each with its palette color. /* The header's groups, in its order, each with its palette color.
Panel is drawn separately below, since only superadmins get it. */ Panel is drawn separately below, since only superadmins get it. */
const GROUPS = [ const BLOCK_COLORS = [PALETTE.teal[0], PALETTE.green[0]];
{ nav: DATA_NAV, color: PALETTE.teal[0] }, const GROUPS = [DATA_NAV, PAGES_NAV, FORMS_NAV, TOOLS_NAV].map((nav, index) => ({
{ nav: PAGES_NAV, color: PALETTE.green[0] }, nav,
{ nav: FORMS_NAV, color: PALETTE.mint[2] }, color: BLOCK_COLORS[index % BLOCK_COLORS.length],
{ nav: TOOLS_NAV, color: PALETTE.ink[2] }, }));
]; const PANEL_COLOR = BLOCK_COLORS[GROUPS.length % BLOCK_COLORS.length];
const PANEL_COLOR = PALETTE.ink[1];
const QUICK_ADD = [ const QUICK_ADD = [
{ to: "/admin/events/new", label: "New event" }, { to: "/admin/events/new", label: "New event" },

View file

@ -114,6 +114,9 @@ export default function AdminLayout() {
// Whether the page below asked for extra room (the record editor, // Whether the page below asked for extra room (the record editor,
// for its section nav). setWide is a state setter, so it's stable. // for its section nav). setWide is a state setter, so it's stable.
const [wide, setWide] = useState(false); const [wide, setWide] = useState(false);
// The header, its strip and the footer line up with the content,
// however wide the page asked for.
const column = wide ? "max-w-[82rem]" : "max-w-5xl";
useEffect(() => { useEffect(() => {
// Sections only exist in the CMS. Home and Panel already say // Sections only exist in the CMS. Home and Panel already say
@ -133,9 +136,9 @@ export default function AdminLayout() {
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>; const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
return ( return (
<div className="flex min-h-screen flex-col bg-tint-soft"> <div className="flex min-h-screen flex-col bg-surface">
<header className="border-b border-brand/20 bg-surface"> <header className="border-b border-brand/20 bg-surface">
<div className="mx-auto flex max-w-5xl flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4"> <div className={`mx-auto flex ${column} flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4`}>
{/* Already home, so nothing to link to. */} {/* Already home, so nothing to link to. */}
{isHome ? ( {isHome ? (
wordmark wordmark
@ -183,8 +186,8 @@ export default function AdminLayout() {
{/* Subnav. Only drawn where there is something to draw, so {/* Subnav. Only drawn where there is something to draw, so
Events and People don't get an empty gray strip. */} Events and People don't get an empty gray strip. */}
{subnav.length > 0 && ( {subnav.length > 0 && (
<div className="border-t border-brand/10 bg-tint-soft"> <div className="border-t border-brand/10 bg-surface">
<div className="mx-auto flex max-w-5xl flex-wrap gap-6 px-6 py-2.5 text-sm"> <div className={`mx-auto flex ${column} flex-wrap gap-6 px-6 py-2.5 text-sm`}>
{subnav.map((child) => ( {subnav.map((child) => (
<NavLink <NavLink
key={child.to} key={child.to}
@ -206,7 +209,7 @@ export default function AdminLayout() {
{/* flex-1 rather than a fixed height: the footer sits at the {/* flex-1 rather than a fixed height: the footer sits at the
bottom of a short page and below the content of a long one, bottom of a short page and below the content of a long one,
without ever floating over it. */} without ever floating over it. */}
<main className={`mx-auto w-full flex-1 px-6 py-10 ${wide ? "max-w-[82rem]" : "max-w-5xl"}`}> <main className={`mx-auto w-full flex-1 px-6 py-10 ${column}`}>
<AdminTitleContext.Provider value={titleContext}> <AdminTitleContext.Provider value={titleContext}>
<AdminWidthContext.Provider value={setWide}> <AdminWidthContext.Provider value={setWide}>
<Suspense fallback={null}> <Suspense fallback={null}>
@ -217,7 +220,7 @@ export default function AdminLayout() {
</main> </main>
<footer className="border-t border-brand/15 bg-surface"> <footer className="border-t border-brand/15 bg-surface">
<div className="mx-auto flex max-w-5xl items-center gap-4 px-6 py-3"> <div className={`mx-auto flex ${column} items-center gap-4 px-6 py-3`}>
<Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70"> <Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70">
<img src={siteLogo} alt="NGU" className="h-6 w-auto" /> <img src={siteLogo} alt="NGU" className="h-6 w-auto" />
</Link> </Link>

View file

@ -6,7 +6,7 @@ import ArrowLink from "../../components/ArrowLink.tsx";
import OrgLogo from "../../components/OrgLogo.tsx"; import OrgLogo from "../../components/OrgLogo.tsx";
import { orgPath } from "../../lib/organizations.ts"; import { orgPath } from "../../lib/organizations.ts";
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts"; import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
import { withAlpha, accentText, readableOn } from '../../lib/color.ts' import { accentText, readableOn } from '../../lib/color.ts'
import { scrollBehavior } from "../../lib/motion.ts"; import { scrollBehavior } from "../../lib/motion.ts";
/* ═══════════════════════════════════════════════════════════════ /* ═══════════════════════════════════════════════════════════════
@ -163,7 +163,11 @@ function Tile({
const active = ids.includes(selected) || ids.includes(hovered); const active = ids.includes(selected) || ids.includes(hovered);
const dimmed = selected && !ids.includes(selected); const dimmed = selected && !ids.includes(selected);
const clipId = `clip-${code}`; const clipId = `clip-${code}`;
const opacity = count ? 1 : active ? 0.5 : 0.28; // Solid, never see-through: a tile with no groups, or one dimmed
// while another region is picked, is its color mixed toward the
// page's rather than faded, so the backdrop doesn't show through.
const strength = dimmed ? (count ? 35 : 15) : count ? 100 : active ? 50 : 28;
const tileFill = (color: string) => `color-mix(in srgb, ${color} ${strength}%, var(--color-surface))`;
// Clicking a shared tile cycles through its regions and then // Clicking a shared tile cycles through its regions and then
// clears, so every slice is reachable without a second control. // clears, so every slice is reachable without a second control.
@ -179,8 +183,6 @@ function Tile({
onMouseEnter={() => setHovered(primary.regionId)} onMouseEnter={() => setHovered(primary.regionId)}
onMouseLeave={() => setHovered(null)} onMouseLeave={() => setHovered(null)}
style={{ cursor: "pointer" }} style={{ cursor: "pointer" }}
opacity={dimmed ? 0.25 : 1}
className="transition-opacity duration-200"
> >
<title> <title>
{AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")} {AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")}
@ -188,7 +190,7 @@ function Tile({
</title> </title>
<clipPath id={clipId}> <clipPath id={clipId}>
<rect x={x} y={y} width={width} height={size} rx={14} /> <rect x={x} y={y} width={width} height={size} />
</clipPath> </clipPath>
<g clipPath={`url(#${clipId})`}> <g clipPath={`url(#${clipId})`}>
@ -202,8 +204,7 @@ function Tile({
y={top} y={top}
width={width} width={width}
height={h} height={h}
fill={colorOf(slice)} style={{ fill: tileFill(colorOf(slice)) }}
fillOpacity={opacity}
className="transition-all duration-200" className="transition-all duration-200"
/> />
); );
@ -215,7 +216,6 @@ function Tile({
y={y} y={y}
width={width} width={width}
height={size} height={size}
rx={14}
fill="none" fill="none"
stroke={active ? colorOf(primary) : "var(--color-surface)"} stroke={active ? colorOf(primary) : "var(--color-surface)"}
strokeOpacity={active ? 1 : 0.55} strokeOpacity={active ? 1 : 0.55}
@ -230,7 +230,7 @@ function Tile({
dominantBaseline="middle" dominantBaseline="middle"
fontSize={fontSize} fontSize={fontSize}
fontWeight="800" fontWeight="800"
fill={count ? "var(--color-surface)" : colorOf(primary)} fill={count && !dimmed ? "var(--color-surface)" : colorOf(primary)}
style={{ pointerEvents: "none" }} style={{ pointerEvents: "none" }}
> >
{label || code} {label || code}
@ -242,7 +242,6 @@ function Tile({
cy={y + 14} cy={y + 14}
r={7} r={7}
fill="#ffffff" fill="#ffffff"
fillOpacity={0.9}
style={{ pointerEvents: "none" }} style={{ pointerEvents: "none" }}
/> />
)} )}
@ -293,10 +292,11 @@ function LegendButton({ region, selected, setSelected, hovered, setHovered }) {
aria-pressed={selected === region.id} aria-pressed={selected === region.id}
className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200" className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200"
style={{ style={{
border: `1px solid ${colorOf(region)}`, // Solid like the tiles: another region picked dims this one
background: on ? colorOf(region) : "transparent", // by color, not by letting the page show through.
color: on ? readableOn(colorOf(region)) : INK, border: `1px solid ${selected && !on ? `color-mix(in srgb, ${colorOf(region)} 40%, var(--color-raised))` : colorOf(region)}`,
opacity: selected && selected !== region.id ? 0.45 : 1, background: on ? colorOf(region) : "var(--color-raised)",
color: on ? readableOn(colorOf(region)) : selected ? "var(--color-muted)" : INK,
}} }}
> >
<span <span
@ -473,7 +473,7 @@ function GroupCard({ group, color, open, onOpen }) {
className="p-4 flex items-start 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 ? `${withAlpha(color, 8)}` : "transparent", background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)",
}} }}
> >
<OrgLogo org={group} color={color} /> <OrgLogo org={group} color={color} />
@ -541,7 +541,7 @@ function GroupDetail({ group, region, onClose }) {
return ( return (
<div <div
className="p-6 mb-6" className="p-6 mb-6"
style={{ border: `2px solid ${colorOf(region)}`, background: `${withAlpha(colorOf(region), 6)}` }} 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-20 w-20" /> <OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />

View file

@ -6,6 +6,7 @@ import {
type SortDirection, type SortDirection,
} from '../../../lib/timeline.ts' } from '../../../lib/timeline.ts'
import TimelineYear from './TimelineYear.tsx' import TimelineYear from './TimelineYear.tsx'
import { leafColor, readableOn } from '../../../lib/color.ts'
type Props = { type Props = {
decade: GroupedDecade decade: GroupedDecade
@ -31,7 +32,7 @@ export default function TimelineDecade({
aria-labelledby={`site-tl-decade-${decade.decade}`} aria-labelledby={`site-tl-decade-${decade.decade}`}
> >
<header className="site-tl__decadeHead"> <header className="site-tl__decadeHead">
<span className="site-tl__decadeNum" aria-hidden="true"> <span className="site-tl__decadeNum" style={decadeColors(decade.decade)} aria-hidden="true">
{decadeLabel(decade.decade)} {decadeLabel(decade.decade)}
</span> </span>
<div> <div>
@ -63,3 +64,11 @@ export default function TimelineDecade({
</section> </section>
) )
} }
/* A decade's tag takes its leaves' color, the middle of the decade
(or this year, for the one still running), with text that reads
on it. */
function decadeColors(decade: number) {
const background = leafColor(Math.min(decade + 5, new Date().getFullYear()))
return { background, color: readableOn(background) }
}

View file

@ -18,17 +18,33 @@
--tl-accent: var(--color-link); --tl-accent: var(--color-link);
--tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent); --tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent);
/* The rail is a branch: wood brown, the leaves on it. The one other
color outside the palette, with the autumn leaves. */
--tl-wood: #7a5236;
--tl-gutter: 5rem; --tl-gutter: 5rem;
--tl-rail-x: 1.75rem; --tl-rail-x: 1.75rem;
--tl-rail-w: 2px; --tl-rail-w: 3px;
--tl-branch: 0.75rem;
color: var(--tl-ink); color: var(--tl-ink);
} }
/* Lighter wood on a dark page. */
:root[data-theme="dark"] .site-tl {
--tl-wood: #a8805a;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .site-tl {
--tl-wood: #a8805a;
}
}
@media (max-width: 640px) { @media (max-width: 640px) {
.site-tl { .site-tl {
--tl-gutter: 3rem; --tl-gutter: 3rem;
--tl-rail-x: 1rem; --tl-rail-x: 1rem;
--tl-branch: 0.4rem;
} }
} }
@ -47,13 +63,13 @@
bottom: 0; bottom: 0;
left: var(--tl-rail-x); left: var(--tl-rail-x);
width: var(--tl-rail-w); width: var(--tl-rail-w);
background: var(--tl-rail); background: var(--tl-wood);
} }
.site-tl__decade--pre::before { .site-tl__decade--pre::before {
background: none; background: none;
border-left: var(--tl-rail-w) solid var(--tl-rail); border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.35; opacity: 0.45;
} }
/* Last decade fades out rather than stopping dead. */ /* Last decade fades out rather than stopping dead. */
@ -80,20 +96,16 @@
padding-block-start: 0.5rem; padding-block-start: 0.5rem;
} }
/* The numeral is a tag on the rail: a dark block with white type, /* The numeral is a tag off the rail, like a branch: a short slanted
centered on the line, so the rail runs into it and out again. stroke of the rail's wood runs up from the line to it, and the line
(It used to paint the page's color to hide the rail behind it, carries on past. Its color is the decade's leaves', set inline
which showed as a white box once sections went transparent.) */ (TimelineDecade.tsx). */
.site-tl__decadeNum { .site-tl__decadeNum {
position: relative; position: relative;
z-index: 1;
justify-self: start; justify-self: start;
width: fit-content; width: fit-content;
margin-left: calc(var(--tl-rail-x) + (var(--tl-rail-w) / 2)); margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch));
transform: translateX(-50%);
padding: 0.5rem 0.3rem; padding: 0.5rem 0.3rem;
background: var(--color-action);
color: #ffffff;
font-family: var(--font-display); font-family: var(--font-display);
font-size: 0.9375rem; font-size: 0.9375rem;
font-weight: 700; font-weight: 700;
@ -104,9 +116,16 @@
text-orientation: sideways; text-orientation: sideways;
} }
.site-tl__decade--pre .site-tl__decadeNum { .site-tl__decadeNum::before {
background: var(--color-tint); content: '';
color: var(--color-muted); position: absolute;
top: 55%;
right: 100%;
width: calc(var(--tl-branch) + 0.2rem);
height: 3px;
background: var(--tl-wood);
transform-origin: right center;
transform: rotate(28deg);
} }
.site-tl__decadeTitle { .site-tl__decadeTitle {
@ -356,9 +375,6 @@ a.site-tl__entry:hover .site-tl__entryTitle {
background: var(--tl-accent); background: var(--tl-accent);
} }
.site-tl__kind--event {
}
.site-tl__kind--award { .site-tl__kind--award {
clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
} }
@ -378,11 +394,14 @@ a.site-tl__entry:hover .site-tl__entryTitle {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
/* Solid, not a see-through tint: dark text on a tint on the
page's colored backdrop was hard to read. */
.site-tl__entry--featured { .site-tl__entry--featured {
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
padding: 1rem 1.125rem; padding: 1rem 1.125rem;
border-left: 2px solid var(--tl-accent); border-left: 2px solid var(--tl-accent);
background: var(--tl-accent-soft); background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
box-shadow: var(--shadow-sm);
} }
.site-tl__entry--featured .site-tl__entryTitle { .site-tl__entry--featured .site-tl__entryTitle {
@ -397,7 +416,7 @@ a.site-tl__entry:hover .site-tl__entryTitle {
} }
a.site-tl__entry--featured:hover { a.site-tl__entry--featured:hover {
background: color-mix(in srgb, var(--tl-accent) 18%, transparent); background: color-mix(in srgb, var(--tl-accent) 16%, var(--color-raised));
} }
/* --- Empty state ----------------------------------------------- */ /* --- Empty state ----------------------------------------------- */
@ -429,7 +448,6 @@ a.site-tl__entry--featured:hover {
padding: 0.375rem 0.75rem; padding: 0.375rem 0.75rem;
border: 1px solid var(--tl-rail); border: 1px solid var(--tl-rail);
border-radius: var(--btn-radius); border-radius: var(--btn-radius);
corner-shape: squircle;
background: none; background: none;
color: var(--tl-muted); color: var(--tl-muted);
font: inherit; font: inherit;
@ -485,8 +503,8 @@ a.site-tl__entry--featured:hover {
top: 1.25rem; top: 1.25rem;
bottom: 0; bottom: 0;
left: var(--tl-rail-x); left: var(--tl-rail-x);
border-left: var(--tl-rail-w) solid var(--tl-rail); border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.35; opacity: 0.45;
} }
.site-tl__upcomingBtn { .site-tl__upcomingBtn {
@ -520,7 +538,7 @@ a.site-tl__entry--featured:hover {
place-items: center; place-items: center;
margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2)); margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
font-size: 14px; font-size: 14px;
color: color-mix(in oklch, #00b83d 60%, #00521b); color: #008f2f; /* the leaves' green (leafColor) */
} }
.site-tl__upcomingLabel { .site-tl__upcomingLabel {
@ -586,7 +604,7 @@ a.site-tl__entry--featured:hover {
.site-tl__roster--featured { .site-tl__roster--featured {
padding: 0.5rem 1.125rem 1rem; padding: 0.5rem 1.125rem 1rem;
border-left: 2px solid var(--tl-accent); border-left: 2px solid var(--tl-accent);
background: var(--tl-accent-soft); background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
margin-top: -0.5rem; margin-top: -0.5rem;
} }
@ -615,7 +633,6 @@ a.site-tl__entry--featured:hover {
.site-tl__personPhoto { .site-tl__personPhoto {
width: 1.75rem; width: 1.75rem;
height: 1.75rem; height: 1.75rem;
border-radius: 50%;
object-fit: cover; object-fit: cover;
background: var(--tl-accent-soft); background: var(--tl-accent-soft);
flex: none; flex: none;

View file

@ -107,7 +107,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
<h2 className="font-display text-4xl font-bold text-ink md:text-5xl">{title}</h2> <h2 className="font-display text-4xl font-bold text-ink md:text-5xl">{title}</h2>
{blurb && <p className="mt-4 max-w-2xl text-lg text-muted">{blurb}</p>} {blurb && <p className="mt-4 max-w-2xl text-lg text-muted">{blurb}</p>}
<div className="mt-12 overflow-hidden"> <div className="mt-12 overflow-hidden shadow-md">
<div className="-mr-[4px] -mb-[4px]"> <div className="-mr-[4px] -mb-[4px]">
<div <div
role="tablist" role="tablist"
@ -134,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
tabIndex={on ? 0 : -1} tabIndex={on ? 0 : -1}
onClick={() => setSelected(index)} onClick={() => setSelected(index)}
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${ className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
on ? '' : 'bg-surface hover:bg-tint-soft' on ? '' : 'bg-raised hover:bg-tint-soft'
}`} }`}
style={on ? { background: color, color: readableOn(color) } : undefined} style={on ? { background: color, color: readableOn(color) } : undefined}
> >
@ -173,7 +173,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
<HomeLink <HomeLink
key={`${action.url}-${index}`} key={`${action.url}-${index}`}
url={action.url} url={action.url}
className={`${cell} hp-pop group flex flex-col bg-surface p-8 transition-colors duration-200 hover:bg-tint-soft`} className={`${cell} hp-pop group flex flex-col bg-raised p-8 transition-colors duration-200 hover:bg-tint-soft`}
style={{ animationDelay: `${120 + index * 90}ms` }} style={{ animationDelay: `${120 + index * 90}ms` }}
> >
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink"> <span className="flex items-start gap-2 font-display text-lg font-bold text-ink">