T45d Site · Components: the rail reveals the current story with room, Shift arrows stay the page's

This commit is contained in:
ZacharyZhang-NY committed 2026-10-01 08:38:05 -04:00
1 parent 8444dd3c12
commit 5cc9a302fb
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -20,12 +20,12 @@ export function Story() {
}, [chapter, found]);
useEffect(() => {
document.querySelector('.side [aria-current="page"]')?.scrollIntoView({ block: "nearest" });
document.querySelector('.side li [aria-current="page"]')?.scrollIntoView({ block: "nearest" });
}, [page, story]);
useEffect(() => {
const step = (e: KeyboardEvent) => {
if (e.metaKey || e.ctrlKey || e.altKey || typing(e)) return;
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey || typing(e)) return;
const to = e.key === "ArrowLeft" ? prev : e.key === "ArrowRight" ? next : undefined;
if (to) navigate({ to: "/components/$page/$story/", params: { page: to.chapter.slug, story: to.story.slug } });
};