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 99 additions and 66 deletions
Showing only changes of commit d5428297a4 - Show all commits

View file

@ -12,7 +12,7 @@ const CONTACT = 'info@nextgenerationofunity.org'
export default function ComingSoon({ what }: { what: string }) { export default function ComingSoon({ what }: { what: string }) {
return ( return (
<div className="mx-auto max-w-6xl px-6"> <div className="mx-auto max-w-6xl px-6">
<p className="max-w-xl border border-dashed border-brand/30 bg-surface/60 p-6 text-body"> <p className="notice max-w-xl p-6 text-body">
We’re putting {what} together. In the meantime, ask us at{' '} We’re putting {what} together. In the meantime, ask us at{' '}
<a href={`mailto:${CONTACT}`} className="font-semibold text-link underline underline-offset-2"> <a href={`mailto:${CONTACT}`} className="font-semibold text-link underline underline-offset-2">
{CONTACT} {CONTACT}

View file

@ -187,7 +187,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
<button <button
type="button" type="button"
onClick={() => setShowMap(true)} onClick={() => setShowMap(true)}
className="flex aspect-video w-full flex-col items-center justify-center gap-1 border border-dashed text-sm" className="flex aspect-video w-full flex-col items-center justify-center gap-1 bg-tint-soft text-sm"
style={{ borderColor: `${withAlpha(accent, 33)}`, color: BODY }} style={{ borderColor: `${withAlpha(accent, 33)}`, color: BODY }}
> >
<span className="font-semibold">Show map</span> <span className="font-semibold">Show map</span>

View file

@ -710,7 +710,7 @@ export function Repeater({
))} ))}
{spec.preview && PREVIEWS[spec.preview] && ( {spec.preview && PREVIEWS[spec.preview] && (
<div className="mt-4 border border-dashed border-brand/30 bg-surface p-4"> <div className="notice mt-4 p-4">
<p className="mb-3 text-xs font-semibold uppercase tracking-wider text-muted/70"> <p className="mb-3 text-xs font-semibold uppercase tracking-wider text-muted/70">
Preview Preview
</p> </p>

View file

@ -6,7 +6,7 @@
* reasoning that keeps the map grid config in code. A table for four * reasoning that keeps the map grid config in code. A table for four
* rows that nobody edits is a migration and an admin page for nothing. * rows that nobody edits is a migration and an admin page for nothing.
* *
* `preProgram` is what draws the gap: a dashed rail, hollow year dots, * `preProgram` is what draws the gap: a fainter rail
* and the "before the program" marker. It lives on the decade rather * and the "before the program" marker. It lives on the decade rather
* than being a hardcoded year check, so the gap moves if the founding * than being a hardcoded year check, so the gap moves if the founding
* date is ever revised. * date is ever revised.

View file

@ -208,6 +208,15 @@ 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. */
@utility notice {
background: var(--color-tint-soft);
border-left: 4px solid var(--color-brand);
}
/* Buttons, and links drawn as buttons: Poppins Bold, superellipse /* Buttons, and links drawn as buttons: Poppins Bold, superellipse
corners. Color, size and border stay with each button. */ corners. Color, size and border stay with each button. */
@utility btn { @utility btn {

View file

@ -88,3 +88,25 @@ export function paletteFill(name: string): { background: string; color: string }
for (const char of name.trim().toLowerCase()) hash = (hash * 31 + char.charCodeAt(0)) >>> 0 for (const char of name.trim().toLowerCase()) hash = (hash * 31 + char.charCodeAt(0)) >>> 0
return NAMED_FILLS[hash % NAMED_FILLS.length] return NAMED_FILLS[hash % NAMED_FILLS.length]
} }
/* ── Timeline leaves ─────────────────────────────────────────────
Each year on a timeline is a leaf, green for this year and
turning autumn as the years go back: gold, then orange, reaching
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
page; the autumn shades are the one set of colors outside the
palette, since the palette has none. */
const LEAF_GREEN = 'color-mix(in oklch, #00b83d 60%, #00521b)'
const LEAF_GOLD = '#c98a0b'
const LEAF_AUTUMN = '#b8461b'
const LEAF_TURNED_BY = 2000
export function leafColor(year: number, thisYear = new Date().getFullYear()): string {
if (year < LEAF_TURNED_BY) return LEAF_AUTUMN
const span = Math.max(1, thisYear - LEAF_TURNED_BY)
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.
return turned <= 0.5
? `color-mix(in oklch, ${LEAF_GOLD} ${Math.round(turned * 200)}%, ${LEAF_GREEN})`
: `color-mix(in oklch, ${LEAF_AUTUMN} ${Math.round((turned - 0.5) * 200)}%, ${LEAF_GOLD})`
}

View file

@ -413,7 +413,7 @@ export default function FeedbackForm({ fixedType }: { fixedType?: string } = {})
</div> </div>
{/* Optional contact details */} {/* Optional contact details */}
<div className="mt-8 border border-dashed border-muted/30 bg-tint/60 p-5 sm:p-6"> <div className="notice mt-8 p-5 sm:p-6">
<div className="flex flex-wrap items-center"> <div className="flex flex-wrap items-center">
<h3 className="text-base font-bold text-body"> <h3 className="text-base font-bold text-body">
{request ? "How we reach you" : "Your details"} {request ? "How we reach you" : "Your details"}

View file

@ -317,7 +317,7 @@ export default function RequestForm() {
</> </>
)} )}
<div className="mt-8 border border-dashed border-muted/30 bg-tint/60 p-5 sm:p-6"> <div className="notice mt-8 p-5 sm:p-6">
<h3 className="text-base font-bold text-body">How we reach you</h3> <h3 className="text-base font-bold text-body">How we reach you</h3>
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}> <p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
We use these only to follow up on this request, and we won't add you to any list. We use these only to follow up on this request, and we won't add you to any list.

