Overhaul fixes: vertical parallax backdrop, bracket notices, list-framed people tiles
- Backdrop: two slow circles fixed to the window drift up as the page scrolls (a scroll-driven animation), three sit down the page and travel with their sections; tones still change per section. - Notices are two corner brackets, no box or fill. - People tiles: the frame is the list's, and details open right under the tile, closing on Escape or a click elsewhere. - Featured cards and the connect section: 4px rules; video frames inset from the card edge. - Calendar weekday row is a solid bar; History decade numerals are tags on the rail instead of a white box. - Region and partner buttons say Request; the region list's group count is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8ca3b54b31
commit
f37c093dc0
12 changed files with 228 additions and 81 deletions
|
|
@ -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}`}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue