{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "intro-loader-demo",
  "type": "registry:block",
  "title": "Intro Loader: Studio",
  "description": "Flipbook Preloader example, Studio: A studio's home page. Four projects flip past in the frame, then the fifth grows into the full-bleed hero, and the headline rises over it. Press reload in the address bar to play it again, or click to skip. A take on the preloader (loading screen). Fits preloader, hero and portfolio sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "preloader",
    "hero",
    "portfolio",
    "carousel",
    "number-counter",
    "image"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/intro-loader#intro-loader-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/intro-loader.json"
  ],
  "files": [
    {
      "path": "components/intro-loader-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n  IntroLoader,\n  IntroLoaderLine,\n  IntroLoaderTarget,\n  useIntroDone,\n} from \"@/components/ui/intro-loader\";\n\nconst image = (id: string, w: number, h: number) =>\n  `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=${w}&h=${h}&q=80`;\n\n// The last image is the hero, at the same address as the one on the page, so\n// it downloads once and lands on itself.\nconst hero = image(\"1600585154340-be6161a56a0c\", 1800, 1100);\nconst work = [\n  image(\"1561070791-2526d30994b5\", 480, 600),\n  image(\"1487958449943-2429e8be8625\", 480, 600),\n  image(\"1585386959984-a4155224a1ad\", 480, 600),\n  image(\"1505740420928-5e560c06d30e\", 480, 600),\n  hero,\n];\n\n// The reload button plays it again by remounting it with a new key. On a real\n// site, drop `contained` and `once={false}`: it covers the screen, once per\n// visit.\nexport function IntroLoaderDemo() {\n  const [run, setRun] = React.useState(0);\n\n  return (\n    <div className=\"flex h-[var(--demo-height,36rem)] w-full flex-col 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      <BrowserBar url=\"nord.studio\" run={run} onReload={() => setRun((r) => r + 1)} />\n      <IntroLoader\n        key={run}\n        contained\n        once={false}\n        images={work}\n        // Set like the logo in the header, so the page's logo takes its place.\n        brand={<span className=\"text-sm leading-5 font-semibold tracking-tight\">Nord Studio</span>}\n        className=\"@container flex min-h-0 flex-1 flex-col\"\n      >\n        <header className=\"flex items-start justify-between gap-6 px-5 pt-5 text-sm leading-5 sm:px-8 sm:pt-8\">\n          <span className=\"font-semibold tracking-tight\">Nord Studio</span>\n          <nav className=\"flex gap-5 sm:gap-7\">\n            {[\"Work\", \"About\", \"Contact\"].map((item) => (\n              <IntroLoaderLine key={item} from=\"above\">\n                <a\n                  href={`#${item.toLowerCase()}`}\n                  className=\"text-zinc-600 transition-colors duration-150 hover:text-zinc-950 dark:text-zinc-400 dark:hover:text-zinc-50\"\n                >\n                  {item}\n                </a>\n              </IntroLoaderLine>\n            ))}\n          </nav>\n        </header>\n\n        <section className=\"relative mt-5 min-h-0 flex-1 overflow-hidden sm:mt-8\">\n          <IntroLoaderTarget>\n            <img\n              src={hero}\n              alt=\"A dark timber house lit from inside at dusk, behind a eucalyptus tree\"\n              className=\"absolute inset-0 size-full object-cover\"\n            />\n          </IntroLoaderTarget>\n          <Scrim />\n          <div className=\"relative flex h-full flex-col justify-end p-5 text-white sm:p-8\">\n            <h1 className=\"text-[clamp(2.25rem,7cqw,5.5rem)] leading-[0.95] font-semibold tracking-[-0.045em]\">\n              <IntroLoaderLine>We design things</IntroLoaderLine>{\" \"}\n              <IntroLoaderLine>people remember</IntroLoaderLine>\n            </h1>\n            <div className=\"mt-4 flex items-end justify-between gap-6 text-sm text-white/75 sm:mt-6\">\n              <IntroLoaderLine className=\"max-w-xs text-pretty\">\n                Identity, products and spaces for companies that care how things feel.\n              </IntroLoaderLine>\n              <IntroLoaderLine className=\"hidden shrink-0 tabular-nums @xl:block\">\n                Halden House, 2026\n              </IntroLoaderLine>\n            </div>\n          </div>\n        </section>\n      </IntroLoader>\n    </div>\n  );\n}\n\n/**\n * Darkens the bottom of the hero for the headline. It isn't part of the image\n * the loader lands, so it waits for the handoff and fades in after it.\n */\nfunction Scrim() {\n  const done = useIntroDone();\n  return (\n    <div\n      aria-hidden\n      className={`absolute inset-0 bg-linear-to-t from-black/55 via-black/10 to-transparent to-60% transition-opacity duration-700 ease-out ${done ? \"opacity-100\" : \"opacity-0\"}`}\n    />\n  );\n}\n\nfunction BrowserBar({ url, run, onReload }: { url: string; run: number; onReload: () => void }) {\n  return (\n    <div className=\"flex h-10 shrink-0 items-center gap-3 border-b border-zinc-200 bg-white/60 px-3 dark:border-zinc-800 dark:bg-zinc-900/60\">\n      <div aria-hidden className=\"flex gap-1.5\">\n        {[0, 1, 2].map((dot) => (\n          <span key={dot} className=\"size-2.5 rounded-full bg-zinc-300 dark:bg-zinc-700\" />\n        ))}\n      </div>\n      <button\n        type=\"button\"\n        onClick={onReload}\n        aria-label=\"Reload to play it again\"\n        title=\"Play again\"\n        className=\"grid size-7 place-items-center rounded-md text-zinc-500 transition-[background-color,color,scale] duration-150 hover:bg-zinc-200/70 hover:text-zinc-900 active:scale-[0.94] dark:hover:bg-zinc-800 dark:hover:text-zinc-100\"\n      >\n        <svg\n          viewBox=\"0 0 16 16\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"1.5\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          className=\"size-3.5 transition-[rotate] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]\"\n          style={{ rotate: `${run * 360}deg` }}\n        >\n          <path d=\"M13.5 8a5.5 5.5 0 1 1-1.6-3.9\" />\n          <path d=\"M13.5 2.5v3h-3\" />\n        </svg>\n      </button>\n      <span className=\"mx-auto truncate rounded-md bg-zinc-100 px-3 py-1 font-mono text-[11px] text-zinc-500 dark:bg-zinc-800/80 dark:text-zinc-400\">\n        {url}\n      </span>\n      <span aria-hidden className=\"w-[4.75rem]\" />\n    </div>\n  );\n}\n"
    }
  ]
}