feat: light a chapter when its heading crosses 60% of the viewport
This commit is contained in:
@@ -73,9 +73,9 @@ test("passive scrolling replaces a stable fragment without stealing focus", asyn
|
||||
if (heading === null) throw new Error("Missing experience heading");
|
||||
const headingDocumentTop =
|
||||
heading.getBoundingClientRect().top + window.scrollY;
|
||||
// Place the heading just beyond the 35% activation line. Scroll offsets
|
||||
// Place the heading just beyond the 60% activation line. Scroll offsets
|
||||
// are integer-rounded in Chromium, so exact boundary equality is brittle.
|
||||
window.scrollTo(0, headingDocumentTop - window.innerHeight * 0.34);
|
||||
window.scrollTo(0, headingDocumentTop - window.innerHeight * 0.59);
|
||||
});
|
||||
|
||||
await expect(page).toHaveURL(`${distUrl}/#experience`, { timeout: 2000 });
|
||||
|
||||
Reference in New Issue
Block a user