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
|
|
@ -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