diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx index 8951eaf..301f7a2 100644 --- a/src/components/PageShell.tsx +++ b/src/components/PageShell.tsx @@ -107,10 +107,14 @@ const circleSize = (box: { width: number; height: number }) => 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 - column's top and left (pt-8, pl-4): the circle centers on that. */ + column's top and left: the circle centers on that. The list sits + at least LIST_TOP down, and lower if its circle needs the room to + start CIRCLE_GAP below the first section line (h-2, 8px), rather + than over it. */ const STICK = "calc(var(--header-h, 5rem) + 1rem)"; const LIST_TOP = 32; const LIST_LEFT = 16; +const CIRCLE_GAP = 8 + 4; /* How far left of the list's center the circle sits. */ const CIRCLE_SHIFT = 24; @@ -137,6 +141,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P return () => ro.disconnect(); }, [sideNav]); const circle = listBox && circleSize(listBox); + const listTop = listBox && circle ? Math.max(LIST_TOP, CIRCLE_GAP + circle / 2 - listBox.height / 2) : LIST_TOP; // The tab's title as the visitor moves around. The first load's // comes from the server (pageMeta.js), which also sets the page's @@ -171,8 +176,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P {sideNav ? (