Design overhaul (v1.10.0 to v1.10.2) #18
11 changed files with 98 additions and 151 deletions
|
|
@ -278,7 +278,6 @@ 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` | |
|
||||||
|
|
|
||||||
|
|
@ -53,9 +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,
|
* Rows fill (balancedColumns): as many tiles across as fit, never
|
||||||
* but never fewer than 2 or more than 10, and spread so the last
|
* fewer than 2 or more than 10, one fewer when that would leave a
|
||||||
* row isn't a lone tile. When 2 don't fit at full size they shrink.
|
* lone tile on the last row. 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
|
||||||
|
|
@ -834,16 +835,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), then evened out so the rows come
|
(never more than there are). If that would leave one tile alone on
|
||||||
out as close to equal as they can: 5 tiles that fit 4 across go
|
the last row, one fewer across, so the last row has two: 7 that fit
|
||||||
3 and 2, not 4 and 1. If one tile would still be left alone (3
|
6 across go 5 and 2. With only 2 across, a third, narrower column
|
||||||
where only 2 fit), one more, narrower, column takes it. */
|
takes the odd one instead (3 tiles on a phone go 3 across). */
|
||||||
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 most = Math.min(count, 10, Math.max(2, fit));
|
const cols = Math.min(count, 10, Math.max(2, fit));
|
||||||
const cols = Math.ceil(count / Math.ceil(count / most));
|
if (count % cols !== 1) return cols;
|
||||||
return count % cols === 1 && cols < Math.min(count, 10) ? cols + 1 : cols;
|
return cols > 2 ? cols - 1 : Math.min(count, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,10 @@
|
||||||
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), else a plain
|
(its 16:9 one, falling back to the 4:3 one cropped). Any still
|
||||||
dark panel. The play button shows on hover or keyboard focus, and
|
that fails, or comes back as YouTube's gray "no thumbnail"
|
||||||
|
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
|
||||||
|
|
@ -18,7 +20,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, videoThumbnail } from '../lib/embeds.ts'
|
import { playingSource, videoSource, videoThumbnails } from '../lib/embeds.ts'
|
||||||
import { BRAND } from '../lib/color.ts'
|
import { BRAND } from '../lib/color.ts'
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,6 +37,7 @@ 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) {
|
||||||
|
|
@ -52,24 +55,36 @@ export default function VideoPlayer({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const image = still ?? videoThumbnail(url)
|
const stills = [...(still ? [still] : []), ...videoThumbnails(url)]
|
||||||
|
const image = stills[skipped] ?? null
|
||||||
|
const next = () => setSkipped((n) => n + 1)
|
||||||
|
|
||||||
// YouTube's 16:9 still is missing for some videos; its 4:3 one never is.
|
// YouTube's placeholder for a missing still is a real 120 x 90 image,
|
||||||
const fallBack = (event: SyntheticEvent<HTMLImageElement>) => {
|
// not an error, so it's caught by its size; wherever it came from,
|
||||||
|
// 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.src.endsWith('/hq720.jpg')) img.src = img.src.replace(/hq720\.jpg$/, 'hqdefault.jpg')
|
if (img.naturalWidth <= 120 && img.naturalHeight <= 90) next()
|
||||||
}
|
}
|
||||||
|
|
||||||
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 src={image} alt="" loading="lazy" onError={fallBack} className="block aspect-video w-full object-cover" />
|
<img
|
||||||
|
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 absolute inset-0 flex items-center justify-center transition-colors group-hover:bg-black/20 group-focus-visible:bg-black/20"
|
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`}
|
||||||
>
|
>
|
||||||
<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" />
|
||||||
|
|
|
||||||
|
|
@ -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 > span {
|
.video-play:not(.video-play--always) > span {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 160ms ease, transform 160ms ease;
|
transition: opacity 160ms ease, transform 160ms ease;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,37 +88,3 @@ 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)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -127,15 +127,18 @@ 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 videoThumbnail(raw?: string | null): string | null {
|
export function videoThumbnails(raw?: string | null): string[] {
|
||||||
if (!raw) return null
|
if (!raw) return []
|
||||||
try {
|
try {
|
||||||
const id = youtubeId(new URL(raw.trim()))
|
const id = youtubeId(new URL(raw.trim()))
|
||||||
// hq720 is a 16:9 frame; hqdefault (every video has one) is 4:3
|
if (!id) return []
|
||||||
// with black bars baked in, so it's only the fallback (VideoPlayer
|
// hq720 is a 16:9 frame but some videos lack it; hqdefault is 4:3
|
||||||
// swaps to it if hq720 is missing, and crops it to 16:9).
|
// with black bars baked in (VideoPlayer crops them). A private or
|
||||||
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hq720.jpg` : null
|
// removed video has neither, and YouTube answers with a gray
|
||||||
|
// 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 null
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ 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
|
||||||
|
|
@ -32,7 +31,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" style={decadeColors(decade.decade)} aria-hidden="true">
|
<span className="site-tl__decadeNum" aria-hidden="true">
|
||||||
{decadeLabel(decade.decade)}
|
{decadeLabel(decade.decade)}
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -64,11 +63,3 @@ 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) }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { CaretDown, CaretUp, Leaf } from '@phosphor-icons/react'
|
import { CaretDown, CaretUp } 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,9 +42,7 @@ export default function TimelineUpcoming({
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
onClick={() => setOpen((v) => !v)}
|
onClick={() => setOpen((v) => !v)}
|
||||||
>
|
>
|
||||||
<span className="site-tl__upcomingLeaf" aria-hidden="true">
|
<span className="site-tl__upcomingDot" 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'
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,12 @@
|
||||||
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'
|
||||||
|
|
||||||
/** Each year is a leaf on the rail, its color turning from green to
|
/** A solid teal dot per year, its size growing with the year's
|
||||||
* autumn as the years go back (leafColor), its size growing with
|
* entries so the rail reads as a density chart. (A vine or tree
|
||||||
* the year's entries so the rail still reads as a density chart.
|
* drawing may replace the dots later.) */
|
||||||
* Filled, not the icon set's usual bold outline, so the color
|
function dotSize(count: number): string {
|
||||||
* carries. */
|
return `${(9 + Math.min(count, 14) * 0.6).toFixed(2)}px`
|
||||||
function leafSize(count: number): string {
|
|
||||||
return `${(14 + Math.min(count, 14) * 0.9).toFixed(2)}px`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
@ -42,12 +38,10 @@ export default function TimelineYear({ year, open, onToggle }: Props) {
|
||||||
onClick={() => onToggle(year.year)}
|
onClick={() => onToggle(year.year)}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="site-tl__leaf"
|
className="site-tl__dot"
|
||||||
style={{ '--tl-leaf': leafSize(year.count), color: leafColor(year.year) } as CSSProperties}
|
style={{ '--tl-dot': dotSize(year.count) } 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'}`}
|
||||||
|
|
|
||||||
|
|
@ -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 is a branch: wood brown, the leaves on it. The one other
|
/* The rail: solid teal (mixed toward the page, so it isn't
|
||||||
color outside the palette, with the autumn leaves. */
|
see-through and adapts to dark mode by itself). */
|
||||||
--tl-wood: #7a5236;
|
--tl-line: color-mix(in srgb, var(--color-brand) 55%, var(--color-surface));
|
||||||
|
|
||||||
--tl-gutter: 5rem;
|
--tl-gutter: 5rem;
|
||||||
--tl-rail-x: 1.75rem;
|
--tl-rail-x: 1.75rem;
|
||||||
|
|
@ -30,16 +30,6 @@
|
||||||
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;
|
||||||
|
|
@ -63,12 +53,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-wood);
|
background: var(--tl-line);
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-tl__decade--pre::before {
|
.site-tl__decade--pre::before {
|
||||||
background: none;
|
background: none;
|
||||||
border-left: var(--tl-rail-w) solid var(--tl-wood);
|
border-left: var(--tl-rail-w) solid var(--tl-line);
|
||||||
opacity: 0.45;
|
opacity: 0.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,16 +86,17 @@
|
||||||
padding-block-start: 0.5rem;
|
padding-block-start: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The numeral is a tag off the rail, like a branch: a short slanted
|
/* The numeral is a solid teal tag off the rail, like a branch: a
|
||||||
stroke of the rail's wood runs up from the line to it, and the line
|
short slanted stroke runs up from the line to it, and the line
|
||||||
carries on past. Its color is the decade's leaves', set inline
|
carries on past. */
|
||||||
(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;
|
||||||
|
|
@ -123,7 +114,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-wood);
|
background: var(--tl-line);
|
||||||
transform-origin: right center;
|
transform-origin: right center;
|
||||||
transform: rotate(28deg);
|
transform: rotate(28deg);
|
||||||
}
|
}
|
||||||
|
|
@ -196,38 +187,29 @@
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Each year's leaf sits on the rail (TimelineYear.tsx): its color
|
/* A solid teal dot on the rail per year; --tl-dot, its size, is set
|
||||||
is the year's, set inline, and --tl-leaf, its size, grows with the
|
inline from the year's entry count (TimelineYear.tsx), so the rail
|
||||||
year's entries. Tilted either way in turn, like leaves on a stem. */
|
reads as the organization's density at a glance. */
|
||||||
.site-tl__leaf {
|
.site-tl__dot {
|
||||||
position: relative;
|
position: relative;
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
display: grid;
|
margin-left: calc(var(--tl-rail-x) - (var(--tl-dot, 10px) / 2) + (var(--tl-rail-w) / 2));
|
||||||
place-items: center;
|
width: var(--tl-dot, 10px);
|
||||||
margin-left: calc(var(--tl-rail-x) - (var(--tl-leaf, 16px) / 2) + (var(--tl-rail-w) / 2));
|
height: var(--tl-dot, 10px);
|
||||||
width: var(--tl-leaf, 16px);
|
border-radius: 50%;
|
||||||
height: var(--tl-leaf, 16px);
|
background: var(--color-brand);
|
||||||
font-size: var(--tl-leaf, 16px);
|
|
||||||
transform: rotate(-24deg);
|
|
||||||
transition: transform 140ms ease;
|
transition: transform 140ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-tl__year:nth-child(even) .site-tl__leaf {
|
.site-tl__yearBtn:hover .site-tl__dot,
|
||||||
transform: rotate(24deg) scaleX(-1);
|
.site-tl__year--open .site-tl__dot {
|
||||||
|
transform: scale(1.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-tl__yearBtn:hover .site-tl__leaf,
|
.site-tl__year--featured .site-tl__dot {
|
||||||
.site-tl__year--open .site-tl__leaf {
|
background: var(--color-action);
|
||||||
transform: rotate(-24deg) scale(1.2);
|
outline: 2px solid var(--color-action);
|
||||||
}
|
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 {
|
||||||
|
|
@ -503,7 +485,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-wood);
|
border-left: var(--tl-rail-w) solid var(--tl-line);
|
||||||
opacity: 0.45;
|
opacity: 0.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -532,13 +514,14 @@ a.site-tl__entry--featured:hover {
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-tl__upcomingLeaf {
|
.site-tl__upcomingDot {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
display: grid;
|
margin-left: calc(var(--tl-rail-x) - 5px + (var(--tl-rail-w) / 2));
|
||||||
place-items: center;
|
width: 10px;
|
||||||
margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
|
height: 10px;
|
||||||
font-size: 14px;
|
border-radius: 50%;
|
||||||
color: #008f2f; /* the leaves' green (leafColor) */
|
border: 2px solid var(--color-brand);
|
||||||
|
background: var(--color-surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-tl__upcomingLabel {
|
.site-tl__upcomingLabel {
|
||||||
|
|
|
||||||
|
|
@ -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, Leaf } from '@phosphor-icons/react';
|
import { ArrowRight, CaretRight, CaretLeft } 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, leafColor } from '../../../lib/color.ts'
|
import { accentText, BRAND } 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,15 +220,12 @@ 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 leaf (colored by the year, as on the History
|
{/* The line, its dot, and the year where it changes. */}
|
||||||
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-0.5 bg-brand" />
|
||||||
<Leaf
|
<span
|
||||||
weight="fill"
|
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
className="absolute -left-1 top-1/2 h-5 w-5 -translate-y-1/2 -rotate-12"
|
className="absolute left-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full bg-brand"
|
||||||
style={{ color: leafColor(Number(year(item))) }}
|
|
||||||
/>
|
/>
|
||||||
{showYear && (
|
{showYear && (
|
||||||
<span
|
<span
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue