21 lines
689 B
TypeScript
21 lines
689 B
TypeScript
'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}
|
||
|
|
initial={reduceMotion ? false : { opacity: 0, y: 22, filter: 'blur(5px)' }}
|
||
|
|
whileInView={{ opacity: 1, y: 0, filter: 'blur(0px)' }}
|
||
|
|
viewport={{ once: true, amount: 0.12, margin: '0px 0px -48px 0px' }}
|
||
|
|
transition={{ duration: 0.65, ease: [0.22, 1, 0.36, 1] }}
|
||
|
|
>
|
||
|
|
{children}
|
||
|
|
</motion.div>
|
||
|
|
);
|
||
|
|
}
|