masked-reveal
यह क्या करती है
यह स्किल एजेंट को ऐसा तैयार पैटर्न देती है, जिसमें पाठक के स्क्रॉल करने पर टेक्स्ट एक अदृश्य मास्क से ऊपर उठता है। यह उन वेब डिज़ाइनरों और डेवलपर्स के लिए है जिनकी साइट पहले से GSAP इस्तेमाल करती है और जिन्हें हेडलाइन का पॉलिश्ड प्रभाव चाहिए।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि पाठक के स्क्रॉल करने पर हीरो हेडलाइन या सेक्शन शीर्षक शब्द-दर-शब्द दिखे।
- ✓जब आपकी साइट पहले से GSAP इस्तेमाल करती है और टेक्स्ट की गति उससे मेल खानी चाहिए।
- ✓जब टेक्स्ट रिवील एक बार चले और गति बंद होने पर भी सामान्य टेक्स्ट दिखे।
Skill का लिंक
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/masked-reveal/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे होमपेज की हेडलाइन लोगों के नीचे स्क्रॉल करने पर GSAP से शब्द-दर-शब्द खुले, ऐसा कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट टेक्स्ट को शब्दों में बाँटता है, हर शब्द को एक छिपे मास्क में लपेटता है, और जब टेक्स्ट स्क्रीन पर तय बिंदु तक पहुँचता है तो उन्हें एक के बाद एक ऊपर ले जाता है। कम मोशन सेटिंग में टेक्स्ट तुरंत दिख जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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.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.
अक्सर पूछे जाने वाले सवाल
क्या इसके लिए कोई पेड प्लगइन चाहिए?
नहीं। स्किल कहती है कि यह पेड SplitText प्लगइन से बचती है और एक छोटे सहायक से विभाजन बनाती है।
क्या शब्दों के बीच की जगह सही रहेगी?
हाँ। सहायक को इस तरह लिखा गया है कि एनिमेट होने वाले शब्दों के बीच की जगह बनी रहे।
क्या हर बार स्क्रॉल करने पर टेक्स्ट एनिमेट होगा?
नहीं। डिफ़ॉल्ट रूप से टेक्स्ट एक बार खुलता है।
जानकारी
लेखक का मूल विवरण
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.
repo: MengTo/Skills
लोकप्रियता
- GitHub स्टार
- 7.2k
- रैंकिंग में स्थान
- #13448
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
3d-cloth-material
7.2kआपके एजेंट को Three.js में असली बुने हुए कपड़े जैसा दिखने वाला मटीरियल बनाने में मदद करती है, जिसमें धागों की बुनाई, हल्की चमक, प्राकृतिक सिलवटें, किनारे और सीवन हों।
3d-falling-leaves
7.2kआपके एजेंट को 3D दृश्य में असली लगने वाली गिरती पत्तियाँ जोड़ने देती है, जो लुढ़कती हैं, हवा के साथ बहती हैं और कैमरा हिलने पर दोबारा इस्तेमाल होती हैं।
3d-four-seasons
7.2kआपके एजेंट को 3D दृश्य में वसंत, गर्मी, शरद और सर्दी के रूप जोड़ने देती है, जिसमें हरियाली, रोशनी, आसमान और बर्फ़ बिना दृश्य दोबारा बनाए बदलते हैं।
3d-high-poly-models
7.2kआपके एजेंट को चिकने आकार और विश्वसनीय किनारों वाले विस्तृत 3D मॉडल बनाने देती है, और फिर वेब पर अच्छे चलने वाले हल्के संस्करण तैयार करती है।
मिलती-जुलती skills
blender-motion-state-inspection
280kयह 3D animations की बारीक details देखने देता है। poses, movements और character alignment जाँचने के लिए यह उपयोगी है।
manim-video
280kआपके एजेंट को animated explainer videos बनाने देता है। यह तकनीकी विषयों के लिए साफ़ graphs और diagrams बनाने के लिए Manim का इस्तेमाल करता है।
remotion-video-creation
280kआपके एजेंट को Remotion लाइब्रेरी के साथ React में वीडियो बनाने का तरीका बताता है। इसमें animations, audio, captions और दूसरे विज़ुअल एलिमेंट्स के बेस्ट प्रैक्टिस शामिल हैं।