StealThis .dev

News — Sticky Article TOC + Progress

A long-read editorial layout for the fictional Harbor Dispatch that pairs a justified, multi-column feature with a sticky table-of-contents rail. The TOC lists every section with a numbered index, highlights the active section as you scroll via IntersectionObserver, and carries its own reading meter and minutes-left note. A thin red progress bar tracks the whole page, TOC clicks smooth-scroll and move focus for accessibility, and a back-to-top button appears once you are well into the story. Built with Playfair Display, Inter and vanilla JS only.

In Lab öffnen
html css vanilla-js
Targets: JS HTML

Code

Sticky Article TOC + Progress

A complete long-form reading view for The Harbor Dispatch, a fictional broadsheet, art-directed in a warm newsprint palette with hairline rules and a single red accent. The main column carries an oversized Playfair Display headline, an italic deck, a byline row and a justified, hyphenated body broken into six labelled sections, complete with a red drop cap on the lead, captioned duotone figures and an oversized serif pull quote.

To the left sits a sticky table-of-contents rail. Each section is listed with a numbered index, and the entry for the section you are currently reading is highlighted with a red marker — driven by an IntersectionObserver that tracks which heading owns the viewport. The rail also holds a slim reading meter scoped to the article and a live note that counts down the minutes left.

Clicking any TOC entry smooth-scrolls to its section and moves keyboard focus there for accessibility, while a thin red progress bar across the top of the page tracks overall scroll depth. A back-to-top button fades in once you are well into the story, and a small toast helper confirms the jump. Everything runs on vanilla JS — no frameworks, no build step, and no network requests beyond the two Google Fonts.

Illustrative UI only — masthead, headlines, bylines, and articles are fictional; not a real news publication.