Skip to main content
skill CX Codex

scroll-scrubbed-word-reveal — Claude Code skill: reveal text on scroll

A skill that reveals words in marked-up text as scroll progress advances. Built for headlines, quotes and onboarding copy.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-code
Open on GitHub

What scroll-scrubbed-word-reveal does

The skill takes text already in the DOM and splits it into word spans. Section progress becomes a --word-progress value per word, and hidden opacity, blur and vertical offset are interpolated from it. The visible state stays identical to normal typography, so browser line wrapping remains free to change with container width, language, zoom and font loading.

Inline markup survives: links, strong, em and accent spans keep their semantics and styling. Text nodes are walked with TreeWalker rather than flattened through textContent or innerHTML. Generated spans get aria-hidden="true" only when an equivalent unsplit accessible copy stays in the DOM. Under prefers-reduced-motion: reduce every word shows immediately, with blur, transforms and pinning removed.

GSAP ScrollTrigger with scrub is the suggestion when you need precise starts, ends or a shared timeline; a dependency-free scroll measurement plus requestAnimationFrame covers a standalone section. Hidden opacity runs from 0.12 to 0.3, blur from 4px to 10px. On unmount you have to kill ScrollTriggers, remove scroll and resize listeners, cancel animation frames and restore the original subtree — skip that and stale spans stay in the DOM after a route change.

What it helps with

  • reveal a headline as the reader scrolls without swapping out real text
  • keep working links and italics inside an animated paragraph
  • survive line wrapping changes from width, zoom and font loading
  • turn the effect off for readers who asked for reduced motion
  • restore the original DOM when the component unmounts

Example prompts for the agent

  • Build a scroll-scrubbed-word-reveal section for the manifesto headline
  • Split this paragraph into words on scroll, leave links and em alone
  • Add prefers-reduced-motion: reduce so every word shows at once

How to install scroll-scrubbed-word-reveal

1Skills CLI (Vercel)

npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-code

2Manually: put the files in place

~/.claude/skills/scroll-scrubbed-word-reveal/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scroll-scrubbed-word-reveal/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about scroll-scrubbed-word-reveal

How do I install scroll-scrubbed-word-reveal in Claude?

Run npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-code. The skill file then sits at ~/.claude/skills/scroll-scrubbed-word-reveal/SKILL.md.

What does scroll-scrubbed-word-reveal do?

It reveals words in marked-up text as scroll progress advances: section progress sets --word-progress, which drives opacity, blur and offset. Links, strong and em keep their semantics.

Do I need GSAP for this skill?

No. GSAP ScrollTrigger with scrub is suggested when you need precise starts, ends or a shared timeline. A standalone section works with scroll measurement and requestAnimationFrame.

Source text

SKILL.md · MIT
---
name: scroll-scrubbed-word-reveal
description: Reveal marked-up text word by word as scroll progress advances, while preserving semantic inline links, emphasis, responsive line wrapping, and reduced-motion readability. Use for headlines, quotes, manifestos, product statements, onboarding messages, or editorial passages where scrolling should pace comprehension rather than simulate typing.
---

# Scroll-Scrubbed Word Reveal

Make reading progress visible without replacing real text, breaking inline markup, or depending on a fixed line count.

## Prepare the text

1. Keep one untouched accessible text source in the DOM.
2. Walk text nodes with `TreeWalker`; do not flatten the container with `textContent` or `innerHTML`.
3. Skip `script`, `style`, form controls, and elements marked with `[data-no-split]`.
4. Replace only non-whitespace tokens with spans and preserve whitespace nodes exactly.
5. Mark generated spans `aria-hidden="true"` only when an equivalent unsplit accessible copy remains available.

Preferred structure:

```html
<p class="reveal" data-reveal>
  Motion should <em>explain</em> the next state, not decorate it.
</p>
```

Avoid line-based splitting. Browser line wraps must remain free to change with container width, language, zoom, and font loading.

## Map scroll to words

Use section progress as the single source of truth:

