masked-reveal — Claude Code skill: what it does, how to install
This skill reveals words through an overflow mask as text enters the viewport with GSAP ScrollTrigger. Use it for headings, hero copy, and short section intros.
npx skills add MengTo/Skills --skill masked-reveal -a claude-codeWhat masked-reveal does
masked-reveal splits an element’s text into words and wraps each word in an overflow mask. GSAP ScrollTrigger moves the words upward in sequence when the element reaches the viewport. The reveal runs once, while the original text is kept in aria-label for screen readers.
The skill includes CSS for the mask, the splitMaskedReveal and initMaskedReveals JavaScript helpers, plus a React cleanup pattern using useLayoutEffect. Spaces remain intact. The animation needs GSAP with ScrollTrigger.
It checks prefers-reduced-motion and leaves the text static when that setting is enabled. Avoid applying it to long paragraphs or text containing links, buttons, or meaningful inline markup. If font loading affects line wrapping, initialize the effect after the fonts are ready.
What it helps with
- reveal a heading word by word on scroll
- hide words inside masks before GSAP starts
- preserve the full text for screen readers
- respect reduced-motion preferences
- clean up ScrollTrigger on React route changes
Example prompts for the agent
- Apply masked-reveal to the short heading in
Hero.jsxand wire it to GSAP ScrollTrigger. - Split the element marked with
data-masked-revealinto words and reveal them as it enters the viewport. - Adapt masked-reveal for React and clean up the GSAP context when the component unmounts.
How to install masked-reveal
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill masked-reveal -a claude-code2Manually: put the files in place
~/.claude/skills/masked-reveal/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/masked-reveal/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill masked-reveal -a codex2Manually: put the files in place
.agents/skills/masked-reveal/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill masked-reveal -a cursor2Manually: put the files in place
.cursor/skills/masked-reveal/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills masked-reveal2Manually: put the files in place
.github/skills/masked-reveal/SKILL.md1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill masked-reveal -a gemini-cli2Platform CLI
gemini skills install https://github.com/MengTo/Skills --path agent-skills/web-design/masked-revealManually: put the files in place
.devin/skills/masked-reveal/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add MengTo/Skills --skill masked-reveal -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about masked-reveal
How do I install masked-reveal in Claude Code?
Run npx skills add MengTo/Skills --skill masked-reveal -a claude-code, then run npx skills add MengTo/Skills --skill masked-reveal -a claude-code again. The skill file is at ~/.claude/skills/masked-reveal/SKILL.md.
What does masked-reveal do?
It reveals words in sequence through an overflow mask as the text enters the viewport. It uses GSAP and ScrollTrigger, preserves spaces, and stores the original text in aria-label.
What happens when prefers-reduced-motion is enabled?
The animation is skipped and the text stays visible without the vertical movement.
Source text
SKILL.md · MIT
---
name: masked-reveal
description: Create masked staggered word reveals on scroll with GSAP ScrollTrigger. Use when headings, hero copy, section titles, or editorial text should reveal word-by-word through an overflow mask as they enter the viewport.
---
# Masked Reveal
## Use When
- A headline or short text block needs a premium reveal on scroll.
- Words should rise through an invisible mask with a staggered sequence.
- The project already uses GSAP or needs ScrollTrigger-based motion.
## Motion Defaults
- Trigger: start when the text top reaches `82%` of the viewport.
- Duration: `0.7s` to `0.9s`.
- Stagger: `0.025s` to `0.045s` per word.
- Offset: `yPercent: 110` to `0`.
- Ease: `power3.out` or `expo.out`.
- Replay: reveal once by default.
## HTML
```html
<h1 class="masked-reveal" data-masked-reveal>
Design systems that feel alive from the first scroll.
</h1>
```
## CSS Mask
```css
.masked-reveal {
visibility: visible;
}
html.js .masked-reveal[data-masked-reveal] {
visibility: hidden;
}
html.js .masked-reveal.is-split {
visibility: visible;
}
.masked-reveal .word-mask {
display: inline-block;
overflow: hidden;
vertical-align: top;
}
.masked-reveal .word {
display: inline-block;
transform: translateY(110%);
will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
html.js .masked-reveal[data-masked-reveal] {
visibility: visible;
}
.masked-reveal .word {
transform: none;
}
}
```
## GSAP ScrollTrigger
This helper avoids the paid SplitText plugin and keeps spaces intact.
```js
document.documentElement.classList.add("js");
gsap.registerPlugin(ScrollTrigger);
function escapeHTML(value) {
return value
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
function splitMaskedReveal(element) {
if (element.dataset.maskedRevealReady === "true") return;
const text = element.textContent.trim();
element.setAttribute("aria-label", text);
element.innerHTML = text
.split(/(\s+)/)
.map((part) => {
if (!part.trim()) return part;
return `<span class="word-mask" aria-hidden="true"><span class="word">${escapeHTML(part)}</span></span>`;
})
.join("");
element.dataset.maskedRevealReady = "true";
element.classList.add("is-split");
}
function initMaskedReveals(selector = "[data-masked-reveal]") {
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
document.querySelectorAll(selector).forEach((element) => {
splitMaskedReveal(element);
const words = element.querySelectorAll(".word");
gsap.set(element, { autoAlpha: 1 });
gsap.fromTo(
words,
{ yPercent: 110 },
{
yPercent: 0,
duration: 0.8,
ease: "power3.out",
stagger: 0.035,
scrollTrigger: {
trigger: element,
start: "top 82%",
once: true,
},
}
);
});
}
initMaskedReveals();
```
## React Cleanup Pattern
```js
useLayoutEffect(() => {
const ctx = gsap.context(() => {
initMaskedReveals("[data-masked-reveal]");
}, rootRef);
return () => ctx.revert();
}, []);
```
## Taste Rules
- Use on short headlines, labels, and section intros; avoid long paragraphs.
- Keep the vertical offset clean. Do not combine with blur unless the style explicitly calls for it.
- Stagger by word, not letter, for a calmer editorial feel.
- Initialize after fonts are loaded if line wrapping is critical.
- Use `ScrollTrigger.refresh()` after late-loading images or layout shifts.
- Do not split text that contains links, buttons, or meaningful inline markup.
## Quick Checks
- Text is hidden before GSAP initializes, then becomes visible with `autoAlpha: 1`.
- Screen readers get the original full text through `aria-label`.
- Spaces between words are preserved.
- Reduced-motion users see static text.
- ScrollTrigger is cleaned up in SPA routes.
© MengTo · MIT · MengTo/Skills