{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "playhead-reel-demo",
  "type": "registry:block",
  "title": "Playhead Reel: Default",
  "description": "Timeline Scrub Gallery example, Default: A studio's archive: six projects, forty images. Scroll and the playhead walks the reel while each project opens into a collage under it, and the title rolls to the next as you cross into it. Scroll fast and the collage folds flat to let you skim. Hover a photo to lift it off the pile, click one to bring it under the playhead, or drag along the ruler. A take on the horizontal scroll (filmstrip), timeline (history) and scroll animation (on scroll). Fits changelog, portfolio and blog sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "changelog",
    "portfolio",
    "blog",
    "horizontal-scroll",
    "timeline",
    "scroll-animation",
    "image-gallery",
    "carousel",
    "gallery",
    "scroll"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/playhead-reel#playhead-reel-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/playhead-reel.json"
  ],
  "files": [
    {
      "path": "components/playhead-reel-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { PlayheadReel, type PlayheadReelGroup } from \"@/components/ui/playhead-reel\";\n\nconst photo = (id: string, aspect: number) =>\n  `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=${Math.round(560 * aspect)}&h=560&q=65`;\n\nconst shot = (id: string, aspect: number, alt: string) => ({ src: photo(id, aspect), aspect, alt });\n\ntype Project = PlayheadReelGroup & { name: string; discipline: string; year: number };\n\nconst projects: Project[] = [\n  {\n    label: \"Halden\",\n    name: \"Halden House\",\n    discipline: \"Architecture\",\n    year: 2025,\n    items: [\n      shot(\"1600585154340-be6161a56a0c\", 4 / 3, \"Halden House at dusk\"),\n      shot(\"1600566753190-17f0baa2a6c3\", 4 / 3, \"Street facade in timber and render\"),\n      shot(\"1600585154526-990dced4db0d\", 3 / 4, \"Slatted screen over the stair\"),\n      shot(\"1600607687939-ce8a6c25118c\", 3 / 2, \"Open living room\"),\n      shot(\"1600607687644-c7171b42498f\", 4 / 3, \"Main bedroom\"),\n      shot(\"1600573472550-8090b5e0745e\", 3 / 4, \"Stair down to the pool\"),\n    ],\n  },\n  {\n    label: \"Maison Vert\",\n    name: \"Maison Vert\",\n    discipline: \"Interiors\",\n    year: 2024,\n    items: [\n      shot(\"1618221195710-dd6b41faaea6\", 3 / 2, \"Long living room with clerestory\"),\n      shot(\"1586023492125-27b2c045efd7\", 3 / 4, \"Yellow lounge chair\"),\n      shot(\"1618219908412-a29a1bb7b86e\", 4 / 3, \"Hallway with round mirror\"),\n      shot(\"1615529182904-14819c35db37\", 4 / 3, \"Snug with rattan pendants\"),\n      shot(\"1616486338812-3dadae4b4ace\", 3 / 2, \"Sitting room\"),\n      shot(\"1524758631624-e2822e304c36\", 4 / 3, \"Studio lounge\"),\n    ],\n  },\n  {\n    label: \"Objet\",\n    name: \"Objet\",\n    discipline: \"Product photography\",\n    year: 2024,\n    items: [\n      shot(\"1503602642458-232111445657\", 3 / 4, \"Birch stool\"),\n      shot(\"1592078615290-033ee584e267\", 3 / 4, \"Black shell chair\"),\n      shot(\"1567538096630-e0c55bd6374c\", 1, \"Tufted armchair\"),\n      shot(\"1555041469-a586c61ea9bc\", 3 / 2, \"Green velvet sofa\"),\n      shot(\"1544816155-12df9643f363\", 3 / 4, \"Canvas tote\"),\n      shot(\"1523275335684-37898b6baf30\", 4 / 3, \"White watch\"),\n      shot(\"1505740420928-5e560c06d30e\", 1, \"Headphones on yellow\"),\n    ],\n  },\n  {\n    label: \"Lumen\",\n    name: \"Lumen\",\n    discipline: \"Motion identity\",\n    year: 2023,\n    items: [\n      shot(\"1618005182384-a83a8bd57fbe\", 3 / 2, \"Violet wave\"),\n      shot(\"1620641788421-7a1c342ea42e\", 4 / 3, \"Glow on indigo\"),\n      shot(\"1617791160505-6f00504e3519\", 3 / 4, \"Folded ribbon\"),\n      shot(\"1634017839464-5c339ebe3cb4\", 4 / 3, \"Blue lines\"),\n      shot(\"1557672172-298e090bd0f1\", 1, \"Liquid marble\"),\n      shot(\"1579546929518-9e396f3cc809\", 3 / 2, \"Soft gradient\"),\n      shot(\"1604076913837-52ab5629fba9\", 3 / 4, \"Light leak\"),\n    ],\n  },\n  {\n    label: \"Corte\",\n    name: \"Corte\",\n    discipline: \"Restaurant identity\",\n    year: 2023,\n    items: [\n      shot(\"1517248135467-4c7edcad34c4\", 3 / 2, \"Dining room\"),\n      shot(\"1414235077428-338989a2e8c0\", 4 / 3, \"Dinner service\"),\n      shot(\"1540189549336-e6e99c3679fe\", 1, \"Salad from above\"),\n      shot(\"1504674900247-0877df9cc836\", 4 / 3, \"Plates for the table\"),\n      shot(\"1511920170033-f8396924c348\", 3 / 4, \"Espresso\"),\n      shot(\"1565299624946-b28f40a0ae38\", 1, \"Pizza from the oven\"),\n    ],\n  },\n  {\n    label: \"Parcel\",\n    name: \"Parcel\",\n    discipline: \"Product design\",\n    year: 2022,\n    items: [\n      shot(\"1460925895917-afdab827c52f\", 3 / 2, \"Analytics dashboard\"),\n      shot(\"1609921212029-bb5a28e60960\", 4 / 3, \"App screens on a desktop\"),\n      shot(\"1558655146-d09347e92766\", 4 / 3, \"Component library\"),\n      shot(\"1586953208448-b95a79798f07\", 3 / 4, \"Mobile app\"),\n      shot(\"1586717791821-3f44a563fa4c\", 4 / 3, \"Sketching flows\"),\n      shot(\"1572044162444-ad60f128bdea\", 3 / 2, \"Choosing colors\"),\n    ],\n  },\n];\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\nconst slug = (name: string) => name.toLowerCase().replace(/\\s+/g, \"-\");\n\nexport function PlayheadReelDemo() {\n  const scrollRef = React.useRef<HTMLDivElement>(null);\n  const [view, setView] = React.useState({ group: 0, direction: 1 });\n  const project = projects[view.group];\n\n  return (\n    <div className=\"relative w-full overflow-hidden rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-100\">\n      <div ref={scrollRef} className=\"relative h-[var(--demo-height,38rem)] overflow-y-auto overscroll-contain\">\n        <PlayheadReel\n          groups={projects}\n          containerRef={scrollRef}\n          stageClassName=\"h-[var(--demo-height,38rem)]\"\n          onActiveChange={({ group }) =>\n            setView((prev) =>\n              prev.group === group ? prev : { group, direction: group > prev.group ? 1 : -1 },\n            )\n          }\n          header={\n            <header className=\"flex items-end justify-between gap-6 px-4 pt-5 pb-4 sm:px-8 sm:pt-7\">\n              <div className=\"min-w-0 flex-1\">\n                <p className=\"font-mono text-[11px] tracking-widest text-zinc-500 uppercase tabular-nums\">\n                  Selected work · {pad(view.group + 1)} / {pad(projects.length)}\n                </p>\n                <Roll id={view.group} direction={view.direction} className=\"mt-2\">\n                  <h2 className=\"truncate text-3xl leading-[1.15] font-semibold tracking-tight sm:text-5xl\">\n                    {project.name}\n                  </h2>\n                </Roll>\n              </div>\n              <div className=\"shrink-0 text-right\">\n                <Roll id={view.group} direction={view.direction}>\n                  <p className=\"text-sm leading-6 text-zinc-500 tabular-nums\">\n                    {project.discipline} · {project.year}\n                  </p>\n                </Roll>\n                <a\n                  href={`#${slug(project.name)}`}\n                  className=\"group/link mt-1 inline-flex items-center gap-1.5 text-sm font-medium outline-current focus-visible:outline-2 focus-visible:outline-offset-2\"\n                >\n                  View case study\n                  <span\n                    aria-hidden\n                    className=\"transition-transform duration-200 ease-out group-hover/link:translate-x-0.5\"\n                  >\n                    →\n                  </span>\n                </a>\n              </div>\n            </header>\n          }\n        />\n      </div>\n    </div>\n  );\n}\n\n/** Rolls its content out and the next one in, up when moving forward and down when going back. */\nfunction Roll({\n  id,\n  direction,\n  className,\n  children,\n}: {\n  id: number;\n  direction: number;\n  className?: string;\n  children: React.ReactNode;\n}) {\n  const reduceMotion = useReducedMotion();\n  return (\n    <div className={cn(\"relative overflow-hidden\", className)}>\n      <AnimatePresence mode=\"popLayout\" initial={false} custom={direction}>\n        <motion.div\n          key={id}\n          custom={direction}\n          variants={{\n            enter: (d: number) => (reduceMotion ? { opacity: 0 } : { y: `${d * 100}%` }),\n            center: { y: 0, opacity: 1 },\n            exit: (d: number) => (reduceMotion ? { opacity: 0 } : { y: `${d * -100}%` }),\n          }}\n          initial=\"enter\"\n          animate=\"center\"\n          exit=\"exit\"\n          transition={{ duration: reduceMotion ? 0.2 : 0.5, ease: [0.23, 1, 0.32, 1] }}\n        >\n          {children}\n        </motion.div>\n      </AnimatePresence>\n    </div>\n  );\n}\n"
    }
  ]
}