Video stills skip YouTube's gray placeholder; timeline back to teal dots; people rows fill
- A still that fails or comes back as YouTube's 120 x 90 "no thumbnail" image gives way to the next; with none left the player is a flat teal panel with the play button showing. - Timeline: solid teal dots, a solid teal rail and teal decade tags (still on their branch), one color throughout, until a vine or tree drawing replaces them. The leaf colors are gone. - People tiles fill each row with as many as fit (2 to 10), one fewer only when the last row would be a single tile, instead of evening rows out (8 where 6 fit had come out 4 and 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6506f65b1e
commit
57f8020542
11 changed files with 98 additions and 151 deletions
|
|
@ -6,7 +6,6 @@ import {
|
|||
type SortDirection,
|
||||
} from '../../../lib/timeline.ts'
|
||||
import TimelineYear from './TimelineYear.tsx'
|
||||
import { leafColor, readableOn } from '../../../lib/color.ts'
|
||||
|
||||
type Props = {
|
||||
decade: GroupedDecade
|
||||
|
|
@ -32,7 +31,7 @@ export default function TimelineDecade({
|
|||
aria-labelledby={`site-tl-decade-${decade.decade}`}
|
||||
>
|
||||
<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)}
|
||||
</span>
|
||||
<div>
|
||||
|
|
@ -64,11 +63,3 @@ export default function TimelineDecade({
|
|||
</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 type { GroupedYear, SortDirection } from '../../../lib/timeline.ts'
|
||||
import TimelineYear from './TimelineYear.tsx'
|
||||
|
|
@ -42,9 +42,7 @@ export default function TimelineUpcoming({
|
|||
aria-expanded={open}
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
>
|
||||
<span className="site-tl__upcomingLeaf" aria-hidden="true">
|
||||
<Leaf weight="bold" />
|
||||
</span>
|
||||
<span className="site-tl__upcomingDot" aria-hidden="true" />
|
||||
<span className="site-tl__upcomingLabel">
|
||||
{open
|
||||
? 'Hide what’s scheduled'
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
import { Leaf } from '@phosphor-icons/react'
|
||||
import type { CSSProperties } from 'react'
|
||||
import type { GroupedYear } from '../../../lib/timeline.ts'
|
||||
import { leafColor } from '../../../lib/color.ts'
|
||||
import TimelineEntry from './TimelineEntry.tsx'
|
||||
|
||||
/** Each year is a leaf on the rail, its color turning from green to
|
||||
* autumn as the years go back (leafColor), its size growing with
|
||||
* 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`
|
||||
/** A solid teal dot per year, its size growing with the year's
|
||||
* entries so the rail reads as a density chart. (A vine or tree
|
||||
* drawing may replace the dots later.) */
|
||||
function dotSize(count: number): string {
|
||||
return `${(9 + Math.min(count, 14) * 0.6).toFixed(2)}px`
|
||||
}
|
||||
|
||||
type Props = {
|
||||
|
|
@ -42,12 +38,10 @@ export default function TimelineYear({ year, open, onToggle }: Props) {
|
|||
onClick={() => onToggle(year.year)}
|
||||
>
|
||||
<span
|
||||
className="site-tl__leaf"
|
||||
style={{ '--tl-leaf': leafSize(year.count), color: leafColor(year.year) } as CSSProperties}
|
||||
className="site-tl__dot"
|
||||
style={{ '--tl-dot': dotSize(year.count) } as CSSProperties}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<Leaf weight="fill" />
|
||||
</span>
|
||||
/>
|
||||
<span className="site-tl__yearLabel">{year.year}</span>
|
||||
<span className="site-tl__yearCount">
|
||||
{empty ? '-' : `${year.count} ${year.count === 1 ? 'entry' : 'entries'}`}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
--tl-accent: var(--color-link);
|
||||
--tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent);
|
||||
|
||||
/* The rail is a branch: wood brown, the leaves on it. The one other
|
||||
color outside the palette, with the autumn leaves. */
|
||||
--tl-wood: #7a5236;
|
||||
/* The rail: solid teal (mixed toward the page, so it isn't
|
||||
see-through and adapts to dark mode by itself). */
|
||||
--tl-line: color-mix(in srgb, var(--color-brand) 55%, var(--color-surface));
|
||||
|
||||
--tl-gutter: 5rem;
|
||||
--tl-rail-x: 1.75rem;
|
||||
|
|
@ -30,16 +30,6 @@
|
|||
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) {
|
||||
.site-tl {
|
||||
--tl-gutter: 3rem;
|
||||
|
|
@ -63,12 +53,12 @@
|
|||
bottom: 0;
|
||||
left: var(--tl-rail-x);
|
||||
width: var(--tl-rail-w);
|
||||
background: var(--tl-wood);
|
||||
background: var(--tl-line);
|
||||
}
|
||||
|
||||
.site-tl__decade--pre::before {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -96,16 +86,17 @@
|
|||
padding-block-start: 0.5rem;
|
||||
}
|
||||
|
||||
/* The numeral is a tag off the rail, like a branch: a short slanted
|
||||
stroke of the rail's wood runs up from the line to it, and the line
|
||||
carries on past. Its color is the decade's leaves', set inline
|
||||
(TimelineDecade.tsx). */
|
||||
/* The numeral is a solid teal tag off the rail, like a branch: a
|
||||
short slanted stroke runs up from the line to it, and the line
|
||||
carries on past. */
|
||||
.site-tl__decadeNum {
|
||||
position: relative;
|
||||
justify-self: start;
|
||||
width: fit-content;
|
||||
margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch));
|
||||
padding: 0.5rem 0.3rem;
|
||||
background: var(--color-action);
|
||||
color: #ffffff;
|
||||
font-family: var(--font-display);
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 700;
|
||||
|
|
@ -123,7 +114,7 @@
|
|||
right: 100%;
|
||||
width: calc(var(--tl-branch) + 0.2rem);
|
||||
height: 3px;
|
||||
background: var(--tl-wood);
|
||||
background: var(--tl-line);
|
||||
transform-origin: right center;
|
||||
transform: rotate(28deg);
|
||||
}
|
||||
|
|
@ -196,38 +187,29 @@
|
|||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Each year's leaf sits on the rail (TimelineYear.tsx): its color
|
||||
is the year's, set inline, and --tl-leaf, its size, grows with the
|
||||
year's entries. Tilted either way in turn, like leaves on a stem. */
|
||||
.site-tl__leaf {
|
||||
/* A solid teal dot on the rail per year; --tl-dot, its size, is set
|
||||
inline from the year's entry count (TimelineYear.tsx), so the rail
|
||||
reads as the organization's density at a glance. */
|
||||
.site-tl__dot {
|
||||
position: relative;
|
||||
justify-self: start;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
margin-left: calc(var(--tl-rail-x) - (var(--tl-leaf, 16px) / 2) + (var(--tl-rail-w) / 2));
|
||||
width: var(--tl-leaf, 16px);
|
||||
height: var(--tl-leaf, 16px);
|
||||
font-size: var(--tl-leaf, 16px);
|
||||
transform: rotate(-24deg);
|
||||
margin-left: calc(var(--tl-rail-x) - (var(--tl-dot, 10px) / 2) + (var(--tl-rail-w) / 2));
|
||||
width: var(--tl-dot, 10px);
|
||||
height: var(--tl-dot, 10px);
|
||||
border-radius: 50%;
|
||||
background: var(--color-brand);
|
||||
transition: transform 140ms ease;
|
||||
}
|
||||
|
||||
.site-tl__year:nth-child(even) .site-tl__leaf {
|
||||
transform: rotate(24deg) scaleX(-1);
|
||||
.site-tl__yearBtn:hover .site-tl__dot,
|
||||
.site-tl__year--open .site-tl__dot {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
.site-tl__yearBtn:hover .site-tl__leaf,
|
||||
.site-tl__year--open .site-tl__leaf {
|
||||
transform: rotate(-24deg) scale(1.2);
|
||||
}
|
||||
|
||||
.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__year--featured .site-tl__dot {
|
||||
background: var(--color-action);
|
||||
outline: 2px solid var(--color-action);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.site-tl__yearLabel {
|
||||
|
|
@ -503,7 +485,7 @@ a.site-tl__entry--featured:hover {
|
|||
top: 1.25rem;
|
||||
bottom: 0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -532,13 +514,14 @@ a.site-tl__entry--featured:hover {
|
|||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.site-tl__upcomingLeaf {
|
||||
.site-tl__upcomingDot {
|
||||
justify-self: start;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
|
||||
font-size: 14px;
|
||||
color: #008f2f; /* the leaves' green (leafColor) */
|
||||
margin-left: calc(var(--tl-rail-x) - 5px + (var(--tl-rail-w) / 2));
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--color-brand);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.site-tl__upcomingLabel {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
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 { Link } from 'react-router-dom'
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ import HomeLink from './HomeLink.tsx'
|
|||
import { useHistory } from '../../../lib/useHistory.ts'
|
||||
import { hrefFor, logoSrc } from '../../../lib/timelineRefs.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';
|
||||
|
||||
const DRAG_SLOP = 6
|
||||
|
|
@ -220,15 +220,12 @@ function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean })
|
|||
|
||||
return (
|
||||
<div className="flex h-full flex-col">
|
||||
{/* The line, its leaf (colored by the year, as on the History
|
||||
page), and the year where it changes. */}
|
||||
{/* The line, its dot, and the year where it changes. */}
|
||||
<div className="relative mb-4 h-8">
|
||||
<div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-brand/30" />
|
||||
<Leaf
|
||||
weight="fill"
|
||||
<div className="absolute inset-x-[-1.5rem] top-1/2 h-0.5 bg-brand" />
|
||||
<span
|
||||
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))) }}
|
||||
className="absolute left-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full bg-brand"
|
||||
/>
|
||||
{showYear && (
|
||||
<span
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue