Page features: directory and blog post tabs, image converter, version names
- Featured event badge: above the event's card from lg up, left out on phones - Version names from the tag (The Region Cards Update) in the site and admin footers - Tools -> Image converter (JPG, PNG, WebP in the browser) and Download as in Media - People directory sections take several tags, a tab each (migration 078) - Tab blocks split a blog post into tabs; contents follow the open tab (migration 079) - The side nav sun fades out as the page scrolls into the footer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a6c66d4607
commit
31afa889d6
28 changed files with 878 additions and 70 deletions
|
|
@ -215,7 +215,12 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
|
||||
// Stuck: the page has scrolled the list up to its place under the
|
||||
// header. The circle then becomes the corner sun (below).
|
||||
// Leaving: the last section is going up past the list, so the list
|
||||
// goes with it into the footer; the sun, far bigger than its sticky
|
||||
// layer, would hang over the footer, so it fades out.
|
||||
const [stuck, setStuck] = useState(false);
|
||||
const [leaving, setLeaving] = useState(false);
|
||||
const listHeight = listBox?.height ?? 0;
|
||||
useEffect(() => {
|
||||
const column = columnRef.current;
|
||||
if (!sideNav || !column) return;
|
||||
|
|
@ -223,7 +228,9 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
const measure = () => {
|
||||
frame = 0;
|
||||
const header = parseFloat(getComputedStyle(column).getPropertyValue("--header-h")) || 80;
|
||||
setStuck(column.getBoundingClientRect().top + listTop <= header + STUCK_TOP + 1);
|
||||
const box = column.getBoundingClientRect();
|
||||
setStuck(box.top + listTop <= header + STUCK_TOP + 1);
|
||||
setLeaving(box.bottom <= header + STUCK_TOP + listHeight + CIRCLE_MARGIN);
|
||||
};
|
||||
const onScroll = () => {
|
||||
if (!frame) frame = requestAnimationFrame(measure);
|
||||
|
|
@ -236,7 +243,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
window.removeEventListener("resize", onScroll);
|
||||
if (frame) cancelAnimationFrame(frame);
|
||||
};
|
||||
}, [sideNav, listTop]);
|
||||
}, [sideNav, listTop, listHeight]);
|
||||
|
||||
// The circle's box, from its layer's top left (which sticks with
|
||||
// the list). At rest: `rest` above. Stuck: a sun in the corner,
|
||||
|
|
@ -314,6 +321,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
<div
|
||||
className="side-nav-circle absolute rounded-full"
|
||||
data-family={circleFamily(activeAccent)}
|
||||
data-leaving={leaving || undefined}
|
||||
style={{
|
||||
width: circleBox.width,
|
||||
height: circleBox.height,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue