Side nav circle takes the color of the section being read

Green and amber sections give it their palette's lightest shade, teal
and deep teal the teal one (the darkest in dark mode), the shades the
nav's text reads on, easing between them as the reader scrolls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-01 03:56:33 -05:00
parent 1db18a8f91
commit 37c555a7b8
3 changed files with 54 additions and 7 deletions

View file

@ -28,7 +28,7 @@ export type EditorSection = {
const ACTIVE_LINE = 140;
function useActiveSection(sections: EditorSection[]) {
export function useActiveSection(sections: EditorSection[]) {
const [active, setActive] = useState<string | null>(sections[0]?.id ?? null);
const ids = sections.map((section) => section.id).join("|");