Compare commits

..

No commits in common. "a2465f9359be665bf6509512ece6d8ad091c3b40" and "2df908f7c4c4c065ba3205670b6aa8c31cf2ed7b" have entirely different histories.

14 changed files with 155 additions and 140 deletions

View file

@ -278,6 +278,7 @@ The numbers band's "Number Source" dropdown works the same way:
| 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 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`. | | 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. |
| 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. |
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | | | Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |

View file

@ -46,13 +46,6 @@
} }
} }
/* The same rise where scroll-driven animations are missing: the
scroll position arrives as --pb-y from PageBackdrop.tsx. */
.page-backdrop[data-parallax="script"] .page-backdrop__circle {
transform: translateY(calc(var(--pb-y, 0px) * var(--pb-speed) * -1));
will-change: transform;
}
@keyframes page-backdrop-rise { @keyframes page-backdrop-rise {
to { to {
transform: translateY(calc(var(--pb-scroll, 0px) * var(--pb-speed) * -1)); transform: translateY(calc(var(--pb-scroll, 0px) * var(--pb-speed) * -1));
@ -60,10 +53,8 @@
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
.page-backdrop__circle, .page-backdrop__circle {
.page-backdrop[data-parallax="script"] .page-backdrop__circle {
animation: none; animation: none;
transform: none;
} }
} }

View file

@ -11,11 +11,8 @@
small and quicker at the front, none as fast as the page itself. small and quicker at the front, none as fast as the page itself.
The rise is a CSS scroll-driven animation (PageBackdrop.css) over The rise is a CSS scroll-driven animation (PageBackdrop.css) over
--pb-scroll, the page's scrollable height, which is measured here --pb-scroll, the page's scrollable height, which is measured here
whenever the page changes size. Browsers without scroll-driven whenever the page changes size (no scroll listener). Without
animations (Firefox, for now) get the same motion from a passive scroll-driven animations, or under reduced motion, they stay put.
scroll handler instead, which writes the scroll position to one
CSS variable, --pb-y, at most once a frame; the CSS does the rest.
Under reduced motion they stay put either way.
Each page gets its own arrangement: sizes and places come from a Each page gets its own arrangement: sizes and places come from a
generator seeded with the path, so a page looks the same every generator seeded with the path, so a page looks the same every
@ -98,32 +95,6 @@ export default function PageBackdrop() {
return () => observer.disconnect() return () => observer.disconnect()
}, []) }, [])
// Where scroll-driven animations are missing: the scroll position,
// once a frame at most, into --pb-y (PageBackdrop.css moves each
// layer by its share of it).
useEffect(() => {
const backdrop = ref.current
if (!backdrop || CSS.supports('animation-timeline: scroll()')) return undefined
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined
backdrop.dataset.parallax = 'script'
let frame = 0
const update = () => {
frame = 0
backdrop.style.setProperty('--pb-y', `${window.scrollY}px`)
}
const onScroll = () => {
if (!frame) frame = requestAnimationFrame(update)
}
update()
window.addEventListener('scroll', onScroll, { passive: true })
return () => {
window.removeEventListener('scroll', onScroll)
cancelAnimationFrame(frame)
delete backdrop.dataset.parallax
}
}, [])
// A new top-level section reaching the window's middle moves the tone on. // 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')

View file

@ -53,10 +53,9 @@ 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 fill (balancedColumns): as many tiles across as fit, never * Rows are balanced (balancedColumns): as many tiles across as fit,
* fewer than 2 or more than 10, one fewer when that would leave a * but never fewer than 2 or more than 10, and spread so the last
* lone tile on the last row. When 2 don't fit at full size they * row isn't a lone tile. When 2 don't fit at full size they shrink.
* 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
@ -835,16 +834,16 @@ function Chevron() {
/* ── Helpers ─────────────────────────────────────────────────── */ /* ── Helpers ─────────────────────────────────────────────────── */
/* Tiles across a row: as many as fit, at least 2 and at most 10 /* Tiles across a row: as many as fit, at least 2 and at most 10
(never more than there are). If that would leave one tile alone on (never more than there are), then evened out so the rows come
the last row, one fewer across, so the last row has two: 7 that fit out as close to equal as they can: 5 tiles that fit 4 across go
6 across go 5 and 2. With only 2 across, a third, narrower column 3 and 2, not 4 and 1. If one tile would still be left alone (3
takes the odd one instead (3 tiles on a phone go 3 across). */ where only 2 fit), one more, narrower, column takes it. */
export function balancedColumns(count: number, width: number, tile: number, gap: number): number { export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
if (count <= 1) return 1; if (count <= 1) return 1;
const fit = Math.floor((width + gap) / (tile + gap)); const fit = Math.floor((width + gap) / (tile + gap));
const cols = Math.min(count, 10, Math.max(2, fit)); const most = Math.min(count, 10, Math.max(2, fit));
if (count % cols !== 1) return cols; const cols = Math.ceil(count / Math.ceil(count / most));
return cols > 2 ? cols - 1 : Math.min(count, 3); 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

View file

@ -6,10 +6,8 @@
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
(its 16:9 one, falling back to the 4:3 one cropped). Any still (its 16:9 one, falling back to the 4:3 one cropped), else a plain
that fails, or comes back as YouTube's gray "no thumbnail" dark panel. The play button shows on hover or keyboard focus, and
placeholder, gives way to the next; with none left it's a flat
teal panel with the play button always showing. The play button shows on hover or keyboard focus, and
always on a touch screen, which can't hover. Small rounded 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 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
@ -20,7 +18,7 @@ import { Play } from '@phosphor-icons/react'
import { useState, type SyntheticEvent } 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, videoThumbnails } from '../lib/embeds.ts' import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
import { BRAND } from '../lib/color.ts' import { BRAND } from '../lib/color.ts'
@ -37,7 +35,6 @@ export default function VideoPlayer({
className?: string className?: string
}) { }) {
const [playing, setPlaying] = useState(false) const [playing, setPlaying] = useState(false)
const [skipped, setSkipped] = useState(0)
const source = videoSource(url) const source = videoSource(url)
if (playing && source) { if (playing && source) {
@ -55,36 +52,24 @@ export default function VideoPlayer({
) )
} }
const stills = [...(still ? [still] : []), ...videoThumbnails(url)] const image = still ?? videoThumbnail(url)
const image = stills[skipped] ?? null
const next = () => setSkipped((n) => n + 1)
// YouTube's placeholder for a missing still is a real 120 x 90 image, // YouTube's 16:9 still is missing for some videos; its 4:3 one never is.
// not an error, so it's caught by its size; wherever it came from, const fallBack = (event: SyntheticEvent<HTMLImageElement>) => {
// since Fetch preview may have saved one into the library.
const checkLoaded = (event: SyntheticEvent<HTMLImageElement>) => {
const img = event.currentTarget const img = event.currentTarget
if (img.naturalWidth <= 120 && img.naturalHeight <= 90) next() 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}`}> <span className={`relative block overflow-hidden rounded-md ${className}`}>
{image ? ( {image ? (
<img <img src={image} alt="" loading="lazy" onError={fallBack} className="block aspect-video w-full object-cover" />
key={image}
src={image}
alt=""
loading="lazy"
onError={next}
onLoad={checkLoaded}
className="block aspect-video w-full object-cover"
/>
) : ( ) : (
<span className="block aspect-video w-full bg-[#004552]" /> <span className="block aspect-video w-full bg-[#004552]" />
)} )}
<span <span
aria-hidden="true" aria-hidden="true"
className={`video-play ${image ? '' : 'video-play--always'} absolute inset-0 flex items-center justify-center transition-colors group-hover:bg-black/20 group-focus-visible:bg-black/20`} 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 rounded-full bg-white/95 shadow-lg transition-transform group-hover:scale-105"> <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="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" />

