scroll-scrubbed-word-reveal

Reveal marked-up text word by word as scroll progress advances.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill scroll-scrubbed-word-reveal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scroll-scrubbed-word-reveal
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/scroll-scrubbed-word-reveal
Command: npx skills add https://github.com/MengTo/Skills --skill scroll-scrubbed-word-reveal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Scroll-driven text reveals often break inline markup, rely on fixed line counts, or harm accessibility. This Skill implements a word-by-word scroll reveal that preserves semantic links and emphasis, responsive line wrapping, and reduced-motion readability.

Core Features & Use Cases

  • Semantic text splitting: Walks text nodes with TreeWalker instead of flattening with textContent or innerHTML, keeping links, em, strong, and marks intact.
  • Normalized scroll mapping: Maps one section progress value to per-word opacity, blur, and vertical offset via CSS custom properties, with GSAP ScrollTrigger or a dependency-free requestAnimationFrame loop.
  • Accessibility and cleanup: Honors prefers-reduced-motion, keeps screen-reader output natural, and restores the original DOM on teardown.
  • Use Case: Apply it to an editorial manifesto, product statement, or onboarding passage so readers pace comprehension through scrolling, as in the included standalone demo page.

Quick Start

Use $scroll-scrubbed-word-reveal to make this marked-up passage become readable word by word as the user scrolls.

Frequently Asked Questions about scroll-scrubbed-word-reveal

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reveal text word by word on scroll?

Split text nodes into word spans using TreeWalker, then map a normalized section scroll progress value to each word's opacity, blur, and vertical offset through CSS custom properties. Use GSAP ScrollTrigger with scrub or a requestAnimationFrame scroll loop for the progress measurement.

How to split text for animation without breaking links and emphasis?

Walk text nodes with TreeWalker instead of using textContent or innerHTML, which flatten markup. Replace only non-whitespace tokens with spans while preserving whitespace nodes, so links, em, strong, and marks keep their semantics and styling.

Should I use GSAP ScrollTrigger or vanilla JavaScript for scroll animations?

Use GSAP ScrollTrigger with scrub when you need precise start and end positions, refresh handling, or a shared timeline. Use a dependency-free scroll measurement with requestAnimationFrame for a standalone section, as shown in the included demo.

Does scroll-driven word reveal work with prefers-reduced-motion?

Yes, under prefers-reduced-motion: reduce the implementation shows every word immediately, removes blur and transforms, and removes any pinning. The final text must remain fully readable and meet normal contrast requirements.

Why avoid line-based splitting for scroll text animations?

Line-based splitting breaks when browser line wraps change with container width, language, zoom, or font loading. Word-level splitting keeps wrapping free to reflow responsively, and re-splitting is only needed when the source text itself changes.