Scroll Progress Bar
A thin accent line tracking how much is left to read
Scroll the article
Create a reading scroll progress bar. A 3px bar fixed to the very top of the viewport, in the accent color, that fills from left to right as the user reads: empty at the top of the page (or article), full at the bottom. Implementation: compute progress = scrollTop / (document.documentElement.scrollHeight - window.innerHeight), clamped 0-1, inside a scroll listener registered with { passive: true } and throttled by requestAnimationFrame. Apply it as transform: scaleX(progress) with transform-origin: left center on a full-width bar: scaling a transform is much cheaper than animating width. z-index above the page header, pointer-events: none. Variant: to track just an article rather than the whole page, compute the same ratio from the article element's bounding box instead of the document. Optionally add a small percentage label at the article's end. This is a progress indicator, not decoration: no transition on the scaleX, it must track the scroll position exactly. Build the component, not this demo of it. - Ambient motion that IS the component may loop: a drifting background, a marquee, a spinner while something is genuinely loading. - Do not add any timer, interval, loop or script that performs a person's action by itself. No auto-hover, no auto-click, no cycling through states, no pretend submitting, no replaying the interaction on a schedule. - Every state that answers a person waits for a real event from that person. - Placeholder copy and sample content are welcome. Simulated behaviour is not.