Stagger Reveal Grid
Grid items that fade and slide up in sequence as the grid enters the viewport.
3 फ्रेमवर्कमध्यम
Content that fades and rises into place as it enters the viewport.
<section class="reveal" data-reveal>
<h2>Ship faster</h2>
<p>Everything you need to go from idea to production, in one place.</p>
</section>
<section class="reveal" data-reveal data-reveal-delay="120">
<h2>Scale calmly</h2>
<p>Autoscaling, observability, and rollbacks that take one click.</p>
</section>
<!-- Without JS the observer never runs, so unhide everything up front. -->
<noscript>
<style>
.reveal { opacity: 1 !important; transform: none !important; }
</style>
</noscript>
<script>
(function () {
var nodes = document.querySelectorAll('[data-reveal]');
// No observer support, or the user asked for less motion: show immediately.
if (
!('IntersectionObserver' in window) ||
window.matchMedia('(prefers-reduced-motion: reduce)').matches
) {
nodes.forEach(function (node) {
node.classList.add('is-visible');
});
return;
}
var observer = new IntersectionObserver(
function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
var node = entry.target;
node.style.transitionDelay = (node.dataset.revealDelay || 0) + 'ms';
node.classList.add('is-visible');
observer.unobserve(node);
});
},
{ threshold: 0.15, rootMargin: '0px 0px -10% 0px' }
);
nodes.forEach(function (node) {
observer.observe(node);
});
})();
</script>pnpm add framer-motion@^12.42.2
| Prop | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
childrenआवश्यक | ReactNode | - | कंपोनेंट के अंदर रेंडर होने वाला कंटेंट। |
direction | 'up' | 'down' | 'none' | 'up' | दिखते समय एलिमेंट जिस दिशा से आता है। |
distance | number | 24 | एलिमेंट कितने पिक्सेल चलता है। |
delay | number | 0 | एनिमेशन शुरू होने से पहले रुकने के सेकंड। |
duration | number | 0.5 | एनिमेशन की अवधि, सेकंड में। |
once | boolean | true | व्यू में पहली बार आने पर ही एनिमेट करता है। |
Tune `duration` and the y-offset for a heavier or lighter entrance. Trigger once rather than on every scroll - re-animating content a reader has already seen is distracting.