Agent skill UI design
Staggered Word Reveal
Refine how text looks and reads in a web interface.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/staggered-word-reveal --skill staggered-word-reveal --agent claude-code --yesCheck this file in your project.claude/skills/staggered-word-reveal/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/staggered-word-reveal --skill staggered-word-revealSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use a short, plain-text heading and a small route-specific initializer. Check how the content language marks word boundaries before choosing a tokenizer.
View operation manualWhat this skill helps with
- Refine how text looks and reads in a web interface.
Good for
- Type and readability
- Publisher
- Meng To
- Runtime
- CSS · IntersectionObserver
- Bundled example
- The bundled page demonstrates line masking. The word splitter and observer are documented in SKILL.md.
- Skill name
staggered-word-reveal- Repository
MengTo/Skills
Common pitfall
Avoid this prompt
Split every paragraph, including text with inline links, and hide it all from the first paint.
Plain-text splitting replaces descendant nodes, and initial CSS hiding can leave text invisible when scripts fail.
Use these steps
- Inspect the demo and target
- Apply the runtime recipe
- Verify the browser behavior
Project walkthrough
Reveal one original headline as it enters the viewport and keep a readable heading in every motion mode.
Reveal one original headline as it enters the viewport and keep a readable heading in every motion mode.
Inspect the demo and target
The bundled page demonstrates line masking. The word splitter and observer are documented in SKILL.md.
Prompt · Step 1Use Staggered Word Reveal on [my below-the-fold reading note headline]. Inspect the original heading semantics and wrapping. Open the installed demo/index.html to see the line-mask reference, then read the HTML, CSS and JavaScript sections of SKILL.md for the actual word-based recipe. Limit this change to one plain-text heading and record its original sentence.Apply the runtime recipe
Reveal one original headline as it enters the viewport and keep a readable heading in every motion mode.
Prompt · Step 2Preserve whitespace with text nodes, give the heading the original sentence as its accessible name, and mark visual word spans aria-hidden. Activate opacity and 20px Y transitions only after the splitter is ready. Use a 0.8s reveal, 0.07s between words, and an IntersectionObserver with threshold 0.2 and bottom root margin -10%. Require intersectionRatio >= 0.2 in the callback and unobserve after the first reveal. Leave the plain heading visible when JavaScript, the observer, or spatial motion is unavailable.Verify the browser behavior
Later words have staggered delays and the headline stays revealed after leaving the viewport.
- Later words have staggered delays and the headline stays revealed after leaving the viewport.
- The plain headline is readable with JavaScript off and in reduced motion.
Prompt · Step 3Reload with the heading below the viewport, then scroll until it reveals. Inspect the second word’s delay and the final opacity of the last word. Scroll out and return to confirm it stays visible. Repeat at a narrow width and with JavaScript disabled and reduced motion enabled in separate runs. Report the heading’s accessible name and confirm there are no duplicate announcements from the word spans.
Implementation lookup
Find the actual behavior in the recipe and check it in your browser.
Tune the documented controlsInputs
- Command or reference
threshold: 0.2 · rootMargin: 0px 0px -10% 0px · 20px · 0.8s · 0.07s- Examples
- Later words have staggered delays and the headline stays revealed after leaving the viewport.
Check the fallback and lifecycleVerify
- Command or reference
Reload and recheck- Examples
- The plain headline is readable with JavaScript off and in reduced motion.
FAQ
Will splitting on whitespace animate Chinese text word by word?
The sample splitter recognizes whitespace boundaries. Use author-marked chunks for scripts that typically omit spaces, and retain the unsplit sentence as the heading’s accessible name.
What does the installed demo include?
The bundled page demonstrates line masking. The word splitter and observer are documented in SKILL.md.