View file

@ -1,4 +1,4 @@
import { CaretDown, CaretUp } from '@phosphor-icons/react' import { CaretDown, CaretUp, Leaf } from '@phosphor-icons/react'
import { useState } from 'react' import { useState } from 'react'
import type { GroupedYear, SortDirection } from '../../../lib/timeline.ts' import type { GroupedYear, SortDirection } from '../../../lib/timeline.ts'
import TimelineYear from './TimelineYear.tsx' import TimelineYear from './TimelineYear.tsx'
@ -42,7 +42,9 @@ export default function TimelineUpcoming({
aria-expanded={open} aria-expanded={open}
onClick={() => setOpen((v) => !v)} onClick={() => setOpen((v) => !v)}
> >
<span className="site-tl__upcomingDot" aria-hidden="true" /> <span className="site-tl__upcomingLeaf" aria-hidden="true">
<Leaf weight="bold" />
</span>
<span className="site-tl__upcomingLabel"> <span className="site-tl__upcomingLabel">
{open {open
? 'Hide what’s scheduled' ? 'Hide what’s scheduled'

View file

@ -1,10 +1,16 @@
import { Leaf } from '@phosphor-icons/react'
import type { CSSProperties } from 'react' import type { CSSProperties } from 'react'
import type { GroupedYear } from '../../../lib/timeline.ts' import type { GroupedYear } from '../../../lib/timeline.ts'
import { leafColor } from '../../../lib/color.ts'
import TimelineEntry from './TimelineEntry.tsx' import TimelineEntry from './TimelineEntry.tsx'
/** Dot diameter scales with volume, so the rail reads as a density chart. */ /** Each year is a leaf on the rail, its color turning from green to
function dotSize(count: number): string { * autumn as the years go back (leafColor), its size growing with
return `${(7 + Math.min(count, 14) * 0.55).toFixed(2)}px` * the year's entries so the rail still reads as a density chart.
* Filled, not the icon set's usual bold outline, so the color
* carries. */
function leafSize(count: number): string {
return `${(14 + Math.min(count, 14) * 0.9).toFixed(2)}px`
} }
type Props = { type Props = {
@ -36,10 +42,12 @@ export default function TimelineYear({ year, open, onToggle }: Props) {
onClick={() => onToggle(year.year)} onClick={() => onToggle(year.year)}
> >
<span <span
className="site-tl__dot" className="site-tl__leaf"
style={{ '--tl-dot': dotSize(year.count) } as CSSProperties} style={{ '--tl-leaf': leafSize(year.count), color: leafColor(year.year) } as CSSProperties}
aria-hidden="true" aria-hidden="true"
/> >
<Leaf weight="fill" />
</span>
<span className="site-tl__yearLabel">{year.year}</span> <span className="site-tl__yearLabel">{year.year}</span>
<span className="site-tl__yearCount"> <span className="site-tl__yearCount">
{empty ? '-' : `${year.count} ${year.count === 1 ? 'entry' : 'entries'}`} {empty ? '-' : `${year.count} ${year.count === 1 ? 'entry' : 'entries'}`}

View file

@ -52,8 +52,8 @@
.site-tl__decade--pre::before { .site-tl__decade--pre::before {
background: none; background: none;
border-left: var(--tl-rail-w) dashed var(--tl-rail); border-left: var(--tl-rail-w) solid var(--tl-rail);
opacity: 0.7; opacity: 0.35;
} }
/* Last decade fades out rather than stopping dead. */ /* Last decade fades out rather than stopping dead. */
@ -132,7 +132,8 @@
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
padding: 0.375rem 0.75rem; padding: 0.375rem 0.75rem;
border: 1px dashed var(--tl-rail); background: var(--color-tint-soft);
border-left: 3px solid var(--tl-rail);
font-size: 0.8125rem; font-size: 0.8125rem;
color: var(--tl-faint); color: var(--tl-faint);
} }
@ -168,45 +169,38 @@
outline-offset: 2px; outline-offset: 2px;
} }
/* Dot sits on the rail; --tl-dot is set inline from the year's item count, so /* Each year's leaf sits on the rail (TimelineYear.tsx): its color
scrolling the page gives you the organization's density at a glance. */ is the year's, set inline, and --tl-leaf, its size, grows with the
.site-tl__dot { year's entries. Tilted either way in turn, like leaves on a stem. */
.site-tl__leaf {
position: relative; position: relative;
justify-self: start; justify-self: start;
margin-left: calc(var(--tl-rail-x) - (var(--tl-dot, 8px) / 2) + (var(--tl-rail-w) / 2)); display: grid;
width: var(--tl-dot, 8px); place-items: center;
height: var(--tl-dot, 8px); margin-left: calc(var(--tl-rail-x) - (var(--tl-leaf, 16px) / 2) + (var(--tl-rail-w) / 2));
border-radius: 50%; width: var(--tl-leaf, 16px);
background: var(--tl-rail); height: var(--tl-leaf, 16px);
box-shadow: 0 0 0 4px var(--tl-surface); font-size: var(--tl-leaf, 16px);
transition: background-color 140ms ease, transform 140ms ease; transform: rotate(-24deg);
transition: transform 140ms ease;
} }
.site-tl__yearBtn:hover .site-tl__dot { .site-tl__year:nth-child(even) .site-tl__leaf {
background: var(--tl-accent); transform: rotate(24deg) scaleX(-1);
} }
.site-tl__year--featured .site-tl__dot { .site-tl__yearBtn:hover .site-tl__leaf,
background: var(--tl-accent); .site-tl__year--open .site-tl__leaf {
transform: rotate(-24deg) scale(1.2);
} }
.site-tl__year--featured .site-tl__dot::after { .site-tl__year:nth-child(even) .site-tl__yearBtn:hover .site-tl__leaf,
content: ''; .site-tl__year--open:nth-child(even) .site-tl__leaf {
position: absolute; transform: rotate(24deg) scaleX(-1) scale(1.2);
inset: -5px;
border: 1.5px solid var(--tl-accent);
border-radius: 50%;
opacity: 0.45;
} }
.site-tl__year--open .site-tl__dot { .site-tl__year--featured .site-tl__leaf {
background: var(--tl-accent); font-size: calc(var(--tl-leaf, 16px) * 1.3);
transform: scale(1.15);
}
.site-tl__decade--pre .site-tl__dot {
background: var(--tl-surface);
border: 1.5px solid var(--tl-rail);
} }
.site-tl__yearLabel { .site-tl__yearLabel {
@ -483,7 +477,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) dashed var(--tl-rail); border-left: var(--tl-rail-w) solid var(--tl-rail);
opacity: 0.35;
} }
.site-tl__upcomingBtn { .site-tl__upcomingBtn {
@ -511,14 +506,13 @@ a.site-tl__entry--featured:hover {
outline-offset: 2px; outline-offset: 2px;
} }
.site-tl__upcomingDot { .site-tl__upcomingLeaf {
justify-self: start; justify-self: start;
margin-left: calc(var(--tl-rail-x) - 4px + (var(--tl-rail-w) / 2)); display: grid;
width: 8px; place-items: center;
height: 8px; margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
border-radius: 50%; font-size: 14px;
border: 1.5px dashed var(--tl-accent); color: color-mix(in oklch, #00b83d 60%, #00521b);
box-shadow: 0 0 0 4px var(--tl-surface);
} }
.site-tl__upcomingLabel { .site-tl__upcomingLabel {
@ -541,11 +535,6 @@ a.site-tl__entry--featured:hover {
opacity: 1; opacity: 1;
} }
.site-tl__upcomingList .site-tl__dot {
background: var(--tl-surface);
border: 1.5px dashed var(--tl-accent);
}
@keyframes site-tl-rise { @keyframes site-tl-rise {
from { from {
opacity: 0; opacity: 0;

View file

@ -19,7 +19,7 @@
Nothing featured, and the section doesn't render at all. Nothing featured, and the section doesn't render at all.
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
import { ArrowRight, CaretRight, CaretLeft } from '@phosphor-icons/react'; import { ArrowRight, CaretRight, CaretLeft, Leaf } from '@phosphor-icons/react';
import { useRef, useState, type PointerEvent as ReactPointerEvent } from 'react' import { useRef, useState, type PointerEvent as ReactPointerEvent } from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
@ -27,7 +27,7 @@ import HomeLink from './HomeLink.tsx'
import { useHistory } from '../../../lib/useHistory.ts' import { useHistory } from '../../../lib/useHistory.ts'
import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts' import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts'
import { MONTH_LABELS, type TimelineItem } from '../../../lib/timeline.ts' import { MONTH_LABELS, type TimelineItem } from '../../../lib/timeline.ts'
import { accentText, BRAND } from '../../../lib/color.ts' import { accentText, BRAND, leafColor } from '../../../lib/color.ts'
import { scrollBehavior } from '../../../lib/motion.ts'; import { scrollBehavior } from '../../../lib/motion.ts';
const DRAG_SLOP = 6 const DRAG_SLOP = 6
@ -220,16 +220,19 @@ function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean })
return ( return (
<div className="flex h-full flex-col"> <div className="flex h-full flex-col">
{/* The line, its dot, and the year where it changes. */} {/* The line, its leaf (colored by the year, as on the History
page), and the year where it changes. */}
<div className="relative mb-4 h-8"> <div className="relative mb-4 h-8">
<div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-brand/30" /> <div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-brand/30" />
<span <Leaf
className="absolute left-0 top-1/2 h-3 w-3 -translate-y-1/2 rounded-full border-2 bg-surface" weight="fill"
style={{ borderColor: BRAND }} aria-hidden="true"
className="absolute -left-1 top-1/2 h-5 w-5 -translate-y-1/2 -rotate-12"
style={{ color: leafColor(Number(year(item))) }}
/> />
{showYear && ( {showYear && (
<span <span
className="absolute left-5 top-1/2 -translate-y-1/2 px-3 py-0.5 font-display text-sm font-bold text-white" className="absolute left-6 top-1/2 -translate-y-1/2 px-3 py-0.5 font-display text-sm font-bold text-white"
style={{ background: BRAND }} style={{ background: BRAND }}
> >
{year(item)} {year(item)}