{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "ecommerce-sections-01", "type": "registry:block", "description": "Runway video spotlight with product cards", "registryDependencies": [ "badge", "button", "card" ], "files": [ { "path": "creative-tim-ui/blocks/ecommerce-sections-01/page.tsx", "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { Pause, Play, ShoppingBag, Shuffle } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\n\nconst PRODUCTS = [\n {\n id: \"card-1\",\n media: {\n src: \"https://images.unsplash.com/photo-1595777457583-95e059d581b8?q=80&w=400&auto=format&fit=crop\",\n alt: \"Satin Wrap Dress product thumbnail\",\n },\n eyebrow: \"Maison Aurore\",\n title: \"Satin Wrap Dress\",\n description: \"Fluid silhouette with tie waist and soft sheen.\",\n price: \"$215.00\",\n },\n {\n id: \"card-2\",\n media: {\n src: \"https://images.unsplash.com/photo-1591369822096-ffd140ec948f?q=80&w=400&auto=format&fit=crop\",\n alt: \"Structured Blazer product thumbnail\",\n },\n eyebrow: \"Atelier No. 9\",\n title: \"Structured Blazer\",\n description: \"Sharp shoulders, single-breasted, polished finish.\",\n price: \"$329.00\",\n },\n {\n id: \"card-3\",\n media: {\n src: \"https://images.unsplash.com/photo-1543163521-1bf539c55dd2?q=80&w=400&auto=format&fit=crop\",\n alt: \"Chunky Chelsea Boots product thumbnail\",\n },\n eyebrow: \"Linea Forte\",\n title: \"Chunky Chelsea Boots\",\n description: \"Elevated lug sole with elastic side panels.\",\n price: \"From $180.00\",\n },\n]\n\nexport default function EcommerceSectionsBlock() {\n const [isPlaying, setIsPlaying] = useState(true)\n const playerRef = useRef(null)\n const [playerReady, setPlayerReady] = useState(false)\n\n useEffect(() => {\n const tag = document.createElement(\"script\")\n tag.src = \"https://www.youtube.com/iframe_api\"\n const firstScriptTag = document.getElementsByTagName(\"script\")[0]\n firstScriptTag.parentNode?.insertBefore(tag, firstScriptTag)\n ;(window as any).onYouTubeIframeAPIReady = () => {\n playerRef.current = new (window as any).YT.Player(\"youtube-player\", {\n videoId: \"YCIuEU2y8XI\",\n playerVars: {\n autoplay: 1,\n mute: 1,\n loop: 1,\n playlist: \"YCIuEU2y8XI\",\n controls: 0,\n showinfo: 0,\n modestbranding: 1,\n playsinline: 1,\n },\n events: {\n onReady: () => {\n setPlayerReady(true)\n },\n },\n })\n }\n\n return () => {\n if (playerRef.current) {\n playerRef.current.destroy()\n }\n }\n }, [])\n\n const togglePlay = () => {\n if (playerRef.current && playerReady) {\n if (isPlaying) {\n playerRef.current.pauseVideo()\n } else {\n playerRef.current.playVideo()\n }\n setIsPlaying(!isPlaying)\n }\n }\n\n return (\n
\n
\n \n\n
\n\n \n {isPlaying ? (\n \n ) : (\n \n )}\n \n\n
\n
\n {PRODUCTS.map((product) => (\n \n
\n \n
\n\n
\n

\n {product.eyebrow}\n

\n

\n {product.title}\n

\n

{product.price}

\n
\n\n
\n \n \n \n \n \n \n
\n
\n ))}\n
\n\n
\n \n VIEW ALL PRODUCTS\n \n
\n
\n
\n
\n )\n}\n", "type": "registry:page", "target": "app/ecommerce-sections/page.tsx" } ], "meta": { "iframeHeight": "900px", "container": "w-full bg-surface min-h-svh flex px-4 py-12 items-center md:py-20 justify-center min-w-0", "mobile": "component" }, "categories": [ "ecommerce" ] }