{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "animated-card-carousel", "dependencies": [ "framer-motion", "lucide-react" ], "registryDependencies": [ "https://reusables.vercel.app/r/utils.json", "https://reusables.vercel.app/r/use-screen-size" ], "files": [ { "path": "registry/reusables/animated-card-carousel.tsx", "content": "\"use client\"\n\nimport { FC, useEffect, useRef } from \"react\"\nimport Link from \"next/link\"\nimport { motion, useAnimation } from \"framer-motion\"\nimport { ArrowRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport useScreenSize from \"@/hooks/use-screen-size\"\n\nexport type AnimationEaseType =\n | \"easeInOut\"\n | \"easeIn\"\n | \"easeOut\"\n | \"linear\"\n | \"circIn\"\n | \"circOut\"\n | \"circInOut\"\n | \"backIn\"\n | \"backOut\"\n | \"backInOut\"\n\nexport type CardSizeType = \"standard\" | \"featured\"\n\ninterface AnimatedCardProps {\n title: string\n description: string\n imgSrc: string\n color: string\n href: string\n linkText?: string\n isActive: boolean\n onMouseEnter: () => void\n onMouseLeave: () => void\n className?: string\n imageClassName?: string\n titleClassName?: string\n descriptionClassName?: string\n linkClassName?: string\n animationDuration?: number\n animationEase?: AnimationEaseType\n size?: CardSizeType\n}\n\nconst AnimatedCard: FC = ({\n title,\n description,\n imgSrc,\n color,\n isActive,\n href,\n linkText,\n onMouseEnter,\n onMouseLeave,\n className,\n imageClassName,\n titleClassName,\n descriptionClassName,\n linkClassName,\n animationDuration = 0.5,\n animationEase = \"easeInOut\",\n size = \"featured\",\n}) => {\n const container = useRef(null)\n const controls = useAnimation()\n const { isMobile } = useScreenSize()\n\n useEffect(() => {\n if (isActive) {\n controls.start(\"visible\")\n } else {\n controls.start(\"hidden\")\n }\n }, [isActive, controls])\n\n return (\n {\n controls.start(\"visible\")\n onMouseEnter()\n }}\n onMouseLeave={() => {\n if (!isActive) {\n controls.start(\"hidden\")\n }\n onMouseLeave()\n }}\n className={className}\n role=\"group\"\n aria-selected={isActive}\n >\n \n
\n \n {title}\n \n \n {description}\n

\n
\n \n \n \n\n \n {linkText || \"View Project\"}\n \n \n \n \n )\n}\n\nexport default AnimatedCard\n", "type": "registry:component", "target": "components/animated-card-carousel.tsx" } ], "type": "registry:component" }