Scroll Scrubbed Word Reveal
Meng ToCommunityCreated by Meng To
- Skill
- Guidelines
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a robust methodology for creating scroll-scrubbed text reveal effects. Unlike typewriter simulations, this approach focuses on pacing reader comprehension by mapping scroll progress to individual word visibility. It emphasizes maintaining the original DOM structure, preserving semantic markup like links and emphasis, and ensuring responsive behavior across different viewports. The workflow covers text node processing, scroll-to-word mapping, CSS custom property integration, and accessibility considerations including reduced-motion support.
What it does
- Splits text into individual word spans while preserving original semantic tags and inline styles.
- Maps scroll progress to word visibility using CSS custom properties for smooth interpolation.
- Ensures responsive text wrapping by avoiding fixed-line or character-based calculations.
- Implements accessibility best practices including screen-reader compatibility and reduced-motion overrides.
- Provides a cleanup routine to restore the original DOM state upon component unmount or route change.
- Supports integration with scroll-based animation libraries or standalone requestAnimationFrame loops.
When to use it
- When building editorial passages, manifestos, or product statements that require paced reading.
- When you need to enhance engagement without sacrificing the accessibility of the underlying text.
- When creating scroll-based storytelling experiences that must remain readable on various screen sizes.
- When you need to ensure that text remains functional and readable even if JavaScript fails to load.
Advantages
- Maintains full semantic integrity of the text including links and emphasis.
- Adapts naturally to responsive layouts and font size changes without layout shifts.
- Respects user system preferences for reduced motion.
- Ensures the content remains accessible to screen readers and search engines.
- Provides a clean, non-destructive way to animate text content.
Usage examples
- “Implement a scroll-scrubbed reveal for a hero section paragraph.”
- The agent will guide you through using TreeWalker to wrap words in spans, setting up the scroll-to-progress mapping, and applying the CSS variables for opacity and blur.
- “How do I ensure my scroll-reveal text is accessible?”
- The agent will explain how to keep the original text accessible, use aria-hidden for the animated spans, and implement a prefers-reduced-motion media query to disable animations.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/mengto/scroll-scrubbed-word-reveal/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip scroll-scrubbed-word-reveal.zip -d .agents/skills
Documentation by Meng To
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
Keep one untouched accessible text source in the DOM.
Walk text nodes with
TreeWalker; do not flatten the container withtextContentorinnerHTML.Skip
script,style, form controls, and elements marked with[data-no-split].Replace only non-whitespace tokens with spans and preserve whitespace nodes exactly.
Mark generated spans
aria-hidden="true"only when an equivalent unsplit accessible copy remains available.
Preferred structure:
<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:
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.3Blur:
4–10pxVertical offset:
0.08–0.22emReveal span:
120–220%of the viewport for a paragraphDirect 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 as the working reference and demo/PROMPT.md to recreate or remix it. Keep REFERENCES.md as the links-only implementation source list.
Files
- ATTRIBUTION.mdAdded by AutoGineer876 B
- LICENSELicence file added by AutoGineer1.0 KiB
- REFERENCES.md491 B
- SKILL.md4.0 KiB
- agents/openai.yaml258 B
- demo/PROMPT.md1.7 KiB
- demo/index.html7.4 KiB
- demo/preview.jpg89.8 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Meng To
- Publisher
- Meng To (Community)
- Source
- MengTo/Skills · agent-skills/web-design/scroll-scrubbed-word-reveal · commit 5ea1661
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Meng To or Meng To.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download scroll-scrubbed-word-reveal.zip