{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "curved-carousel",
  "title": "Curved Carousel",
  "author": "AlgorizeTech",
  "description": "Ask the user to pick one of 2 curved carousel variants: https://avaraui.com/view/curved-carousel. This item holds 2 of them as looks of one component (arc-sweep, infinite-marquee). Skip the question if the user already named one. A continuously scrolling carousel whose cards follow a curved arc path. Use it for logo walls and showcase strips that should feel ambient.",
  "dependencies": [],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/CurvedCarouselBlock.tsx",
      "content": "\"use client\";\n\nimport React, { useState, useEffect, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\nexport interface CurvedCarouselCard {\n  id: string;\n  title: string;\n  code: string;\n  image: string;\n}\n\nexport type CurvedCarouselVariant = \"arc-sweep\" | \"infinite-marquee\";\n\nexport interface CurvedCarouselProps extends React.HTMLAttributes<HTMLDivElement> {\n  variant?: CurvedCarouselVariant;\n  autoPlay?: boolean;\n  speed?: number;\n  color?: string;\n  items?: CurvedCarouselCard[];\n  className?: string;\n}\n\nconst CAROUSEL_ITEMS: CurvedCarouselCard[] = [\n  {\n    id: \"card-1\",\n    title: \"Misty Pine Forest\",\n    code: \"001\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790145141/photo-1448375240586-882707db888b-1790145143491.jpg\",\n  },\n  {\n    id: \"card-2\",\n    title: \"Alpine Mountain Reflection\",\n    code: \"002\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790145141/photo-1464822759023-fed622ff2c3b-1790145143491.jpg\",\n  },\n  {\n    id: \"card-3\",\n    title: \"Glacier Lake Wilderness\",\n    code: \"003\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1506744038136-46273834b3fb-1790146212208.jpg\",\n  },\n  {\n    id: \"card-4\",\n    title: \"Autumn Woodland River\",\n    code: \"004\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146209/photo-1470071459604-3b5ec3a7fe05-1790146212205.jpg\",\n  },\n  {\n    id: \"card-5\",\n    title: \"Golden Hour Valley\",\n    code: \"005\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150481/photo-1507272931001-fc06c17e4f43-1790150482276.jpg\",\n  },\n  {\n    id: \"card-6\",\n    title: \"Mountain Ridge Sunset\",\n    code: \"006\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1472214103451-9374bd1c798e-1790146212205.jpg\",\n  },\n  {\n    id: \"card-7\",\n    title: \"Cascading Forest Waterfall\",\n    code: \"007\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790145140/photo-1426604966848-d7adac402bff-1790145143490.jpg\",\n  },\n  {\n    id: \"card-8\",\n    title: \"Deep Wilderness Forest\",\n    code: \"008\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146211/photo-1441974231531-c6227db76b6e-1790146212212.jpg\",\n  },\n  {\n    id: \"card-9\",\n    title: \"Emerald Mountain Meadow\",\n    code: \"009\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146209/photo-1469474968028-56623f02e42e-1790146212205.jpg\",\n  },\n  {\n    id: \"card-10\",\n    title: \"Serene Desert Canyon\",\n    code: \"010\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1509316975850-ff9c5deb0cd9-1790146212209.jpg\",\n  },\n  {\n    id: \"card-11\",\n    title: \"Sunlit Pine Woods\",\n    code: \"011\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790148863/photo-1473448912268-2022ce9509d8-1790148865110.jpg\",\n  },\n  {\n    id: \"card-12\",\n    title: \"Mystic Fog Peak\",\n    code: \"012\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146211/photo-1519681393784-d120267933ba-1790146212210.jpg\",\n  },\n  {\n    id: \"card-13\",\n    title: \"Aurora Wilderness Night\",\n    code: \"013\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150482/photo-1531366936337-7c912a4589a7-1790150482280.jpg\",\n  },\n  {\n    id: \"card-14\",\n    title: \"Wild Canyon River\",\n    code: \"014\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150480/photo-1474044159687-1ee9f3a51722-1790150482274.jpg\",\n  },\n  {\n    id: \"card-15\",\n    title: \"Snowy Alpine Ridge\",\n    code: \"015\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150482/photo-1530122037265-a5f1f91d3b99-1790150482279.jpg\",\n  },\n  {\n    id: \"card-16\",\n    title: \"Tranquil Forest Lake\",\n    code: \"016\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1501785888041-af3ef285b470-1790146212207.jpg\",\n  },\n  {\n    id: \"card-17\",\n    title: \"Bamboo Grove Walkway\",\n    code: \"017\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150480/photo-1493976040374-85c8e12f0c0e-1790150482275.jpg\",\n  },\n  {\n    id: \"card-18\",\n    title: \"Serengeti Plains Nature\",\n    code: \"018\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150481/photo-1516426122078-c23e76319801-1790150482277.jpg\",\n  },\n  {\n    id: \"card-19\",\n    title: \"Fjords Ocean Horizon\",\n    code: \"019\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto/v1790224415/photo-1472214103451-9374bd1c798e-1790146212205-1790224416318.webp\",\n  },\n  {\n    id: \"card-20\",\n    title: \"Tropical Island Coast\",\n    code: \"020\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1507525428034-b723cf961d3e-1790146212208.jpg\",\n  },\n  {\n    id: \"card-21\",\n    title: \"Sunburst Cypress River\",\n    code: \"021\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto/v1790224415/photo-1441974231531-c6227db76b6e-1790146212212-1790224416317.webp\",\n  },\n  {\n    id: \"card-22\",\n    title: \"Lush Mountain Slope\",\n    code: \"022\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790148863/photo-1473448912268-2022ce9509d8-1790148865110.jpg\",\n  },\n  {\n    id: \"card-23\",\n    title: \"Crater Lake Azure\",\n    code: \"023\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790146210/photo-1506744038136-46273834b3fb-1790146212208.jpg\",\n  },\n  {\n    id: \"card-24\",\n    title: \"Highland Pine Crest\",\n    code: \"024\",\n    image: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790145141/photo-1448375240586-882707db888b-1790145143491.jpg\",\n  },\n];\n\nexport function CurvedCarousel({\n  variant = \"arc-sweep\",\n  autoPlay = true,\n  speed = 1,\n  color = \"primary\",\n  items,\n  className,\n  ...props\n}: CurvedCarouselProps) {\n  const carouselItems = items || CAROUSEL_ITEMS;\n  const [rotationAngle, setRotationAngle] = useState(0);\n  const [marqueeAngle, setMarqueeAngle] = useState(0);\n  const [windowWidth, setWindowWidth] = useState(1200);\n  const sweepDirection = useRef<1 | -1>(1);\n\n  let arcItems = carouselItems;\n  if (carouselItems.length > 0 && carouselItems.length < 24) {\n    const repeatCount = Math.ceil(24 / carouselItems.length);\n    const duplicated: CurvedCarouselCard[] = [];\n    for (let i = 0; i < repeatCount; i++) {\n      carouselItems.forEach((item, idx) => {\n        duplicated.push({\n          ...item,\n          id: `${item.id}-dup-${i}-${idx}`,\n        });\n      });\n    }\n    arcItems = duplicated.slice(0, 24);\n  }\n\n  const total = arcItems.length;\n\n  useEffect(() => {\n    // Track screen width dynamically for fluid scaling:\n    const handleResize = () => {\n      setWindowWidth(window.innerWidth);\n    };\n    handleResize();\n    window.addEventListener(\"resize\", handleResize);\n\n    // Oscillates the giant wheel ring back and forth smoothly between -10° and +10° for arc-sweep\n    const step = 0.08 * speed;\n    const timer = autoPlay\n      ? setInterval(() => {\n          setRotationAngle((prev) => {\n            if (prev >= 10) {\n              sweepDirection.current = -1;\n              return prev - step;\n            }\n            if (prev <= -10) {\n              sweepDirection.current = 1;\n              return prev + step;\n            }\n            return prev + step * sweepDirection.current;\n          });\n\n          // All-time continuous right-to-left marquee motion (decreases angle perpetually)\n          setMarqueeAngle((prev) => (prev - 0.12 * speed) % 360);\n        }, 20)\n      : null;\n\n    return () => {\n      if (timer !== null) clearInterval(timer);\n      window.removeEventListener(\"resize\", handleResize);\n    };\n  }, [autoPlay, speed]);\n\n  // Fluid responsive parameters according to screen size:\n  const isMobile = windowWidth < 640;\n  const isTablet = windowWidth >= 640 && windowWidth < 1024;\n\n  const baseRadius = isMobile ? 520 : isTablet ? 720 : 960;\n  const baseCenterOffset = isMobile ? 480 : isTablet ? 660 : 880;\n\n  // Custom styling for color support\n  const activeColorStyle = React.useMemo(() => {\n    if (!color || color === \"primary\") return { borderColor: \"var(--primary)\" };\n    if (color === \"indigo\") return { borderColor: \"#6366f1\" };\n    if (color === \"rose\") return { borderColor: \"#f43f5e\" };\n    if (color === \"emerald\") return { borderColor: \"#10b981\" };\n    if (color === \"zinc\") return { borderColor: \"#71717a\" };\n    return { borderColor: color };\n  }, [color]);\n\n  if (variant === \"infinite-marquee\") {\n    // 100% Constant Linear Speed Marquee Track with Strict 12px Card Spacing\n    const cardWidth = isMobile ? 140 : isTablet ? 195 : 245;\n    const gap = 12;\n    const itemTotalWidth = cardWidth + gap;\n\n    // Auto-duplicate items if the total width is too small to cover the viewport seamlessly\n    let displayItems = carouselItems;\n    if (carouselItems.length > 0) {\n      const minTrackWidth = Math.max(windowWidth * 2.5, 2000);\n      const singleSetWidth = carouselItems.length * itemTotalWidth;\n      if (singleSetWidth < minTrackWidth) {\n        const repeatCount = Math.ceil(minTrackWidth / singleSetWidth);\n        const duplicated: CurvedCarouselCard[] = [];\n        for (let i = 0; i < repeatCount; i++) {\n          carouselItems.forEach((item, idx) => {\n            duplicated.push({\n              ...item,\n              id: `${item.id}-dup-${i}-${idx}`,\n            });\n          });\n        }\n        displayItems = duplicated;\n      }\n    }\n\n    const totalTrackWidth = displayItems.length * itemTotalWidth;\n\n    // Linear continuous pixel offset for constant linear speed across entire track\n    const currentOffset = (marqueeAngle * 10) % totalTrackWidth;\n\n    return (\n      <div\n        className={cn(\n          \"relative w-full h-[400px] sm:h-[480px] md:h-[560px] rounded-[24px] sm:rounded-[32px] overflow-hidden select-none bg-background border border-border\",\n          \"flex items-center justify-center p-0 m-0 isolation-auto\",\n          className\n        )}\n        {...props}\n      >\n        {/* Soft edge fade vignettes */}\n        <div className=\"absolute left-0 top-0 bottom-0 w-28 sm:w-48 bg-gradient-to-r from-background via-background/90 to-transparent z-40 pointer-events-none\" />\n        <div className=\"absolute right-0 top-0 bottom-0 w-28 sm:w-48 bg-gradient-to-l from-background via-background/90 to-transparent z-40 pointer-events-none\" />\n\n        {/* Constant Linear Speed 3D Concave Track */}\n        <div\n          className=\"relative w-full h-full flex items-center justify-center overflow-hidden\"\n          style={{ perspective: \"1100px\" }}\n        >\n          {displayItems.map((item, index) => {\n            let posX = index * itemTotalWidth + currentOffset;\n\n            // Seamless infinite wrap around total track width\n            while (posX > totalTrackWidth / 2) posX -= totalTrackWidth;\n            while (posX < -totalTrackWidth / 2) posX += totalTrackWidth;\n\n            // Visible range filter\n            const maxVisibleRange = windowWidth / 2 + cardWidth;\n            if (Math.abs(posX) > maxVisibleRange) return null;\n\n            // Ultra Smooth Subtle Linear Side Height Scaling (No 30-40px big jumps):\n            const normRatio = posX / (windowWidth * 0.5);\n            const translateZ = (1 - Math.cos(normRatio * (Math.PI / 3))) * 180;\n            const rotateY = -normRatio * 18;\n            \n            // Ultra subtle linear growth (~8-12px gradual total height transition)\n            const scaleY = 1 + Math.abs(normRatio) * 0.12;\n\n            return (\n              <div\n                key={`${item.id}-${index}`}\n                style={{\n                  transform: `translate3d(${posX}px, 0px, ${translateZ}px) rotateY(${rotateY}deg) scaleY(${scaleY})`,\n                  transformOrigin: \"center center\",\n                  width: `${cardWidth}px`,\n                  zIndex: Math.round(1000 - Math.abs(posX)),\n                  ...activeColorStyle,\n                }}\n                className={cn(\n                  \"absolute h-[200px] sm:h-[280px] md:h-[350px] rounded-2xl overflow-hidden cursor-default shadow-xl pointer-events-none border border-foreground/80\",\n                  \"bg-muted\"\n                )}\n              >\n                <img\n                  src={item.image}\n                  alt={item.title}\n                  className=\"w-full h-full object-cover\"\n                />\n              </div>\n            );\n          })}\n        </div>\n\n        {/* Sleek Label */}\n        <div className=\"absolute bottom-6 sm:bottom-8 z-40 flex flex-col items-center pointer-events-none\">\n          <div className=\"flex items-center gap-3\">\n            <span className=\"w-8 h-[1.5px] bg-foreground/30\" />\n            <span className=\"text-foreground font-mono text-xs tracking-[0.25em] uppercase font-semibold\">\n              Continuous Curved Marquee\n            </span>\n            <span className=\"w-8 h-[1.5px] bg-foreground/30\" />\n          </div>\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div\n      className={cn(\n        \"relative w-full h-[440px] sm:h-[560px] md:h-[660px] rounded-[24px] sm:rounded-[32px] overflow-hidden select-none bg-background border border-border\",\n        \"flex flex-col items-center justify-center p-0 m-0\",\n        className\n      )}\n      {...props}\n    >\n      {/* FLUID RESPONSIVE 360-DEGREE GIANT WHEEL RING */}\n      <div className=\"relative w-full h-full flex items-center justify-center overflow-hidden\">\n        {arcItems.map((item, index) => {\n          // 15-degree step angle (360 / 24 = 15 deg)\n          const spokeAngle = index * (360 / total);\n          const currentAngle = spokeAngle + rotationAngle;\n\n          const rad = (currentAngle * Math.PI) / 180;\n\n          const translateX = Math.sin(rad) * baseRadius;\n          const translateY = Math.cos(rad) * baseRadius + baseCenterOffset;\n          const rotateZ = -currentAngle;\n\n          // Inverted z-index stacking order so cards overlap in exact reverse order:\n          const zIndex = (total - index) * 2;\n\n          return (\n            <div\n              key={item.id}\n              style={{\n                transform: `translate3d(${translateX}px, ${translateY}px, 0px) rotate(${rotateZ}deg)`,\n                transformOrigin: \"50% 50%\",\n                zIndex: zIndex,\n                ...activeColorStyle,\n              }}\n              className={cn(\n                \"absolute w-[150px] sm:w-[210px] md:w-[280px] h-[210px] sm:h-[300px] md:h-[410px] rounded-xl sm:rounded-2xl overflow-hidden cursor-default shadow-none transition-none\",\n                \"bg-muted border border-foreground/80\"\n              )}\n            >\n              {/* Pure Image Only */}\n              <img\n                src={item.image}\n                alt={item.title}\n                className=\"w-full h-full object-cover rotate-180\"\n              />\n            </div>\n          );\n        })}\n      </div>\n\n      {/* SLEEK MINIMAL TYPOGRAPHY LABEL */}\n      <div className=\"absolute bottom-8 sm:bottom-12 z-40 flex flex-col items-center pointer-events-none\">\n        <div className=\"flex items-center gap-3\">\n          <span className=\"w-8 h-[1.5px] bg-foreground/30\" />\n          <span className=\"text-foreground font-mono text-xs sm:text-sm tracking-[0.25em] uppercase font-semibold\">\n            Curved Carousel\n          </span>\n          <span className=\"w-8 h-[1.5px] bg-foreground/30\" />\n        </div>\n      </div>\n    </div>\n  );\n}\n\n",
      "type": "registry:component",
      "target": "components/custom/blocks/CurvedCarouselBlock.tsx"
    }
  ],
  "docs": "Named exports: CurvedCarousel, CurvedCarouselCard. `speed` sets the drift rate and `autoPlay` toggles motion. Loops continuously rather than paging, so it suits decorative rows more than navigable content.",
  "categories": [
    "media",
    "marketing"
  ],
  "type": "registry:component"
}
