{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "scroll-reveal-shadcnui", "type": "registry:page", "title": "Scroll Reveal", "description": "Section that animates into view on scroll with intersection observer", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/sections/scroll-reveal.tsx", "content": "\"use client\";\n\nimport {\n AnimatePresence,\n motion,\n MotionConfig,\n useInView,\n useReducedMotion,\n type Variants,\n} from \"framer-motion\";\nimport { Rocket, Shield, Zap } from \"lucide-react\";\nimport { useId, useMemo, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst motionPresets = {\n smooth: { type: \"spring\" as const, bounce: 0.3, duration: 0.4 },\n bounce: { type: \"spring\" as const, bounce: 0.5, duration: 0.35 },\n fade: { type: \"tween\" as const, ease: [0.26, 0.08, 0.25, 1] as const, duration: 0.2 },\n};\n\nconst features = [\n {\n icon: Zap,\n title: \"Lightning Fast\",\n description:\n \"GPU-accelerated pipelines and finely tuned transitions keep every interaction responsive.\",\n },\n {\n icon: Shield,\n title: \"Secure by Default\",\n description:\n \"Enterprise-grade auth, encryption, and auditability woven through every flow.\",\n },\n {\n icon: Rocket,\n title: \"Effortlessly Scalable\",\n description:\n \"Composable primitives that adapt across teams, products, and global rollouts.\",\n },\n];\n\ninterface ScrollRevealProps {\n motionPreset?: keyof typeof motionPresets;\n className?: string;\n}\n\nexport function ScrollReveal({\n motionPreset = \"smooth\",\n className,\n}: ScrollRevealProps) {\n const ref = useRef(null);\n const isInView = useInView(ref, { once: true, margin: \"-15% 0px\" });\n const shouldReduceMotion = useReducedMotion();\n\n const headingId = useId();\n const descriptionId = useMemo(() => `${headingId}-description`, [headingId]);\n\n const reducedMotionVariants: Variants = {\n hidden: { opacity: 0 },\n visible: { opacity: 1 },\n };\n\n const containerVariants: Variants = useMemo(\n () =>\n shouldReduceMotion\n ? reducedMotionVariants\n : {\n hidden: { opacity: 0 },\n visible: {\n opacity: 1,\n transition: {\n staggerChildren: 0.1,\n delayChildren: 0.2,\n },\n },\n },\n [shouldReduceMotion]\n );\n\n const itemVariants: Variants = useMemo(\n () =>\n shouldReduceMotion\n ? reducedMotionVariants\n : {\n hidden: { opacity: 0, y: 20 },\n visible: {\n opacity: 1,\n y: 0,\n transition: { duration: 0.4 },\n },\n },\n [shouldReduceMotion]\n );\n\n const cardVariants: Variants = {\n idle: { y: 0 },\n hover: { y: -4 },\n };\n\n const iconVariants: Variants = useMemo(\n () =>\n shouldReduceMotion\n ? reducedMotionVariants\n : {\n hidden: { scale: 0.6, opacity: 0 },\n visible: {\n scale: 1,\n opacity: 1,\n transition: { duration: 0.4, ease: [0.18, 0.89, 0.32, 1.28] },\n },\n },\n [shouldReduceMotion]\n );\n\n return (\n \n \n \n {/* Header section */}\n \n \n Core System\n \n \n \n Features that elevate every launch\n \n \n A glassmorphic toolkit engineered for motion-rich dashboards,\n glowing handoffs, and resilient product experiences at scale.\n \n \n\n {/* Feature cards grid */}\n \n \n {features.map((feature, index) => {\n const Icon = feature.icon;\n return (\n \n {/* Hover gradient overlay */}\n
\n\n {/* Icon container */}\n \n \n \n\n {/* Content */}\n
\n

\n {feature.title}\n

\n

\n {feature.description}\n

\n
\n \n );\n })}\n \n \n \n \n \n );\n}\n\n", "type": "registry:page", "target": "components/uitripled/scroll-reveal-shadcnui.tsx" } ] }