Design overhaul (v1.10.0 to v1.10.2) #18

Merged
ngu-git-admin merged 17 commits from design-overhaul into main 2026-09-30 23:59:16 +01:00
12 changed files with 228 additions and 81 deletions
Showing only changes of commit f37c093dc0 - Show all commits

View file

@ -20,7 +20,7 @@
The grid is one continuous block: no gaps and no frame, only a
colored rule between cards (each card's right and bottom border,
with the grid pulled past its clipping wrapper so the outer ones
fall outside). With three or more cards the first is the large
fall outside), 4px thick. With three or more cards the first is the large
one, two rows tall, and the next two stack beside it, so it no
longer stretches its neighbor.
═══════════════════════════════════════════════════════════════ */
@ -112,14 +112,15 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
return (
<li
className={`relative flex flex-col overflow-hidden border-r-2 border-b-2 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
large ? 'lg:col-span-2 lg:row-span-2' : ''
}`}
>
{card.kind === 'video' ? (
// Above the stretched link, which a video card doesn't have
// anyway, so the play button always gets the click.
<div className="relative z-10">
// anyway, so the play button always gets the click. Inset
// from the card's edges, so the frame sits inside the cell.
<div className="relative z-10 p-4 pb-0">
<VideoPicture card={card} />
</div>
) : (
@ -134,7 +135,7 @@ export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
const leadLarge = cards.length >= 3
return (
<div className="overflow-hidden">
<ul className="-mr-[2px] -mb-[2px] 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) => (
<Card
key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`}

View file

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

View file

@ -3,55 +3,86 @@
Flat fills only: no blur, no gradient, no glow. Light mode uses
the palette's four palest shades, dark mode its dark shades at
half opacity over the ink background. Every text token reads at
5:1 or better on any of them, where two overlap included (the
lowest is the danger red in dark mode).
45% opacity over the ink background. Every text token reads at
4.5:1 or better on any of them, even where three overlap (the
lowest, 4.8:1, is the danger red in dark mode).
═══════════════════════════════════════════════════════════════ */
/* 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 {
position: fixed;
position: absolute;
inset: 0;
z-index: -1;
overflow: hidden;
overflow: hidden; /* the section circles, never the fixed layer */
pointer-events: none;
--pb-opacity: 0.75;
--pb-opacity: 0.7;
--pb-a: #c2f6ff;
--pb-b: #dfebd6;
--pb-c: #c2ffd6;
--pb-d: #c2fbff;
--pb-e: #dfebd6;
--pb-shift: 0vw;
}
.page-backdrop__window {
position: fixed;
inset: 0;
overflow: hidden;
}
.page-backdrop__circle {
position: absolute;
border-radius: 50%;
opacity: var(--pb-opacity);
transform: translateX(var(--pb-shift));
transition: background-color 1.4s cubic-bezier(0.16, 1, 0.3, 1),
transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
transition: background-color 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-backdrop__circle--a { width: 70vmax; height: 70vmax; left: -22vmax; top: -18vmax; background: var(--pb-a); }
.page-backdrop__circle--b { width: 52vmax; height: 52vmax; right: -16vmax; top: 8vh; background: var(--pb-b); }
.page-backdrop__circle--c { width: 44vmax; height: 44vmax; left: 30vw; bottom: -20vmax; background: var(--pb-c); }
.page-backdrop__circle--d { width: 30vmax; height: 30vmax; left: 12vw; top: 46vh; background: var(--pb-d); }
.page-backdrop__circle--e { width: 24vmax; height: 24vmax; right: 18vw; bottom: 6vh; background: var(--pb-e); }
/* Slow: fixed to the window. */
.page-backdrop__circle--a { width: 70vmax; height: 70vmax; left: -24vmax; top: -16vmax; background: var(--pb-a); --pb-drift: -22vh; }
.page-backdrop__circle--b { width: 50vmax; height: 50vmax; right: -18vmax; top: 34vh; background: var(--pb-b); --pb-drift: -40vh; }
/* Tones, one per section in turn: the same shades, moved around. */
.page-backdrop[data-tone="1"] { --pb-a: #dfebd6; --pb-b: #c2ffd6; --pb-c: #c2f6ff; --pb-d: #dfebd6; --pb-e: #c2fbff; --pb-shift: 4vw; }
.page-backdrop[data-tone="2"] { --pb-a: #c2ffd6; --pb-b: #c2fbff; --pb-c: #dfebd6; --pb-d: #c2f6ff; --pb-e: #c2ffd6; --pb-shift: -3vw; }
.page-backdrop[data-tone="3"] { --pb-a: #c2fbff; --pb-b: #c2f6ff; --pb-c: #c2ffd6; --pb-d: #dfebd6; --pb-e: #c2f6ff; --pb-shift: 2vw; }
/* 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()) {
.page-backdrop__circle--a,
.page-backdrop__circle--b {
animation: page-backdrop-drift linear both;
animation-timeline: scroll(root block);
}
}
@keyframes page-backdrop-drift {
to {
transform: translateY(var(--pb-drift));
}
}
@media (prefers-reduced-motion: reduce) {
.page-backdrop__circle--a,
.page-backdrop__circle--b {
animation: none;
}
}
/* Tones, one per section in turn: the same shades, swapped around. */
.page-backdrop[data-tone="1"] { --pb-a: #dfebd6; --pb-b: #c2ffd6; --pb-c: #c2f6ff; --pb-d: #dfebd6; --pb-e: #c2fbff; }
.page-backdrop[data-tone="2"] { --pb-a: #c2ffd6; --pb-b: #c2fbff; --pb-c: #dfebd6; --pb-d: #c2f6ff; --pb-e: #c2ffd6; }
.page-backdrop[data-tone="3"] { --pb-a: #c2fbff; --pb-b: #c2f6ff; --pb-c: #c2ffd6; --pb-d: #dfebd6; --pb-e: #c2f6ff; }
/* Dark mode: the dark shades, the same turns. Two blocks as in
index.css: the toggle's choice, or the system's when there is none. */
:root[data-theme="dark"] .page-backdrop { --pb-opacity: 0.5; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; }
: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; }
: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) {
:root:not([data-theme="light"]) .page-backdrop { --pb-opacity: 0.5; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; }
: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[data-tone="1"] { --pb-a: #27371b; --pb-b: #004c52; --pb-c: #004552; --pb-d: #27371b; --pb-e: #00521b; }
: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; }
: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; }

View file

@ -2,17 +2,24 @@
PAGE BACKDROP
One background behind every public page: large flat circles in
the palette's light shades (its dark ones in dark mode), fixed to
the window and overlapping. Sections paint nothing of their own,
so it runs behind all of them; cards keep their solid surface.
the palette's light shades (its dark ones in dark mode),
overlapping. Sections paint nothing of their own, so it runs
behind all of them; cards keep their solid surface.
Two kinds of circle, for depth as the page scrolls:
slow fixed to the window, drifting up slower than the page
(a CSS scroll-driven animation, PageBackdrop.css)
section placed down the page itself, so they travel with the
sections they sit behind
Without scroll-driven animations, or under reduced motion, the
slow circles simply stay put.
As the visitor moves through a page the circles change tone: the
section crossing the middle of the window picks one of TONES (its
place on the page, in turn), and the circles ease to that tone's
colors and a slightly shifted position. Watched with an
IntersectionObserver, so nothing runs while the page sits still;
the colors are in PageBackdrop.css. Under reduced motion the
change is instant (index.css stops every transition).
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
included, in both modes: the light shades are the palette's
@ -25,7 +32,8 @@ import './PageBackdrop.css'
/** How many tones PageBackdrop.css defines (data-tone 0 to 3). */
const TONES = 4
const CIRCLES = ['a', 'b', 'c', 'd', 'e']
const SLOW = ['a', 'b']
const SECTION = ['c', 'd', 'e']
export default function PageBackdrop() {
const ref = useRef<HTMLDivElement>(null)
@ -75,7 +83,12 @@ export default function PageBackdrop() {
return (
<div ref={ref} className="page-backdrop" aria-hidden="true">
{CIRCLES.map((name) => (
<div className="page-backdrop__window">
{SLOW.map((name) => (
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} />
))}
</div>
{SECTION.map((name) => (
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} />
))}
</div>

View file

@ -25,6 +25,10 @@
flex-direction: column;
gap: calc(var(--pl-gap) * 1.25);
color: var(--pl-ink);
/* The frame is the whole list's, not each tile's. */
padding: calc(var(--pl-gap) * 1.5);
border: 2px solid var(--pl-frame-edge);
}
.pl[data-size="sm"] {
@ -102,6 +106,7 @@
}
.pl__item {
position: relative;
flex: 0 0 auto;
}
@ -137,8 +142,7 @@
padding: var(--pl-pad);
padding-bottom: calc(var(--pl-pad) * 1.6);
background: var(--pl-frame-bg);
border: 2px solid var(--pl-frame-edge);
transition: transform 160ms ease, border-color 160ms ease;
transition: transform 160ms ease, background-color 160ms ease;
}
.pl[data-tilt="on"] .pl__item:nth-child(odd) .pl__frame {
@ -154,7 +158,7 @@
.pl__tile--link:hover .pl__frame,
.pl__tile--link:focus-visible .pl__frame {
transform: translateY(-2px);
border-color: var(--pl-accent);
background: var(--color-tint-soft);
}
.pl__tile--button:focus-visible,
@ -169,7 +173,7 @@
}
.pl__tile[aria-expanded="true"] .pl__frame {
border-color: var(--pl-accent);
background: color-mix(in srgb, var(--pl-accent) 14%, var(--color-surface));
}
.pl__photo {
@ -258,6 +262,41 @@
/* bio panel ------------------------------------------------------------ */
/* Under its tile, over what follows, with a notch pointing up at
the tile (PeopleTiles.tsx picks the side). */
.pl__bio--anchored {
position: absolute;
top: calc(100% + 0.75rem);
left: 0;
z-index: 30;
width: min(24rem, calc(100vw - 2rem));
border-left: 0;
border-top: 3px solid var(--pl-accent);
background: var(--color-surface);
box-shadow: var(--shadow-lg);
}
.pl__bio--anchored[data-align="end"] {
left: auto;
right: 0;
}
.pl__bio--anchored::before {
content: '';
position: absolute;
top: -11px;
left: calc(var(--pl-w) / 2 - 8px);
width: 16px;
height: 8px;
background: var(--pl-accent);
clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.pl__bio--anchored[data-align="end"]::before {
left: auto;
right: calc(var(--pl-w) / 2 - 8px);
}
.pl__bio {
display: flex;
flex-direction: column;

View file

@ -51,7 +51,13 @@ import "./PeopleTiles.css";
*
* At every size the photo is square and the caption a fixed two
* lines of name (and two of title), so a row's cards are one
* height. What doesn't fit ends in an ellipsis, and that tile gets
* height. The list as a whole has the frame, not each tile.
*
* 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
* the screen), and close on Escape, the tile again, or a click
* anywhere else. A scrolling row would clip that panel, so with
* overflow="scroll" it opens under the whole list instead. What doesn't fit ends in an ellipsis, and that tile gets
* the chevron too, opening the details with it in full. A person
* with no photo gets their initials on a palette color
* (paletteFill in color.ts).
@ -427,6 +433,16 @@ export function PeopleTilesView({
.filter((group) => group.people.length > 0);
}, [groups, people]);
// A click anywhere outside the list closes the panel.
useEffect(() => {
if (!openKey) return undefined;
const onPointerDown = (event: PointerEvent) => {
if (!rootRef.current?.contains(event.target as Node)) setOpenKey(null);
};
document.addEventListener("pointerdown", onPointerDown);
return () => document.removeEventListener("pointerdown", onPointerDown);
}, [openKey]);
// Close the panel if the person it belongs to disappears.
useEffect(() => {
if (!openKey) return;
@ -441,6 +457,11 @@ export function PeopleTilesView({
}
const open = openKey ? findByKey(resolvedGroups, openKey) : null;
const anchored = overflow !== "scroll";
const closePanel = () => {
setOpenKey(null);
onExpand?.(null, null);
};
function markClipped(key: string, isClipped: boolean) {
setClipped((current) => {
@ -530,6 +551,15 @@ export function PeopleTilesView({
onToggle={() => toggle(group, person, index)}
onClip={(isClipped) => markClipped(key, isClipped)}
/>
{isOpen && anchored && open && (
<DetailPanel
id={`${baseId}-bio`}
person={open.person}
group={open.group}
anchored
onClose={closePanel}
/>
)}
</li>
);
})}
@ -538,15 +568,12 @@ export function PeopleTilesView({
))}
</div>
{open && (
{open && !anchored && (
<DetailPanel
id={`${baseId}-bio`}
person={open.person}
group={open.group}
onClose={() => {
setOpenKey(null);
onExpand?.(null, null);
}}
onClose={closePanel}
/>
)}
</div>
@ -662,13 +689,27 @@ function DetailPanel({
id,
person,
group,
anchored = false,
onClose,
}: {
id: string;
person: Person;
group: PeopleGroup;
anchored?: boolean;
onClose: () => void;
}) {
const panelRef = useRef<HTMLDivElement>(null);
const [alignEnd, setAlignEnd] = useState(false);
// Under the tile, starting at its left edge unless that would run
// off the right of the screen; then ending at its right edge.
useLayoutEffect(() => {
if (!anchored || !panelRef.current) return;
const tile = panelRef.current.parentElement?.getBoundingClientRect();
const width = panelRef.current.offsetWidth;
if (tile) setAlignEnd(tile.left + width > document.documentElement.clientWidth - 16);
}, [anchored]);
const org = resolveOrg(person.org);
const title = titleOf(person);
const paragraphs = Array.isArray(person.bio) ? person.bio : [person.bio];
@ -677,8 +718,10 @@ function DetailPanel({
return (
<div
ref={panelRef}
id={id}
className="pl__bio"
className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"}
data-align={alignEnd ? "end" : "start"}
role="region"
aria-label={`About ${person.name}`}
style={tint ? ({ "--pl-accent": tint } as CSSProperties) : undefined}

View file

@ -209,12 +209,33 @@ iframe[src*="churchcenter"] {
}
/* A notice where content would be (an empty section, a form's
note, "coming soon"): a flat tinted panel with a solid bar down
its left edge. It replaces the dashed outlines these used to have.
Padding stays with each use. */
note, "coming soon"): no box and no fill, just two thick brackets
at opposite corners, top left and bottom right, like a
viewfinder. Padding stays with each use; the brackets sit in its
corners, so give it some. */
@utility notice {
background: var(--color-tint-soft);
border-left: 4px solid var(--color-brand);
position: relative;
&::before,
&::after {
content: '';
position: absolute;
width: 1.75rem;
height: 1.75rem;
border: 0 solid var(--color-brand);
pointer-events: none;
}
&::before {
top: 0;
left: 0;
border-top-width: 4px;
border-left-width: 4px;
}
&::after {
right: 0;
bottom: 0;
border-right-width: 4px;
border-bottom-width: 4px;
}
}
/* Buttons, and links drawn as buttons: Poppins Bold, superellipse

View file

@ -43,7 +43,7 @@ const SECTIONS = [
"The regional organizations that support groups and host their own gatherings.",
accent: "#004c52",
Component: OrgListVertical,
request: { type: "region", label: "Update a region" },
request: { type: "region", label: "Request a region update" },
props: {
kind: "region",
pageLabel: "Region page",
@ -61,7 +61,7 @@ const SECTIONS = [
"Organizations we collaborate with across the Unity movement and beyond.",
accent: ACCENTS.olive,
Component: OrgListCards,
request: { type: "partner", label: "Add or update a partner" },
request: { type: "partner", label: "Request a partner listing" },
props: {
kind: "partner",
pageLabel: "Partner page",

View file

@ -496,12 +496,13 @@ type MonthGridProps = {
function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accent }: MonthGridProps) {
return (
<div className="overflow-hidden border border-brand/15 bg-surface shadow-sm">
<div className="grid grid-cols-7 border-b border-brand/10 bg-tint-soft">
{/* The weekday row: a solid bar in the button color, so the
grid has a clear head. */}
<div className="grid grid-cols-7 bg-action">
{WEEKDAYS.map((day) => (
<div
key={day}
className="px-3 py-2 text-xs font-bold uppercase tracking-widest"
style={{ color: BODY }}
className="px-3 py-3 font-display text-sm font-bold uppercase tracking-widest text-white"
>
{day}
</div>

View file

@ -36,9 +36,9 @@ import { accentText } from '../../lib/color.ts'
groupBy={org => org.details?.scope}
/>
Kind-specific extras (the areas a region covers, the groups
inside it) come from `details` and render only when present, so
a partner row simply doesn't have them.
Kind-specific extras (the areas a region covers, its map note)
come from `details` and render only when present, so a partner
row simply doesn't have them.
═══════════════════════════════════════════════════════════════ */
const MUTED = "var(--color-muted)";
@ -88,7 +88,6 @@ function OrgRow({ org, pageLabel, siteLabel }) {
// Region extras. Absent for every other kind, and the JSX below
// skips them rather than rendering empty headings.
const areas = areasSentence(org.details?.areas ?? []);
const groupCount = (org.details?.groups ?? []).length;
const note = org.details?.map_note;
/* Collapsed, a row says who it is and nothing else, the areas
@ -124,15 +123,6 @@ function OrgRow({ org, pageLabel, siteLabel }) {
)}
</span>
{groupCount > 0 && (
<span
className="ml-auto text-sm shrink-0"
style={{ color: MUTED }}
title={`${groupCount} group${groupCount > 1 ? "s" : ""}`}
>
{groupCount}
</span>
)}
</button>
<div className="flex items-center gap-2">

View file

@ -80,25 +80,33 @@
padding-block-start: 0.5rem;
}
/* Numeral breaks the rail. */
/* The numeral is a tag on the rail: a dark block with white type,
centered on the line, so the rail runs into it and out again.
(It used to paint the page's color to hide the rail behind it,
which showed as a white box once sections went transparent.) */
.site-tl__decadeNum {
position: relative;
z-index: 1;
margin-left: calc(var(--tl-rail-x) * -1 + 0.125rem);
padding-block: 0.35rem;
background: var(--tl-surface);
justify-self: start;
width: fit-content;
margin-left: calc(var(--tl-rail-x) + (var(--tl-rail-w) / 2));
transform: translateX(-50%);
padding: 0.5rem 0.3rem;
background: var(--color-action);
color: #ffffff;
font-family: var(--font-display);
font-size: 0.9375rem;
font-weight: 650;
font-weight: 700;
font-variant-numeric: tabular-nums;
letter-spacing: 0.01em;
line-height: 1.1;
writing-mode: vertical-rl;
text-orientation: sideways;
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.site-tl__decade--pre .site-tl__decadeNum {
color: var(--tl-faint);
background: var(--color-tint);
color: var(--color-muted);
}
.site-tl__decadeTitle {
@ -132,8 +140,8 @@
align-items: center;
gap: 0.5rem;
padding: 0.375rem 0.75rem;
background: var(--color-tint-soft);
border-left: 3px solid var(--tl-rail);
border-bottom: 3px solid var(--tl-rail);
font-size: 0.8125rem;
color: var(--tl-faint);
}

View file

@ -97,8 +97,8 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
}
// A cell's rules: right and bottom, the outer ones clipped off
// by the wrapper (the grid runs 2px past it).
const cell = 'border-r-2 border-b-2 border-brand'
// by the wrapper (the grid runs 4px past it).
const cell = 'border-r-4 border-b-4 border-brand'
const panelFill = `color-mix(in srgb, ${accent} 12%, var(--color-surface))`
return (
@ -108,7 +108,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
{blurb && <p className="mt-4 max-w-2xl text-lg text-muted">{blurb}</p>}
<div className="mt-12 overflow-hidden">
<div className="-mr-[2px] -mb-[2px]">
<div className="-mr-[4px] -mb-[4px]">
<div
role="tablist"
aria-label={title}