
Masked Reveal
FreeCreate stunning word reveals on scroll with GSAP.
Free · Opens the source repo
What Masked Reveal does
Masked Reveal is a skill designed for developers and designers looking to enhance the visual appeal of their web pages through dynamic text animations. This skill leverages GSAP's ScrollTrigger to create staggered word reveals that occur as the user scrolls down the page. By applying an overflow mask, the text is revealed word-by-word, adding a premium feel to headings, hero copy, and section titles. It's particularly useful for projects that already utilize GSAP, allowing for seamless integration without additional dependencies.
The implementation is straightforward, requiring only a few lines of HTML and CSS to set up the masked reveal effect. The skill provides sensible defaults for motion parameters, such as trigger points, duration, and easing, which can be easily customized to fit the specific needs of your project. The JavaScript function handles the splitting of text into individual words, ensuring that spaces are preserved and that the animation is smooth and visually appealing. This makes it an excellent choice for short text blocks that require an engaging entrance as they come into view.
In addition to its aesthetic benefits, Masked Reveal also considers accessibility. The original text is preserved for screen readers, ensuring that all users can access the content. The skill includes provisions for users who prefer reduced motion, displaying static text instead of animations. This thoughtful design makes it a versatile tool for modern web development, suitable for a wide range of applications from marketing sites to personal portfolios.
When to use it
Use Masked Reveal when you want to add a visually appealing effect to headings or short text blocks that enhances user engagement as they scroll.
When not to use it
Avoid using this skill for long paragraphs or text that requires inline markup, as it is intended for short, impactful text reveals.
What you can build with it
Engaging Hero Section
Use Masked Reveal for the main headline of your landing page to create an engaging first impression as users scroll.
Dynamic Section Titles
Implement this skill in section titles to draw attention and provide a cohesive visual experience throughout your site.
Interactive Marketing Campaigns
Incorporate staggered text reveals in marketing materials to enhance user engagement and highlight key messages.
How to install Masked Reveal
View source1. Install with the skills CLI
npx skills add mengto/skills/masked-reveal --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mengtoMasked 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.7sto0.9s. - Stagger:
0.025sto0.045sper word. - Offset:
yPercent: 110to0. - Ease:
power3.outorexpo.out. - Replay: reveal once by default.
HTML
<h1 class="masked-reveal" data-masked-reveal>
Design systems that feel alive from the first scroll.
</h1>
CSS Mask
.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.
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
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.
Frequently asked questions about Masked Reveal
Similar skills
Penpot UI/UX Design
Create professional UI/UX designs in Penpot with ease.
UX Theming
Streamline your VS Code theming process with best practices.
Wireframe
Create low-fidelity UI wireframes in SVG format.
Waitlist Page
Create a clean, focused pre-launch landing page.
Hallmark
Design skill for creating unique, structured UIs.
UI Styling
Create beautiful, accessible user interfaces effortlessly.
