{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "golden-grid-demo",
  "type": "registry:block",
  "title": "Golden Grid: Magazine Stories",
  "description": "Fibonacci Bento Grid example, Magazine Stories: A coast magazine's stories of the week, with the featured story's section, headline and read time under the grid, and previous, next and pause buttons. A take on the spiral gallery (spiral carousel) and image gallery (photo gallery). Fits portfolio, features and team sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "portfolio",
    "features",
    "team",
    "spiral-gallery",
    "image-gallery",
    "gallery",
    "layout",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/golden-grid#golden-grid-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/golden-grid.json"
  ],
  "files": [
    {
      "path": "components/golden-grid-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { GoldenGrid } from \"@/components/ui/golden-grid\";\n\nconst photo = (id: string) =>\n  `https://images.unsplash.com/photo-${id}?auto=format&fit=crop&w=900&h=900&q=80`;\n\nconst STORIES = [\n  {\n    src: photo(\"1784241905576-a9a4dd18b05f\"),\n    alt: \"White wooden houses and small boats along a calm harbor\",\n    kicker: \"Travel\",\n    title: \"A summer of ferries between the skerries\",\n    meta: \"12 min read\",\n  },\n  {\n    src: photo(\"1772988657655-716d1fe75b1d\"),\n    alt: \"Paper cones of red, white and purple tulips at a market stall\",\n    kicker: \"Markets\",\n    title: \"Tulip Saturday, from the first van to the last bunch\",\n    meta: \"8 min read\",\n  },\n  {\n    src: photo(\"1768236360495-8c32c6645590\"),\n    alt: \"Slices of lemon tart topped with raspberries and cream\",\n    kicker: \"Food\",\n    title: \"The lemon tart that sells out before nine\",\n    meta: \"6 min read\",\n  },\n  {\n    src: photo(\"1723717275425-eb4a16b5d2da\"),\n    alt: \"Hands shaping clay on a potter's wheel\",\n    kicker: \"Craft\",\n    title: \"Throwing bowls with the last potter on the pier\",\n    meta: \"10 min read\",\n  },\n  {\n    src: photo(\"1759327939880-d28ee3653331\"),\n    alt: \"A long row of white beach huts with green roofs along a path\",\n    kicker: \"Places\",\n    title: \"Two hundred huts and one waiting list\",\n    meta: \"7 min read\",\n  },\n  {\n    src: photo(\"1762357672788-6f3578e1577a\"),\n    alt: \"Pastel houses reflected in a harbor under autumn trees\",\n    kicker: \"Travel\",\n    title: \"Off season in the pastel harbor\",\n    meta: \"9 min read\",\n  },\n  {\n    src: photo(\"1777138203981-8513ee875cd4\"),\n    alt: \"Buckets of flowers outside a small shop with a striped doorway\",\n    kicker: \"Shops\",\n    title: \"A florist who only sells what grew this week\",\n    meta: \"5 min read\",\n  },\n];\n\nconst iconButton =\n  \"grid size-10 place-items-center rounded-full border border-zinc-200 transition-colors hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:border-zinc-800 dark:hover:bg-zinc-900 dark:focus-visible:outline-white\";\n\nexport function GoldenGridDemo() {\n  const [index, setIndex] = React.useState(0);\n  const [paused, setPaused] = React.useState(false);\n  const captionRef = React.useRef<HTMLDivElement>(null);\n  const story = STORIES[index];\n  const count = STORIES.length;\n\n  // The caption rises in with each new featured story.\n  React.useEffect(() => {\n    captionRef.current?.animate(\n      [\n        { opacity: 0, transform: \"translateY(6px)\" },\n        { opacity: 1, transform: \"none\" },\n      ],\n      { duration: 320, easing: \"cubic-bezier(0.22, 1, 0.36, 1)\" },\n    );\n  }, [index]);\n\n  return (\n    <section className=\"mx-auto w-full max-w-3xl rounded-2xl border border-zinc-200 bg-white p-4 text-zinc-950 sm:p-6 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\">\n      <div className=\"mb-5 flex items-end justify-between gap-4 px-1\">\n        <div>\n          <p className=\"text-xs font-medium tracking-[0.14em] text-zinc-500 uppercase dark:text-zinc-400\">\n            Saltmarsh · This week\n          </p>\n          <h3 className=\"mt-2 text-2xl leading-tight font-semibold tracking-[-0.03em] text-balance sm:text-[1.75rem]\">\n            Slow weekends on the coast.\n          </h3>\n        </div>\n        <a\n          href=\"https://saltmarsh.example/latest\"\n          className=\"hidden shrink-0 text-sm font-medium underline decoration-zinc-300 underline-offset-4 transition-colors hover:decoration-current focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 sm:block dark:decoration-zinc-700 dark:focus-visible:outline-white\"\n        >\n          All stories\n        </a>\n      </div>\n\n      <GoldenGrid\n        items={STORIES}\n        index={index}\n        onIndexChange={setIndex}\n        paused={paused}\n        label=\"Saltmarsh stories this week\"\n        className=\"rounded-xl text-white\"\n      />\n\n      <div className=\"mt-5 flex flex-col gap-4 px-1 sm:flex-row sm:items-end sm:justify-between\">\n        <div ref={captionRef} className=\"max-w-md\">\n          <p className=\"text-xs font-semibold tracking-[0.12em] text-[#c2410c] uppercase dark:text-[#ff7a52]\">\n            {story.kicker}\n          </p>\n          <p className=\"mt-1.5 text-lg leading-snug font-semibold tracking-[-0.02em] text-balance\">\n            <a\n              href=\"https://saltmarsh.example/latest\"\n              className=\"rounded-sm hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:focus-visible:outline-white\"\n            >\n              {story.title}\n            </a>\n          </p>\n          <p className=\"mt-1 font-mono text-xs text-zinc-500 tabular-nums dark:text-zinc-400\">\n            {String(index + 1).padStart(2, \"0\")} / {String(count).padStart(2, \"0\")} · {story.meta}\n          </p>\n        </div>\n        <div className=\"flex items-center gap-2\">\n          <button type=\"button\" aria-label=\"Previous story\" onClick={() => setIndex((i) => (i - 1 + count) % count)} className={iconButton}>\n            <svg viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" aria-hidden>\n              <path d=\"M10 3.5 5.5 8l4.5 4.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n            </svg>\n          </button>\n          <button type=\"button\" aria-label=\"Next story\" onClick={() => setIndex((i) => (i + 1) % count)} className={iconButton}>\n            <svg viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" aria-hidden>\n              <path d=\"M6 3.5 10.5 8 6 12.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n            </svg>\n          </button>\n          <button\n            type=\"button\"\n            aria-label={paused ? \"Play the stories\" : \"Pause the stories\"}\n            aria-pressed={paused}\n            onClick={() => setPaused((p) => !p)}\n            className={iconButton}\n          >\n            {paused ? (\n              <svg viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"currentColor\" aria-hidden>\n                <path d=\"M5 3.2v9.6a.5.5 0 0 0 .77.42l7.2-4.8a.5.5 0 0 0 0-.84l-7.2-4.8A.5.5 0 0 0 5 3.2Z\" />\n              </svg>\n            ) : (\n              <svg viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"currentColor\" aria-hidden>\n                <rect x=\"4\" y=\"3\" width=\"2.6\" height=\"10\" rx=\"0.8\" />\n                <rect x=\"9.4\" y=\"3\" width=\"2.6\" height=\"10\" rx=\"0.8\" />\n              </svg>\n            )}\n          </button>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}