{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blueprint-demo",
  "type": "registry:block",
  "title": "Blueprint: Site Builder",
  "description": "Wireframe Build Animation example, Site Builder: An AI site builder's hero. A prompt types itself into the field, Enter goes down, and the field docks in the corner as the page builds beneath it. Each loop is a new prompt with different copy, colors and photos in the same layout, swapped in through `onLoop`, so the same wireframe turns into a different site. Hover to pause it. A take on the wireframe (skeleton) and scroll animation (on scroll). Fits features, hero and portfolio sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "hero",
    "portfolio",
    "wireframe",
    "scroll-animation",
    "layout",
    "scroll",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/blueprint#blueprint-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/blueprint.json"
  ],
  "files": [
    {
      "path": "components/blueprint-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { animate, motion, useMotionValue, useReducedMotion, useTransform } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Blueprint } from \"@/components/ui/blueprint\";\n\ntype Site = {\n  prompt: string;\n  domain: string;\n  brand: string;\n  nav: string[];\n  eyebrow: string;\n  title: string;\n  text: string;\n  primary: string;\n  secondary: string;\n  photo: string;\n  alt: string;\n  note: string;\n  /** [light, dark] */\n  paper: [string, string];\n  ink: [string, string];\n  accent: [string, string];\n};\n\nconst sites: Site[] = [\n  {\n    prompt: \"A site for a ceramics studio in Lisbon\",\n    domain: \"barro.studio\",\n    brand: \"Barro\",\n    nav: [\"Shop\", \"Classes\", \"Visit\"],\n    eyebrow: \"Ceramics studio · Lisbon\",\n    title: \"Pottery for slow mornings\",\n    text: \"Hand-thrown in Alfama, fired twice, and made to be used every day, not saved for guests.\",\n    primary: \"Visit the studio\",\n    secondary: \"Shop bowls\",\n    photo: \"1610701596061-2ecf227e85b2\",\n    alt: \"Stoneware bowls and cups on a wooden table\",\n    note: \"Wheel classes every Saturday\",\n    paper: [\"#f6f1ea\", \"#1c1714\"],\n    ink: [\"#2b211c\", \"#f3ebe3\"],\n    accent: [\"#b4532a\", \"#e0875c\"],\n  },\n  {\n    prompt: \"A site for an architecture studio in Oslo\",\n    domain: \"fjell.no\",\n    brand: \"Fjell\",\n    nav: [\"Projects\", \"Studio\", \"Contact\"],\n    eyebrow: \"Architecture · Oslo\",\n    title: \"Quiet houses for long winters\",\n    text: \"Timber homes that hold the heat, frame the low light, and settle into the land around them.\",\n    primary: \"See the houses\",\n    secondary: \"Our approach\",\n    photo: \"1600585154340-be6161a56a0c\",\n    alt: \"A timber and glass house lit up at dusk\",\n    note: \"Twelve houses since 2014\",\n    paper: [\"#eef1ee\", \"#121816\"],\n    ink: [\"#18221f\", \"#e6ece9\"],\n    accent: [\"#2f5d50\", \"#7fb8a5\"],\n  },\n  {\n    prompt: \"A landing page for a wine bar in Copenhagen\",\n    domain: \"lillevin.dk\",\n    brand: \"Lille Vin\",\n    nav: [\"Wines\", \"Kitchen\", \"Book\"],\n    eyebrow: \"Natural wine · Copenhagen\",\n    title: \"Small growers, long tables\",\n    text: \"Sixty bottles from people who farm by hand, poured by the glass with plates to share.\",\n    primary: \"Book a table\",\n    secondary: \"This week's list\",\n    photo: \"1510812431401-41d2bd2722f3\",\n    alt: \"Friends raising glasses of red wine\",\n    note: \"Open late, Wednesday to Sunday\",\n    paper: [\"#f7efef\", \"#1d1214\"],\n    ink: [\"#2a1418\", \"#f3e6e8\"],\n    accent: [\"#7a1f3d\", \"#e07a9a\"],\n  },\n];\n\nconst faces = [\"1438761681033-6461ffad8d80\", \"1500648767791-00dcc994a43e\", \"1534528741775-53994a69daeb\"];\n\nconst photo = (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 prompt types while the loop rests on the wireframe, so the rest is long enough to hold it.\nconst TIMING = { build: 5, hold: 2.5, unbuild: 1, rest: 3.4 };\nconst TYPE = { delay: 0.45, perChar: 0.032, pause: 0.3, press: 0.22 }; // s\nconst DOCK = { type: \"spring\", visualDuration: 0.45, bounce: 0.12 } as const;\n\ntype Phase = \"typing\" | \"sent\" | \"docked\";\n\nexport function BlueprintDemo() {\n  const reduced = useReducedMotion();\n  const [loop, setLoop] = React.useState(0);\n  const [site, setSite] = React.useState(0);\n  const [phase, setPhase] = React.useState<Phase>(\"typing\");\n  const prompt = sites[loop % sites.length].prompt;\n\n  React.useEffect(() => {\n    for (const s of sites) {\n      const img = new Image();\n      img.src = photo(s.photo, 640, 800);\n    }\n  }, []);\n\n  // Each loop: the next prompt types in, Enter goes down, the page swaps to the new site's copy\n  // (the wireframe re-measures under it) and the field docks in the corner before the build.\n  React.useEffect(() => {\n    const at = (s: number, run: () => void) => window.setTimeout(run, s * 1000);\n    const typed = TYPE.delay + prompt.length * TYPE.perChar + TYPE.pause;\n    const timers = reduced\n      ? [at(0, () => setPhase(\"docked\"))]\n      : [\n          at(0, () => setPhase(\"typing\")),\n          at(typed, () => setPhase(\"sent\")),\n          at(typed + TYPE.press, () => {\n            setSite(loop % sites.length);\n            setPhase(\"docked\");\n          }),\n        ];\n    return () => timers.forEach((id) => window.clearTimeout(id));\n  }, [loop, prompt, reduced]);\n\n  const current = sites[site];\n\n  return (\n    <div className=\"w-full max-w-3xl overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-xl shadow-zinc-900/5 dark:border-zinc-800 dark:bg-zinc-900 dark:shadow-black/30\">\n      <div className=\"flex items-center gap-3 border-b border-zinc-200 px-4 py-2.5 dark:border-zinc-800\">\n        <div className=\"flex gap-1.5\">\n          <span className=\"size-2.5 rounded-full bg-zinc-200 dark:bg-zinc-700\" />\n          <span className=\"size-2.5 rounded-full bg-zinc-200 dark:bg-zinc-700\" />\n          <span className=\"size-2.5 rounded-full bg-zinc-200 dark:bg-zinc-700\" />\n        </div>\n        <div className=\"mx-auto flex min-w-0 items-center gap-1.5 rounded-md bg-zinc-100 px-3 py-1 font-mono text-[11px] text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400\">\n          <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" className=\"size-3 shrink-0\" aria-hidden>\n            <path d=\"M5 7V5a3 3 0 1 1 6 0v2h.5A1.5 1.5 0 0 1 13 8.5v4a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 12.5v-4A1.5 1.5 0 0 1 4.5 7H5Zm1.5 0h3V5a1.5 1.5 0 0 0-3 0v2Z\" />\n          </svg>\n          <span className=\"truncate\">{current.domain}</span>\n        </div>\n        <span className=\"w-10\" />\n      </div>\n\n      <div className=\"relative\">\n        <Blueprint play=\"auto\" duration={TIMING} onLoop={setLoop}>\n          <SitePage site={current} />\n        </Blueprint>\n        <PromptBar text={prompt} phase={phase} />\n      </div>\n    </div>\n  );\n}\n\nfunction SitePage({ site }: { site: Site }) {\n  const palette = {\n    \"--paper\": site.paper[0],\n    \"--paper-dark\": site.paper[1],\n    \"--ink\": site.ink[0],\n    \"--ink-dark\": site.ink[1],\n    \"--accent\": site.accent[0],\n    \"--accent-dark\": site.accent[1],\n  } as React.CSSProperties;\n\n  return (\n    <div\n      data-blueprint=\"box\"\n      data-blueprint-label=\"Page\"\n      style={palette}\n      className=\"flex flex-col bg-[var(--paper)] px-6 pt-5 pb-8 text-[var(--ink)] sm:min-h-[27rem] sm:px-8 dark:bg-[var(--paper-dark)] dark:text-[var(--ink-dark)]\"\n    >\n      <header className=\"flex items-center justify-between gap-4\">\n        <span data-blueprint className=\"text-sm font-semibold tracking-tight\">\n          {site.brand}\n        </span>\n        <nav data-blueprint=\"text\" className=\"flex items-center gap-6 text-xs opacity-75\">\n          {site.nav.map((item) => (\n            <span key={item}>{item}</span>\n          ))}\n        </nav>\n      </header>\n\n      <div className=\"mt-8 grid flex-1 items-center gap-8 sm:grid-cols-[1.15fr_1fr]\">\n        <div>\n          <p\n            data-blueprint\n            className=\"text-[11px] font-medium tracking-[0.16em] text-[var(--accent)] uppercase dark:text-[var(--accent-dark)]\"\n          >\n            {site.eyebrow}\n          </p>\n          <h1 data-blueprint className=\"mt-3 text-3xl/[1.08] font-semibold tracking-tight text-balance sm:text-[2.5rem]/[1.05]\">\n            {site.title}\n          </h1>\n          <p data-blueprint className=\"mt-4 max-w-sm text-sm/6 text-pretty opacity-75\">\n            {site.text}\n          </p>\n          <div className=\"mt-6 flex flex-wrap gap-2.5\">\n            <a\n              data-blueprint\n              href=\"#visit\"\n              className=\"inline-flex rounded-full bg-[var(--accent)] px-4 py-2 text-sm font-medium text-[var(--paper)] dark:bg-[var(--accent-dark)] dark:text-[var(--paper-dark)]\"\n            >\n              {site.primary}\n            </a>\n            <a\n              data-blueprint\n              href=\"#shop\"\n              className=\"inline-flex rounded-full border border-current/20 px-4 py-2 text-sm font-medium\"\n            >\n              {site.secondary}\n            </a>\n          </div>\n          <div className=\"mt-8 flex items-center gap-3\">\n            <div className=\"flex -space-x-2\">\n              {faces.map((face) => (\n                <img\n                  key={face}\n                  data-blueprint\n                  src={photo(face, 96, 96)}\n                  alt=\"\"\n                  className=\"size-7 rounded-full object-cover ring-2 ring-[var(--paper)] dark:ring-[var(--paper-dark)]\"\n                />\n              ))}\n            </div>\n            <p data-blueprint className=\"text-xs opacity-70\">\n              {site.note}\n            </p>\n          </div>\n        </div>\n        <img\n          data-blueprint\n          src={photo(site.photo, 640, 800)}\n          alt={site.alt}\n          className=\"aspect-[4/3] w-full rounded-2xl object-cover sm:aspect-[4/5]\"\n        />\n      </div>\n    </div>\n  );\n}\n\nfunction PromptBar({ text, phase }: { text: string; phase: Phase }) {\n  const count = useMotionValue(0);\n  const typed = useTransform(count, (c): string => text.slice(0, Math.round(c)));\n  const placeholder = useTransform(count, (c): string => (c < 0.5 ? \"Describe a site…\" : \"\"));\n\n  React.useEffect(() => {\n    if (phase !== \"typing\") {\n      count.jump(text.length);\n      return;\n    }\n    count.jump(0);\n    const controls = animate(count, text.length, {\n      delay: TYPE.delay,\n      duration: text.length * TYPE.perChar,\n      ease: \"linear\",\n    });\n    return () => controls.stop();\n  }, [phase, text, count]);\n\n  const docked = phase === \"docked\";\n\n  return (\n    <div\n      className={cn(\n        \"pointer-events-none absolute inset-0 z-[60] flex p-4 sm:p-5\",\n        docked ? \"items-end justify-start\" : \"items-center justify-center\",\n      )}\n    >\n      <motion.div\n        layout\n        transition={DOCK}\n        style={{ borderRadius: docked ? 999 : 16 }}\n        className={cn(\n          \"flex items-center gap-2.5 border border-zinc-900/10 bg-white/85 text-zinc-900 shadow-lg shadow-zinc-900/10 backdrop-blur-md dark:border-white/10 dark:bg-zinc-900/85 dark:text-zinc-100 dark:shadow-black/40\",\n          docked ? \"max-w-[min(18rem,100%)] py-1.5 pr-3.5 pl-2.5\" : \"w-full max-w-md py-3 pr-3 pl-4\",\n        )}\n      >\n        <motion.svg\n          layout=\"position\"\n          viewBox=\"0 0 16 16\"\n          fill=\"currentColor\"\n          className=\"size-4 shrink-0 text-violet-500 dark:text-violet-400\"\n          aria-hidden\n        >\n          <path d=\"M8 1.5 9.6 6.4 14.5 8l-4.9 1.6L8 14.5 6.4 9.6 1.5 8l4.9-1.6L8 1.5Z\" />\n        </motion.svg>\n        <motion.span\n          layout=\"position\"\n          className={cn(\"relative min-w-0 flex-1 truncate\", docked ? \"text-xs\" : \"text-sm\")}\n        >\n          <motion.span>{typed}</motion.span>\n          <motion.span className=\"text-zinc-400 dark:text-zinc-500\">{placeholder}</motion.span>\n          {phase === \"typing\" && (\n            <span className=\"ml-px inline-block h-[1.1em] w-px translate-y-[0.2em] animate-pulse bg-current\" />\n          )}\n        </motion.span>\n        {!docked && (\n          <motion.kbd\n            layout=\"position\"\n            animate={phase === \"sent\" ? { scale: 0.88, y: 1 } : { scale: 1, y: 0 }}\n            transition={{ type: \"spring\", visualDuration: 0.15, bounce: 0.3 }}\n            className={cn(\n              \"grid size-7 shrink-0 place-items-center rounded-lg border font-sans text-sm transition-colors\",\n              phase === \"sent\"\n                ? \"border-violet-500 bg-violet-500 text-white\"\n                : \"border-zinc-900/10 bg-zinc-900/5 text-zinc-500 dark:border-white/10 dark:bg-white/5 dark:text-zinc-400\",\n            )}\n          >\n            ↵\n          </motion.kbd>\n        )}\n      </motion.div>\n    </div>\n  );\n}\n"
    }
  ]
}