```js
const reveal = Math.min(1, Math.max(0, progress));
const local = Math.min(1, Math.max(0, reveal * wordCount - index));
word.style.setProperty("--word-progress", local);
```

Interpolate hidden opacity, blur, and vertical offset from `--word-progress`. Keep the visible state identical to normal typography.

Use GSAP ScrollTrigger with `scrub` when precise starts, ends, refresh, or a shared timeline is needed. Use a dependency-free scroll measurement plus `requestAnimationFrame` for a standalone section.

## Set useful defaults

- Hidden opacity: `0.12–0.3`
- Blur: `4–10px`
- Vertical offset: `0.08–0.22em`
- Reveal span: `120–220%` of the viewport for a paragraph
- Direct word overlap: `10–30%`
- Easing: none for the scroll mapping; ease only the visual interpolation when needed

Expose the values as CSS custom properties. Scale the scroll span from text length rather than assuming one duration fits every passage.

## Preserve emphasis

- Let links, `strong`, `em`, marks, and accent spans keep their semantics and styling.
- Use inherited color by default; style accents on the original element, not on token indexes.
- Do not reveal essential links only on hover or after the reader has passed them.
- Re-split only when the source text changes. Responsive wrapping does not require rebuilding tokens.
- Store enough state to restore the original DOM during cleanup.

## Keep it readable

- Use real document flow; pin only when the copy and evidence justify a short deliberate reading beat.
- Do not use a typewriter cursor, random delays, or autoplay unless explicitly requested.
- Under `prefers-reduced-motion: reduce`, show every word immediately, remove blur and transforms, and remove any pinning.
- Keep screen-reader output natural and avoid announcing each word.
- Verify contrast in both the hidden and final states; hidden words may be quiet but the final text must meet the normal reading contract.

## Clean up

Kill ScrollTriggers, remove scroll and resize listeners, cancel animation frames, and restore the original marked-up subtree on route change or component unmount. Refresh measurements after fonts load if start or end positions depend on text geometry.

## Verify

Test inline links and emphasis, punctuation, repeated spaces, long words, 200% zoom, 390/768/1440 widths, content changes, forward and reverse scrolling, reduced motion, keyboard focus, screen-reader reading order, and teardown. The final DOM must still communicate the complete sentence with JavaScript disabled.

Use [demo/index.html](demo/index.html) as the working reference and [demo/PROMPT.md](demo/PROMPT.md) to recreate or remix it. Keep [REFERENCES.md](REFERENCES.md) as the links-only implementation source list.

© MengTo · MIT · MengTo/Skills

Similar skills

Everything for Frontend and UI →

From the same set148

blue-laser-clean-glass-layout A design-system skill for dark interfaces: a thin blue laser behind the page, frosted glass shells and a tidy dashboard frame. CX Codex +1 1,400installs aura-asset-images This skill searches the Aura Assets library by tag and returns direct links to 5 image candidates for mockups and landing pages. CX Codex +1 1,400installs high-contrast-skeuomorphic-clean Defines rules for building high-contrast, tactile dark interfaces with molded panels and restrained accents. Useful when designing industrial UI systems. CX Codex +1 1,400installs split-layout-technical Shapes a technical split-screen interface with framed panels, mono metadata and restrained type. Use it when visual content and supporting information need distinct areas. CX Codex +1 1,400installs technical-wireframe-info-layout Defines a monochrome design system with exploded wireframe 3D objects, connector lines, and dark diagnostic info layouts. CX Codex +1 1,400installs corner-diagonals A skill for diagonal-cut corners and chamfered edges on buttons, cards and panels. Useful when a UI needs sharp geometry instead of rounded pills. CX Codex +1 1,400installs number-details A skill that adds decorative 01, 02, 03 numbers to process steps, cards and headings. Useful when a section needs visual rhythm without extra copy. CX Codex +1 1,400installs gooey-blob-system Creates gooey blob animations with SVG filters that merge shapes on proximity. Useful for background accents, loaders, or interactive hero areas. CX Codex +1 1,400installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor