Page fixes: v1.10.7 to v1.10.10 #21

Merged
ngu-git-admin merged 17 commits from page-fixes into main 2026-10-01 10:53:41 +01:00
Showing only changes of commit f7b9af7101 - Show all commits

View file

@ -107,13 +107,19 @@ export function Section({ section }: { section: ShellSection }) {
const circleSize = (box: { width: number; height: number }) => const circleSize = (box: { width: number; height: number }) =>
Math.min(Math.max(box.width * 1.5, box.height * 1.1), 22 * 16); Math.min(Math.max(box.width * 1.5, box.height * 1.1), 22 * 16);
/* Where the side nav sticks, and how far its list sits in from the /* How far the list sits in from the column's top and left: the
column's top and left: the circle centers on that. The list sits circle centers on that. LIST_TOP puts "On this page" level with
at least LIST_TOP down, and lower if its circle needs the room to the first section's title: the line (h-2, 8px), the section's
start CIRCLE_GAP below the first section line (h-2, 8px), rather py-20 (80px), then half the difference between the title's 40px
than over it. */ line (md:text-4xl) and the heading's 16px one. Lower still if its
const STICK = "calc(var(--header-h, 5rem) + 1rem)"; circle needs the room to start CIRCLE_GAP below that first line
const LIST_TOP = 32; rather than over it.
The nav sticks STUCK_TOP below the header, as it always has; its
sticky offset takes back whatever the list sits lower than that. */
const LIST_TOP = 8 + 80 + (40 - 16) / 2;
const STUCK_TOP = 32;
const stickAt = (listTop: number) => `calc(var(--header-h, 5rem) + 1rem + ${STUCK_TOP - listTop}px)`;
const LIST_LEFT = 16; const LIST_LEFT = 16;
const CIRCLE_GAP = 8 + 4; const CIRCLE_GAP = 8 + 4;
@ -209,7 +215,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
the list's layer below starts, and sticks, at the same the list's layer below starts, and sticks, at the same
place. */} place. */}
{listBox && circle ? ( {listBox && circle ? (
<div aria-hidden="true" className="pointer-events-none sticky z-10 h-0" style={{ top: STICK }}> <div aria-hidden="true" className="pointer-events-none sticky z-10 h-0" style={{ top: stickAt(listTop) }}>
<div <div
className="side-nav-circle absolute rounded-full" className="side-nav-circle absolute rounded-full"
data-family={circleFamily(activeAccent)} data-family={circleFamily(activeAccent)}
@ -226,7 +232,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
</div> </div>
) : null} ) : null}
{/* The list, in front of the section lines and its circle. */} {/* The list, in front of the section lines and its circle. */}
<div className="sticky z-10 pl-4 pr-2" style={{ top: STICK, paddingTop: listTop }}> <div className="sticky z-10 pl-4 pr-2" style={{ top: stickAt(listTop), paddingTop: listTop }}>
<div ref={listRef} className="w-fit max-w-full"> <div ref={listRef} className="w-fit max-w-full">
<SectionNav sections={navSections} wrap /> <SectionNav sections={navSections} wrap />
</div> </div>