feat: implement management folder architecture, hover-only tool sliders, grain transform animation, and prominent upload studio
This commit is contained in:
@@ -1,20 +1,36 @@
|
||||
'use client';
|
||||
|
||||
import { motion, useReducedMotion } from 'framer-motion';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
/** Subtle, viewport-triggered entrance shared by every JSON-driven page section. */
|
||||
/** Lightweight progressive enhancement: content is visible before JavaScript runs. */
|
||||
export function SectionEntrance({ children, id }: { children: React.ReactNode; id: string }) {
|
||||
const reduceMotion = useReducedMotion();
|
||||
const sectionRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const element = sectionRef.current;
|
||||
if (!element || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
([entry]) => {
|
||||
if (!entry.isIntersecting) return;
|
||||
element.dataset.revealed = 'true';
|
||||
observer.disconnect();
|
||||
},
|
||||
{ rootMargin: '0px 0px -6% 0px', threshold: 0.03 }
|
||||
);
|
||||
|
||||
observer.observe(element);
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
<div
|
||||
ref={sectionRef}
|
||||
data-section-entrance={id}
|
||||
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] }}
|
||||
data-revealed="false"
|
||||
className={id === 'hero-section' ? 'section-shell section-shell--hero' : 'section-shell'}
|
||||
>
|
||||
{children}
|
||||
</motion.div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user