Scroll Effects · Component Template
Scroll Text Reveal
A short manifesto set enormous on a drum of type. Scrolling turns it: the line in front is sharp, the last one tips away over the top, and the next comes up from underneath.
Live demo
Scroll inside the demo to turn the drum of type. Scroll back up to turn it the other way.
The Prompt
Build a scroll-driven text reveal as a drum of type. A short manifesto is set enormous, one line at a time, on the face of an invisible cylinder pinned to the viewport. Scrolling turns the drum: the line in front is sharp and black, the line that just left tilts away over the top, blurred and faint, and the next one comes up from underneath. Two cogs in the corners turn with the same scroll and a hairline meter fills. All of it is CSS: the motion is bound to a named scroll timeline, with no scroll listener in browsers that support it. It is for Mend, a free repair café. Match my project's existing stack, conventions, and design tokens. If there are none, output a single HTML file with inline CSS and JavaScript and zero dependencies.
LOOK
- One loud color and one ink: page #FFC21A, type #15120A. The closing section inverts them.
- ui-sans-serif, system-ui. Drum type at clamp(34px, 9.6vw, 190px), weight 800, letter-spacing -0.06em, line-height 1, centered, never wrapping. On phones 11.4vw.
- One or two words per line may be "hollow": filled with the page color and outlined in ink (-webkit-text-stroke 0.025em, paint-order stroke fill).
- Fixed header: "Mend" in 22px weight 800 and an ink pill "Find us". Film grain at 9%.
STRUCTURE
- A section whose height is (number of lines x 78vh) + 100vh, with view-timeline: --read block. Inside it, a stage that is position: sticky, top 0, 100svh, perspective 900px, content centered.
- The drum is an ordered list, 1.1em tall, transform-style: preserve-3d. Every list item is absolutely positioned on top of the others and carries its index in a custom property --i. The first item wraps the h1.
- Eight lines: "We fix things." / "Toasters. Zippers." / "Radios. Bicycles." / "The lamp your" / "grandmother left." / "No appointment." / "No charge." / "Bring it Tuesday."
- After the story, a dark section with a heading ("Tuesdays and Thursdays, six to nine."), a three-row definition list (Where, Bring, Costs) and a pill "Volunteer as a fixer".
THE DRUM
- Each line has transform-origin: 50% 50% -1.45em, an axis well behind the text, so rotateX swings it up and over like a label on a roller. backface-visibility: hidden.
- One set of keyframes, "roll": 0% rotateX(-104deg), opacity 0, blur 9px. 25% rotateX(-52deg), opacity 0.2, blur 5px. 50% no transform, opacity 1, no blur. 75% and 100% mirror the first two with positive angles.
- Each line plays those keyframes over its own slice of the timeline: animation-timeline: --read; animation-range: contain calc((var(--i) - 2) * var(--seg)) contain calc((var(--i) + 2) * var(--seg)), where --seg is 100% divided by (lines - 1). So line i is exactly in front at progress i x seg, its neighbors sit at plus and minus 52 degrees, and the ones beyond are out of sight. Negative and over-100% offsets are intentional.
- The "contain" range of a view timeline on a subject taller than the viewport runs from the moment its top reaches the top of the viewport to the moment its bottom reaches the bottom: exactly the time the stage is pinned.
- The first line uses a variant that holds the front pose for its first half, and the last line one that holds it for its second half, so the story opens and closes on a settled line.
THE REST OF THE STAGE
- Two cogs, drawn with masks only: a disc cut by a repeating-conic-gradient (15 degree teeth) and a radial gradient for the hub and rim. One large, bottom right, hanging off the corner at 12% opacity; one small, top left, turning the other way. They rotate 420 degrees across the same timeline.
- A 3px meter along the bottom whose fill scales from 0 to 1 across the timeline.
- A hint, "Scroll. It only turns when you do.", which fades out over the first 8%.
FALLBACK WITHOUT SCROLL TIMELINES
- Inside @supports not (animation-timeline: scroll()), run the same keyframes as 1s, linear, paused animations and scrub them with a negative delay: animation-delay: calc(clamp(0, (var(--p) * (var(--n) - 1) - var(--i) + 2) / 4, 1) * -1s). The cogs and meter use calc(var(--p) * -1s).
- Only in that case does script run: one passive scroll listener that writes the section's progress, 0 to 1, into --p. Check with CSS.supports before attaching it.
MOTION
- Load: the header sharpens from a blur and settles on a CSS spring. Nothing else moves until the visitor scrolls, and everything runs backwards when they scroll up.
- Smooth scrolling for the in-page link.
ACCESSIBILITY
- The story is a labeled section and the lines are an ordered list in reading order, so a screen reader hears the manifesto straight through. The cogs, meter and hint are aria-hidden.
- prefers-reduced-motion: no pinning, no 3D and no animation. The lines become a normal stacked list of large text that wraps.
- Visible focus rings in ink.
NEVER
- No scroll hijacking, snapping or wheel listeners. Native scroll only.
- No per-letter splitting. Whole lines turn.
- No JavaScript animation loop.
- No second accent color, gradients or shadows.
- No more than one sharp line on screen at a time.
- CopyThe full prompt, one click.
- PasteInto Cursor, Claude Code, or any agent.
- CompareAgainst the live demo above.