{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gallery-09",
  "type": "registry:block",
  "description": "Square thumbnail grid that opens a fullscreen lightbox with keyboard and arrow navigation.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/gallery/gallery-09.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport {\n  ChevronLeft,\n  ChevronRight,\n  Expand,\n  X,\n} from \"@designali/icons\"\n\nimport { Button } from \"@workspace/ui/components/button\"\n\nconst photos = [\n  { title: \"Glass Spheres\", camera: \"CGI render\", gradient: 'url(\"/img/ask/ask1.jpg\") center / cover' },\n  { title: \"Liquid Chrome\", camera: \"3D study\", gradient: 'url(\"/img/ask/ask2.jpg\") center / cover' },\n  { title: \"Soft Light\", camera: \"Motion frame\", gradient: 'url(\"/img/ask/ask3.jpg\") center / cover' },\n  { title: \"Folded Form\", camera: \"Abstract render\", gradient: 'url(\"/img/ask/ask4.jpg\") center / cover' },\n  { title: \"Pale Shore\", camera: \"Colour study\", gradient: 'url(\"/img/ask/ask5.jpg\") center / cover' },\n  { title: \"Night Bloom\", camera: \"CGI render\", gradient: 'url(\"/img/ask/ask6.jpg\") center / cover' },\n  { title: \"Iron Bridge\", camera: \"3D study\", gradient: 'url(\"/img/ask/ask7.jpg\") center / cover' },\n  { title: \"Fog Line\", camera: \"Motion frame\", gradient: 'url(\"/img/ask/ask8.jpg\") center / cover' },\n]\n\nexport default function Gallery09() {\n  const [open, setOpen] = useState<number | null>(null)\n\n  const step = (dir: number) =>\n    setOpen((i) => (i === null ? i : (i + dir + photos.length) % photos.length))\n\n  const isOpen = open !== null\n\n  useEffect(() => {\n    if (!isOpen) return\n    const move = (dir: number) =>\n      setOpen((i) => (i === null ? i : (i + dir + photos.length) % photos.length))\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") setOpen(null)\n      if (e.key === \"ArrowRight\") move(1)\n      if (e.key === \"ArrowLeft\") move(-1)\n    }\n    window.addEventListener(\"keydown\", onKey)\n    return () => window.removeEventListener(\"keydown\", onKey)\n  }, [isOpen])\n\n  const active = open === null ? null : photos[open]!\n\n  return (\n    <section className=\"w-full bg-background py-20\">\n      <div className=\"mx-auto max-w-7xl px-6\">\n        <div className=\"max-w-xl\">\n          <h2 className=\"text-3xl font-semibold tracking-tight md:text-4xl\">\n            The Designali Visuals Collection\n          </h2>\n          <p className=\"mt-3 text-muted-foreground\">\n            Eight CGI and 3D pieces by Ali Imam. Click any frame to view it\n            full screen, use the arrow keys to move between them.\n          </p>\n        </div>\n        <div className=\"mt-10 grid grid-cols-2 gap-2 md:grid-cols-4\">\n          {photos.map((photo, i) => (\n            <button\n              key={photo.title}\n              type=\"button\"\n              onClick={() => setOpen(i)}\n              className=\"group relative aspect-square overflow-hidden border border-border text-left outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n            >\n              <div className=\"absolute inset-0\" style={{ background: photo.gradient }} />\n              <div className=\"absolute inset-0 flex items-end justify-between bg-gradient-to-t from-black/60 to-transparent p-3 text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100\">\n                <span className=\"text-sm font-medium\">{photo.title}</span>\n                <Expand className=\"size-4\" />\n              </div>\n            </button>\n          ))}\n        </div>\n      </div>\n\n      {active && open !== null && (\n        <div\n          role=\"dialog\"\n          aria-modal=\"true\"\n          aria-label={active.title}\n          className=\"fixed inset-0 z-50 flex flex-col bg-black/90 p-4 text-white backdrop-blur-sm md:p-8\"\n          onClick={() => setOpen(null)}\n        >\n          <div className=\"flex items-center justify-between text-sm\">\n            <span className=\"font-sans tabular-nums\">\n              {open + 1} / {photos.length}\n            </span>\n            <button\n              type=\"button\"\n              aria-label=\"Close\"\n              className=\"flex size-9 items-center justify-center border border-white/20 hover:bg-white/10\"\n              onClick={() => setOpen(null)}\n            >\n              <X className=\"size-4\" />\n            </button>\n          </div>\n          <div\n            className=\"relative mx-auto my-6 flex w-full max-w-4xl flex-1 items-center\"\n            onClick={(e) => e.stopPropagation()}\n          >\n            <div className=\"aspect-[4/3] max-h-full w-full border border-white/10\" style={{ background: active.gradient }} />\n            <Button\n              variant=\"outline\"\n              size=\"icon-lg\"\n              aria-label=\"Previous photo\"\n              className=\"absolute left-2 border-white/20 bg-black/50 text-white hover:bg-black/70 hover:text-white\"\n              onClick={() => step(-1)}\n            >\n              <ChevronLeft />\n            </Button>\n            <Button\n              variant=\"outline\"\n              size=\"icon-lg\"\n              aria-label=\"Next photo\"\n              className=\"absolute right-2 border-white/20 bg-black/50 text-white hover:bg-black/70 hover:text-white\"\n              onClick={() => step(1)}\n            >\n              <ChevronRight />\n            </Button>\n          </div>\n          <div className=\"text-center\">\n            <p className=\"font-medium\">{active.title}</p>\n            <p className=\"mt-1 text-xs text-white/60\">{active.camera}</p>\n          </div>\n        </div>\n      )}\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "700px"
  },
  "categories": [
    "gallery"
  ]
}