Skip to content

feat: a reading progress line at the top of each post - #33

Merged
benatespina merged 1 commit into
mainfrom
claude/reading-progress
Nov 9, 2026
Merged

benatespina merged 1 commit into
mainfrom
claude/reading-progress

Conversation

@benatespina

Copy link
Copy Markdown
Member

A thin line at the top of the view that grows as the post is read, the usual cue for how much is left.

How. A CSS scroll-driven animation: the article is a view timeline (view-timeline: --post), and a 2px --accent line, fixed at the top, scales on X from contain 0% (the article's top at the top of the view) to contain 100% (its end at the bottom). No JavaScript and no scroll listener; it animates a transform only, which the compositor handles, so it neither touches the main thread nor delays the LCP (fades and opacity are avoided on purpose). Browsers without animation-timeline show no line, behind @supports.

Checked. In pnpm dev: the line is at scaleX(0) at the top of the post, 0.4 at 40 % of the article and 1 at its end. pnpm check and pnpm build pass; the Lighthouse job in CI measures it.

A 2px ochre line at the top of the view grows from the article's top
reaching the top of the view to its end reaching the bottom. It is a
CSS scroll-driven animation of a transform: no script, no scroll
listener, nothing on the main thread. Browsers without scroll-driven
animations show no line.
@benatespina
benatespina merged commit db5a0c8 into main Nov 9, 2026
3 checks passed
@benatespina
benatespina deleted the claude/reading-progress branch November 9, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant