feat: light a chapter when its heading crosses 60% of the viewport

This commit is contained in:
2026-10-11 01:11:09 +03:00
parent 7fa1c08ce8
commit d6045ad2c1
3 changed files with 13 additions and 6 deletions

View File

@@ -20,14 +20,14 @@ const headings: readonly SectionHeadingGeometry[] = [
];
describe("active section selection", () => {
it("places the activation line at a literal 35 percent of the visual viewport", () => {
it("places the activation line at a literal 60 percent of the visual viewport", () => {
expect(
activationLineDocumentY({
scrollY: 200,
visualViewportOffsetTop: 25,
visualViewportHeight: 1000,
}),
).toBe(575);
).toBe(825);
});
it("forces document end within exactly two CSS pixels using current geometry", () => {
@@ -60,7 +60,7 @@ describe("active section selection", () => {
).toBe("start");
});
it("selects the last heading at or above the literal 35 percent activation line", () => {
it("selects the last heading at or above the activation line", () => {
expect(
selectActiveSection({
headings,