{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "animated-card-carousel-demo", "registryDependencies": [ "https://reusables.vercel.app/r/animated-card-carousel", "select", "slider" ], "files": [ { "path": "registry/example/animated-card-carousel-demo.tsx", "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\"\nimport { Slider } from \"@/components/ui/slider\"\n\nimport AnimatedCard, {\n AnimationEaseType,\n CardSizeType,\n} from \"@/components/animated-card-carousel\"\n\nexport default function RotateAnimatedDemo() {\n const cards = [\n {\n title: \"Portfolio Builder\",\n description:\n \"Create stunning professional portfolios with our intuitive drag-and-drop interface. Showcase your work with beautiful layouts and responsive designs.\",\n imgSrc:\n \"https://res.cloudinary.com/duli9q35f/image/upload/v1742067091/reading-dark_kfnwvb.webp\",\n color: \"#3b82f6\",\n href: \"#\",\n },\n {\n title: \"Health Tracker\",\n description:\n \"Monitor your fitness journey with comprehensive health analytics. Track workouts, nutrition, and wellness metrics all in one secure application.\",\n imgSrc:\n \"https://res.cloudinary.com/duli9q35f/image/upload/v1742067091/reading-dark_kfnwvb.webp\",\n color: \"#10b981\",\n href: \"#\",\n },\n {\n title: \"Learning Platform\",\n description:\n \"Access world-class educational content with our interactive learning platform. Master new skills with personalized courses and expert-led tutorials.\",\n imgSrc:\n \"https://res.cloudinary.com/duli9q35f/image/upload/v1742067091/reading-dark_kfnwvb.webp\",\n color: \"#8b5cf6\",\n href: \"#\",\n },\n {\n title: \"E-Commerce Solution\",\n description:\n \"Launch your online store with our comprehensive e-commerce platform. Manage inventory, process payments, and grow your business with powerful analytics.\",\n imgSrc:\n \"https://res.cloudinary.com/duli9q35f/image/upload/v1742067091/reading-dark_kfnwvb.webp\",\n color: \"#f43f5e\",\n href: \"#\",\n },\n ]\n const [activeIndex, setActiveIndex] = useState(0)\n const [isHovering, setIsHovering] = useState(false)\n const [rotationSpeed, setRotationSpeed] = useState(3000)\n const [animationDuration, setAnimationDuration] = useState(0.5)\n const [animationEase, setAnimationEase] =\n useState(\"easeInOut\")\n const [cardSize, setCardSize] = useState(\"featured\")\n\n useEffect(() => {\n let interval: NodeJS.Timeout\n\n if (!isHovering) {\n interval = setInterval(() => {\n setActiveIndex((prevIndex) => (prevIndex + 1) % cards.length)\n }, rotationSpeed)\n }\n\n return () => clearInterval(interval)\n }, [isHovering, cards.length, rotationSpeed])\n\n const handleMouseEnter = (index: number) => {\n setIsHovering(true)\n setActiveIndex(index)\n }\n\n const handleMouseLeave = () => {\n setIsHovering(false)\n }\n\n return (\n
\n {/* Controls for customization */}\n
\n
\n
\n \n Rotation Speed: {rotationSpeed}ms\n \n setRotationSpeed(value[0])}\n className=\"w-full\"\n />\n
\n\n
\n \n Animation Duration: {animationDuration}s\n \n setAnimationDuration(value[0])}\n className=\"w-full\"\n />\n
\n\n
\n \n Animation Easing\n \n \n setAnimationEase(value as AnimationEaseType)\n }\n >\n \n \n \n \n Ease In Out\n Ease In\n Ease Out\n Linear\n Circular In\n Circular Out\n Circular In Out\n Back In\n Back Out\n Back In Out\n \n \n
\n\n
\n \n setCardSize(value as CardSizeType)}\n >\n \n \n \n \n Featured (Large)\n Standard (Small)\n \n \n
\n
\n
\n \n {cards.map((card, index) => (\n handleMouseEnter(index)}\n onMouseLeave={handleMouseLeave}\n animationDuration={animationDuration}\n animationEase={animationEase}\n size={cardSize}\n />\n ))}\n
\n \n )\n}\n", "type": "registry:example", "target": "components/animated-card-carousel-demo.tsx" } ], "type": "registry:example" }