{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "expanding-hero-demo",
  "type": "registry:block",
  "title": "Expanding Hero: Studio Reel",
  "description": "Scroll Video Hero example, Studio Reel: A motion studio's showreel opens out of the headline. Once it fills the box, a button plays the film full screen. A take on the video (video player) and scroll animation (on scroll). Fits hero, portfolio and events sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "portfolio",
    "events",
    "video",
    "scroll-animation",
    "scroll"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/expanding-hero#expanding-hero-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/expanding-hero.json"
  ],
  "files": [
    {
      "path": "components/expanding-hero-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { ExpandingHero } from \"@/components/ui/expanding-hero\";\n\nconst reel = \"https://assets.mixkit.co/videos/44818/44818-720.mp4\";\nconst poster = \"https://assets.mixkit.co/videos/44818/44818-thumb-720-0.jpg\";\n\nconst work = [\n  { client: \"Lumen\", kind: \"Brand film\", year: 2026 },\n  { client: \"Parcel\", kind: \"Product launch\", year: 2025 },\n  { client: \"Halcyon\", kind: \"Title sequence\", year: 2025 },\n  { client: \"Fieldnote\", kind: \"Explainer series\", year: 2024 },\n];\n\n// For a full-page hero, drop the scroll box, `containerRef` and\n// `stageClassName`: the stage fills the window and pins while the page scrolls.\nexport function ExpandingHeroDemo() {\n  const scrollRef = React.useRef<HTMLDivElement>(null);\n  const reelRef = React.useRef<HTMLVideoElement>(null);\n\n  return (\n    <div className=\"relative w-full overflow-hidden rounded-xl border border-zinc-200 bg-[#f4f3ef] text-zinc-950 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\">\n      <div ref={scrollRef} className=\"relative h-[var(--demo-height,36rem)] overflow-y-auto overscroll-contain\">\n        <ExpandingHero\n          containerRef={scrollRef}\n          stageClassName=\"h-[var(--demo-height,36rem)]\"\n          before=\"Make things\"\n          after=\"that move\"\n          media={\n            <video\n              ref={reelRef}\n              src={reel}\n              poster={poster}\n              autoPlay\n              muted\n              loop\n              playsInline\n              className=\"dark:invert\"\n            />\n          }\n          overlay={\n            <button\n              type=\"button\"\n              onClick={() => watch(reelRef.current)}\n              className=\"flex items-center gap-3 rounded-full bg-white/85 py-2 pr-5 pl-2 text-sm font-medium shadow-lg ring-1 shadow-black/10 ring-black/5 backdrop-blur-md transition-transform duration-150 ease-out active:scale-[0.97] dark:bg-zinc-900/80 dark:ring-white/10\"\n            >\n              <span className=\"grid size-8 place-items-center rounded-full bg-zinc-950 text-white dark:bg-white dark:text-zinc-950\">\n                <PlayIcon />\n              </span>\n              Watch the film\n            </button>\n          }\n        >\n          <p className=\"text-base text-zinc-600 sm:text-lg dark:text-zinc-400\">\n            A studio for motion design\n          </p>\n          <a\n            href=\"#contact\"\n            className=\"rounded-full bg-zinc-950 px-5 py-2.5 text-sm font-medium text-white transition-[background-color,scale] duration-150 ease-out hover:bg-zinc-800 active:scale-[0.97] dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200\"\n          >\n            Get in touch\n          </a>\n        </ExpandingHero>\n\n        <section className=\"mx-auto max-w-3xl px-6 py-16 sm:py-24\">\n          <div className=\"flex items-baseline justify-between text-sm text-zinc-500\">\n            <h2 className=\"font-medium text-zinc-950 dark:text-zinc-50\">Selected work</h2>\n            <span className=\"tabular-nums\">2024–2026</span>\n          </div>\n          <ul className=\"mt-6 border-t border-zinc-950/10 dark:border-white/10\">\n            {work.map((item) => (\n              <li\n                key={item.client}\n                className=\"grid grid-cols-[1fr_auto] items-baseline gap-x-6 border-b border-zinc-950/10 py-4 sm:grid-cols-[1fr_1fr_auto] dark:border-white/10\"\n              >\n                <span className=\"text-lg font-medium tracking-tight sm:text-xl\">{item.client}</span>\n                <span className=\"hidden text-sm text-zinc-500 sm:block\">{item.kind}</span>\n                <span className=\"text-sm text-zinc-500 tabular-nums\">{item.year}</span>\n              </li>\n            ))}\n          </ul>\n        </section>\n      </div>\n    </div>\n  );\n}\n\n/** Plays the reel from the top, full screen. */\nfunction watch(video: HTMLVideoElement | null) {\n  if (!video) return;\n  video.currentTime = 0;\n  void video.play();\n  if (video.requestFullscreen) void video.requestFullscreen();\n  else (video as HTMLVideoElement & { webkitEnterFullscreen?: () => void }).webkitEnterFullscreen?.();\n}\n\nfunction PlayIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\" aria-hidden className=\"ml-0.5 size-3 fill-current\">\n      <path d=\"M4 2.6v10.8a.6.6 0 0 0 .9.5l8.6-5.4a.6.6 0 0 0 0-1L4.9 2.1a.6.6 0 0 0-.9.5Z\" />\n    </svg>\n  );\n}\n"
    }
  ]
}