View file

@ -243,7 +243,7 @@ iframe[src*="churchcenter"] {
keyboard focus where the device can hover; on a touch screen it keyboard focus where the device can hover; on a touch screen it
always shows, since there is nothing to hover with. */ always shows, since there is nothing to hover with. */
@media (hover: hover) { @media (hover: hover) {
.video-play:not(.video-play--always) > span { .video-play > span {
opacity: 0; opacity: 0;
transition: opacity 160ms ease, transform 160ms ease; transition: opacity 160ms ease, transform 160ms ease;
} }

View file

@ -88,3 +88,37 @@ 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. A hex, so readableOn can
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_AUTUMN = '#b8461b'
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 {
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
? mixHex(LEAF_GREEN, LEAF_GOLD, turned * 2)
: mixHex(LEAF_GOLD, LEAF_AUTUMN, (turned - 0.5) * 2)
}

View file

@ -127,18 +127,15 @@ export function playingSource(source: VideoSource): VideoSource {
/** A still for a video link: YouTube's own thumbnail. Other hosts /** A still for a video link: YouTube's own thumbnail. Other hosts
* need an API call to find theirs, so they return null and the * need an API call to find theirs, so they return null and the
* card uses its uploaded image or a plain panel. */ * card uses its uploaded image or a plain panel. */
export function videoThumbnails(raw?: string | null): string[] { export function videoThumbnail(raw?: string | null): string | null {
if (!raw) return [] if (!raw) return null
try { try {
const id = youtubeId(new URL(raw.trim())) const id = youtubeId(new URL(raw.trim()))
if (!id) return [] // hq720 is a 16:9 frame; hqdefault (every video has one) is 4:3
// hq720 is a 16:9 frame but some videos lack it; hqdefault is 4:3 // with black bars baked in, so it's only the fallback (VideoPlayer
// with black bars baked in (VideoPlayer crops them). A private or // swaps to it if hq720 is missing, and crops it to 16:9).
// removed video has neither, and YouTube answers with a gray return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hq720.jpg` : null
// placeholder instead of an error, which VideoPlayer also skips.
const base = `https://i.ytimg.com/vi/${encodeURIComponent(id)}`
return [`${base}/hq720.jpg`, `${base}/hqdefault.jpg`]
} catch { } catch {
return [] return null
} }
} }

View file

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

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

@ -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,12 +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'
/** A solid teal dot per year, its size growing with the year's /** Each year is a leaf on the rail, its color turning from green to
* entries so the rail reads as a density chart. (A vine or tree * autumn as the years go back (leafColor), its size growing with
* drawing may replace the dots later.) */ * the year's entries so the rail still reads as a density chart.
function dotSize(count: number): string { * Filled, not the icon set's usual bold outline, so the color
return `${(9 + Math.min(count, 14) * 0.6).toFixed(2)}px` * carries. */
function leafSize(count: number): string {
return `${(14 + Math.min(count, 14) * 0.9).toFixed(2)}px`
} }
type Props = { type Props = {
@ -38,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

@ -18,9 +18,9 @@
--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: solid teal (mixed toward the page, so it isn't /* The rail is a branch: wood brown, the leaves on it. The one other
see-through and adapts to dark mode by itself). */ color outside the palette, with the autumn leaves. */
--tl-line: color-mix(in srgb, var(--color-brand) 55%, var(--color-surface)); --tl-wood: #7a5236;
--tl-gutter: 5rem; --tl-gutter: 5rem;
--tl-rail-x: 1.75rem; --tl-rail-x: 1.75rem;
@ -30,6 +30,16 @@
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;
@ -53,12 +63,12 @@
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-line); 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-line); border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.45; opacity: 0.45;
} }
@ -86,17 +96,16 @@
padding-block-start: 0.5rem; padding-block-start: 0.5rem;
} }
/* The numeral is a solid teal tag off the rail, like a branch: a /* The numeral is a tag off the rail, like a branch: a short slanted
short slanted stroke runs up from the line to it, and the line stroke of the rail's wood runs up from the line to it, and the line
carries on past. */ carries on past. Its color is the decade's leaves', set inline
(TimelineDecade.tsx). */
.site-tl__decadeNum { .site-tl__decadeNum {
position: relative; position: relative;
justify-self: start; justify-self: start;
width: fit-content; width: fit-content;
margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch)); margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch));
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;
@ -114,7 +123,7 @@
right: 100%; right: 100%;
width: calc(var(--tl-branch) + 0.2rem); width: calc(var(--tl-branch) + 0.2rem);
height: 3px; height: 3px;
background: var(--tl-line); background: var(--tl-wood);
transform-origin: right center; transform-origin: right center;
transform: rotate(28deg); transform: rotate(28deg);
} }
@ -187,29 +196,38 @@
outline-offset: 2px; outline-offset: 2px;
} }
/* A solid teal dot on the rail per year; --tl-dot, its size, is set /* Each year's leaf sits on the rail (TimelineYear.tsx): its color
inline from the year's entry count (TimelineYear.tsx), so the rail is the year's, set inline, and --tl-leaf, its size, grows with the
reads as the organization's density at a glance. */ year's entries. Tilted either way in turn, like leaves on a stem. */
.site-tl__dot { .site-tl__leaf {
position: relative; position: relative;
justify-self: start; justify-self: start;
margin-left: calc(var(--tl-rail-x) - (var(--tl-dot, 10px) / 2) + (var(--tl-rail-w) / 2)); display: grid;
width: var(--tl-dot, 10px); place-items: center;
height: var(--tl-dot, 10px); 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(--color-brand); height: var(--tl-leaf, 16px);
font-size: var(--tl-leaf, 16px);
transform: rotate(-24deg);
transition: transform 140ms ease; transition: transform 140ms ease;
} }
.site-tl__yearBtn:hover .site-tl__dot, .site-tl__year:nth-child(even) .site-tl__leaf {
.site-tl__year--open .site-tl__dot { transform: rotate(24deg) scaleX(-1);
transform: scale(1.25);
} }
.site-tl__year--featured .site-tl__dot { .site-tl__yearBtn:hover .site-tl__leaf,
background: var(--color-action); .site-tl__year--open .site-tl__leaf {
outline: 2px solid var(--color-action); transform: rotate(-24deg) scale(1.2);
outline-offset: 2px; }
.site-tl__year:nth-child(even) .site-tl__yearBtn:hover .site-tl__leaf,
.site-tl__year--open:nth-child(even) .site-tl__leaf {
transform: rotate(24deg) scaleX(-1) scale(1.2);
}
.site-tl__year--featured .site-tl__leaf {
font-size: calc(var(--tl-leaf, 16px) * 1.3);
} }
.site-tl__yearLabel { .site-tl__yearLabel {
@ -485,7 +503,7 @@ 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-line); border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.45; opacity: 0.45;
} }
@ -514,14 +532,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) - 5px + (var(--tl-rail-w) / 2)); display: grid;
width: 10px; place-items: center;
height: 10px; margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
border-radius: 50%; font-size: 14px;
border: 2px solid var(--color-brand); color: #008f2f; /* the leaves' green (leafColor) */
background: var(--color-surface);
} }
.site-tl__upcomingLabel { .site-tl__upcomingLabel {

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,12 +220,15 @@ 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-0.5 bg-brand" /> <div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-brand/30" />
<span <Leaf
weight="fill"
aria-hidden="true" aria-hidden="true"
className="absolute left-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full bg-brand" 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