2026-11-03 18:22:51 +05:30
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { motion, useReducedMotion } from 'framer-motion';
|
|
|
|
|
|
|
|
|
|
/** Subtle, viewport-triggered entrance shared by every JSON-driven page section. */
|
|
|
|
|
export function SectionEntrance({ children, id }: { children: React.ReactNode; id: string }) {
|
|
|
|
|
const reduceMotion = useReducedMotion();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<motion.div
|
|
|
|
|
data-section-entrance={id}
|
2026-11-03 18:34:29 +05:30
|
|
|
initial={reduceMotion ? false : { opacity: 0, y: 14 }}
|
|
|
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
|
|
|
viewport={{ once: true, amount: 0.08, margin: '0px 0px -24px 0px' }}
|
|
|
|
|
transition={{ duration: 0.42, ease: [0.22, 1, 0.36, 1] }}
|
2026-11-03 18:22:51 +05:30
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</motion.div>
|
|
|
|
|
);
|
|
|
|
|
}
|