{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "dynamic-spotlight-cta-shadcnui", "type": "registry:page", "title": "Dynamic Spotlight CTA", "description": "Floating spotlight follows cursor to reveal gradient CTA text with premium effects", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/motion-core/dynamic-spotlight-cta.tsx", "content": "\"use client\";\n\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { MouseEvent, useMemo, useState } from \"react\";\n\ntype DynamicSpotlightCTAProps = {\n text?: string;\n intensity?: number;\n radius?: number;\n showBlur?: boolean;\n};\n\ntype Particle = {\n left: string;\n top: string;\n size: number;\n travel: number;\n duration: number;\n delay: number;\n};\n\nexport function DynamicSpotlightCTA({\n text = \"Unlock Your Motion Power\",\n intensity = 0.85,\n radius = 240,\n showBlur = true,\n}: DynamicSpotlightCTAProps) {\n const [mousePosition, setMousePosition] = useState<{\n x: number;\n y: number;\n } | null>(null);\n const shouldReduceMotion = useReducedMotion();\n\n const particles = useMemo(\n () =>\n Array.from({ length: 18 }).map(() => ({\n left: `${Math.random() * 100}%`,\n top: `${Math.random() * 100}%`,\n size: Math.random() * 4 + 2,\n travel: Math.random() * 72 - 36,\n duration: Math.random() * 3 + 2,\n delay: Math.random() * 2,\n })),\n []\n );\n\n const handleMouseMove = (event: MouseEvent) => {\n if (shouldReduceMotion) return;\n const rect = event.currentTarget.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n setMousePosition({ x, y });\n };\n\n const handleMouseLeave = () => {\n setMousePosition(null);\n };\n\n return (\n \n \n
\n \n \n {showBlur && (\n
\n )}\n
\n\n
\n \n Live Spotlight\n \n \n\n \n {text}\n \n

\n Move your cursor to cast a live glassmorphic spotlight and preview\n premium motion-ready surfaces.\n

\n
\n\n \n {!shouldReduceMotion && mousePosition && (\n \n \n \n )}\n \n\n
\n {particles.map((particle, index) => (\n \n ))}\n
\n\n
\n
\n
\n
\n
\n
\n
\n \n );\n}\n", "type": "registry:page", "target": "components/uitripled/dynamic-spotlight-cta-shadcnui.tsx" } ] }