{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "floating-photo-wall",
  "title": "Floating Photo Wall",
  "description": "An endless wall of photos floating on three depth layers that slide at different speeds: drag with inertia, an idle drift, pointer parallax, a hovered card that lifts while the rest dim, and a captioned lightbox.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/floating-photo-wall/floating-photo-wall.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface FloatingPhoto {\n  src: string;\n  alt?: string;\n  title?: string;\n  /** Width / height of the card. */\n  ratio?: number;\n}\n\nexport type FloatingPhotoWallTheme = \"dark\" | \"light\";\n\nexport interface FloatingPhotoWallProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  photos?: FloatingPhoto[];\n  theme?: FloatingPhotoWallTheme;\n  height?: number;\n  /** Width of a near card in px; the two farther layers are smaller. */\n  cardSize?: number;\n  /** Idle drift in px per second; 0 keeps the wall still until dragged. */\n  drift?: number;\n  /** How far the layers shift with the pointer, in px. */\n  parallax?: number;\n  /** 0–1, how quickly the wall catches up. */\n  smoothing?: number;\n  borderRadius?: number;\n  /** Opacity of the other cards while one is hovered. */\n  dimOpacity?: number;\n  showHint?: boolean;\n  enableLightbox?: boolean;\n}\n\nconst PALETTES = {\n  dark: {\n    background: \"#080808\",\n    vignette: \"radial-gradient(ellipse 75% 70% at 50% 50%, rgba(8,8,8,0) 55%, rgba(8,8,8,0.85) 100%)\",\n    tile: \"#141414\",\n    text: \"rgba(255,255,255,0.88)\",\n    muted: \"rgba(255,255,255,0.45)\",\n    line: \"rgba(255,255,255,0.5)\",\n    cardShadow: \"0 16px 40px rgba(0,0,0,0.55)\",\n    lightboxBackground: \"rgba(8,8,8,0.95)\",\n    controlColor: \"rgba(255,255,255,0.8)\",\n    emptyText: \"rgba(255,255,255,0.4)\",\n    emptyBorder: \"1.5px dashed rgba(255,255,255,0.15)\",\n  },\n  light: {\n    background: \"#F5F5F3\",\n    vignette: \"radial-gradient(ellipse 75% 70% at 50% 50%, rgba(245,245,243,0) 55%, rgba(245,245,243,0.85) 100%)\",\n    tile: \"#E6E6E3\",\n    text: \"rgba(0,0,0,0.85)\",\n    muted: \"rgba(0,0,0,0.45)\",\n    line: \"rgba(0,0,0,0.45)\",\n    cardShadow: \"0 16px 40px rgba(0,0,0,0.14)\",\n    lightboxBackground: \"rgba(255,255,255,0.96)\",\n    controlColor: \"rgba(0,0,0,0.75)\",\n    emptyText: \"rgba(0,0,0,0.4)\",\n    emptyBorder: \"1.5px dashed rgba(0,0,0,0.15)\",\n  },\n} as const;\n\nconst DEFAULT_PHOTOS: FloatingPhoto[] = [\n  { src: \"/demo/1.webp\", title: \"Living room\", ratio: 1.25 },\n  { src: \"/demo/41.webp\", title: \"Mei\", ratio: 0.8 },\n  { src: \"/demo/4.webp\", title: \"Kitchen\", ratio: 1.25 },\n  { src: \"/demo/42.webp\", title: \"Kenji\", ratio: 0.8 },\n  { src: \"/demo/3.webp\", title: \"Curtains\", ratio: 0.8 },\n  { src: \"/demo/6.webp\", title: \"Stair hall\", ratio: 1.25 },\n  { src: \"/demo/44.webp\", title: \"Sofia\", ratio: 0.8 },\n  { src: \"/demo/9.webp\", title: \"Bath\", ratio: 1 },\n  { src: \"/demo/43.webp\", title: \"Rafael\", ratio: 0.8 },\n  { src: \"/demo/2.webp\", title: \"Dining room\", ratio: 1.25 },\n  { src: \"/demo/45.webp\", title: \"Amara\", ratio: 0.8 },\n  { src: \"/demo/7.webp\", title: \"Pale stairwell\", ratio: 0.8 },\n  { src: \"/demo/10.webp\", title: \"Tea room\", ratio: 1.25 },\n  { src: \"/demo/46.webp\", title: \"Nia\", ratio: 0.8 },\n  { src: \"/demo/5.webp\", title: \"Reading corner\", ratio: 1.25 },\n  { src: \"/demo/55.webp\", title: \"Elin\", ratio: 0.8 },\n  { src: \"/demo/20.webp\", title: \"Last evening\", ratio: 1.25 },\n  { src: \"/demo/8.webp\", title: \"Bath, before guests\", ratio: 1 },\n];\n\n/** Near, middle and far layers: card size, how much they travel, and how much they recede. */\nconst LAYERS = [\n  { size: 0.42, speed: 0.38, opacity: 0.3, blur: 1.2, parallax: 0.3, spacing: 2.4 },\n  { size: 0.68, speed: 0.66, opacity: 0.62, blur: 0, parallax: 0.6, spacing: 2.15 },\n  { size: 1, speed: 1, opacity: 1, blur: 0, parallax: 1, spacing: 1.9 },\n];\n\nconst ASSUMED = { w: 1100, h: 600 };\n\nfunction mulberry32(seed: number) {\n  let a = seed;\n  return () => {\n    a |= 0;\n    a = (a + 0x6d2b79f5) | 0;\n    let t = Math.imul(a ^ (a >>> 15), 1 | a);\n    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n  };\n}\n\ninterface Card {\n  layer: number;\n  photo: number;\n  x: number;\n  y: number;\n  w: number;\n  h: number;\n}\n\ninterface Layout {\n  cards: Card[];\n  /** Repeat size of each layer's pattern; always wider and taller than the view, so wrapping happens off screen. */\n  period: { w: number; h: number; cell: number }[];\n}\n\nfunction buildLayout(count: number, ratios: number[], vw: number, vh: number, cardSize: number): Layout {\n  const rand = mulberry32(7);\n  const cards: Card[] = [];\n  const period: Layout[\"period\"] = [];\n  let n = 0;\n  LAYERS.forEach((layer, li) => {\n    const w = cardSize * layer.size;\n    const cell = w * layer.spacing;\n    const cols = Math.ceil((vw + cell * 1.5) / cell);\n    const rows = Math.ceil((vh + cell * 1.5) / cell);\n    period.push({ w: cols * cell, h: rows * cell, cell });\n    for (let r = 0; r < rows; r++) {\n      for (let c = 0; c < cols; c++) {\n        const photo = (n * 5 + li * 7) % count;\n        const ratio = ratios[photo] || 1;\n        // Brick offset per row plus a little jitter, so the wall never looks like a grid.\n        const x = c * cell + (r % 2 ? cell / 2 : 0) + (rand() - 0.5) * cell * 0.3;\n        const y = r * cell + (rand() - 0.5) * cell * 0.3;\n        cards.push({ layer: li, photo, x, y, w: Math.round(w), h: Math.round(w / ratio) });\n        n++;\n      }\n    }\n  });\n  return { cards, period };\n}\n\nconst mod = (v: number, m: number) => ((v % m) + m) % m;\n\nfunction place(card: Card, period: Layout[\"period\"], camX: number, camY: number, px: number, py: number) {\n  const layer = LAYERS[card.layer];\n  const p = period[card.layer];\n  const x = mod(card.x - camX * layer.speed + px * layer.parallax, p.w) - p.cell;\n  const y = mod(card.y - camY * layer.speed + py * layer.parallax, p.h) - p.cell;\n  // Fixed precision so the server and browser print the same string.\n  return `translate3d(${x.toFixed(2)}px, ${y.toFixed(2)}px, 0)`;\n}\n\nexport function FloatingPhotoWall({\n  photos = DEFAULT_PHOTOS,\n  theme = \"dark\",\n  height = 600,\n  cardSize = 230,\n  drift = 14,\n  parallax = 26,\n  smoothing = 0.08,\n  borderRadius = 3,\n  dimOpacity = 0.35,\n  showHint = true,\n  enableLightbox = true,\n  className,\n  ...props\n}: FloatingPhotoWallProps) {\n  const palette = PALETTES[theme];\n  const rootRef = React.useRef<HTMLDivElement>(null);\n  const cardRefs = React.useRef<(HTMLDivElement | null)[]>([]);\n  const veilRefs = React.useRef<(HTMLDivElement | null)[]>([]);\n  const [size, setSize] = React.useState(ASSUMED);\n  const [touched, setTouched] = React.useState(false);\n\n  const ratios = React.useMemo(() => photos.map((p) => p.ratio ?? 0.8), [photos]);\n  const s = clamp01(size.w / 900) * 0.4 + 0.6;\n  const layout = React.useMemo(() => buildLayout(Math.max(photos.length, 1), ratios, size.w, size.h, cardSize * s), [photos.length, ratios, size.w, size.h, cardSize, s]);\n\n  const cam = React.useRef({ x: 0, y: 0, tx: 0, ty: 0, vx: 0, vy: 0, px: 0, py: 0, tpx: 0, tpy: 0 });\n  const drag = React.useRef({ active: false, moved: false, x: 0, y: 0, lastT: 0, card: null as number | null });\n  const hovered = React.useRef<number | null>(null);\n  const idleSince = React.useRef(0);\n  const wakeRef = React.useRef<() => void>(() => {});\n  const optsRef = React.useRef({ layout, drift, parallax, smoothing, dimOpacity });\n  React.useEffect(() => {\n    optsRef.current = { layout, drift, parallax, smoothing, dimOpacity };\n    wakeRef.current();\n  }, [layout, drift, parallax, smoothing, dimOpacity]);\n\n  const [lightbox, setLightbox] = React.useState<number | null>(null);\n  const dialogRef = React.useRef<HTMLDivElement>(null);\n  const closeButtonRef = React.useRef<HTMLButtonElement>(null);\n  const lastFocusedRef = React.useRef<HTMLElement | null>(null);\n\n  React.useEffect(() => {\n    const el = rootRef.current;\n    if (!el) return;\n    const update = () => setSize({ w: el.clientWidth, h: el.clientHeight });\n    update();\n    const observer = new ResizeObserver(update);\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, []);\n\n  React.useEffect(() => {\n    let raf: number | null = null;\n    let last = 0;\n    let inView = true;\n    const paint = () => {\n      const { layout, dimOpacity } = optsRef.current;\n      const c = cam.current;\n      layout.cards.forEach((card, i) => {\n        const el = cardRefs.current[i];\n        if (!el) return;\n        el.style.transform = place(card, layout.period, c.x, c.y, c.px, c.py);\n        // Cards recede by fading toward the background colour under an opaque veil, not by turning\n        // see-through, so overlapping layers never muddy each other.\n        const base = LAYERS[card.layer].opacity;\n        const h = hovered.current;\n        const veil = veilRefs.current[i];\n        if (veil) veil.style.opacity = (1 - (h === null ? base : h === i ? 1 : base * dimOpacity)).toFixed(3);\n      });\n    };\n    const tick = (now: number) => {\n      const dt = last ? Math.min((now - last) / 1000, 0.05) : 1 / 60;\n      last = now;\n      const { drift, smoothing } = optsRef.current;\n      const c = cam.current;\n      if (!drag.current.active) {\n        c.tx += c.vx * dt;\n        c.ty += c.vy * dt;\n        const decay = Math.pow(0.05, dt);\n        c.vx *= decay;\n        c.vy *= decay;\n        // Drift resumes gently once the pointer has been still for a moment (and not over a card).\n        if (drift && hovered.current === null && now - idleSince.current > 1200) {\n          c.tx += drift * dt;\n          c.ty += drift * 0.45 * dt;\n        }\n      }\n      const k = 1 - Math.pow(1 - (drag.current.active ? 0.35 : smoothing), dt * 60);\n      c.x += (c.tx - c.x) * k;\n      c.y += (c.ty - c.y) * k;\n      c.px += (c.tpx - c.px) * k * 0.6;\n      c.py += (c.tpy - c.py) * k * 0.6;\n      paint();\n      const still = Math.abs(c.tx - c.x) < 0.05 && Math.abs(c.ty - c.y) < 0.05 && Math.abs(c.tpx - c.px) < 0.05 && Math.abs(c.tpy - c.py) < 0.05 && Math.abs(c.vx) < 0.5;\n      const settled = !drag.current.active && !drift && still;\n      raf = inView && !settled ? requestAnimationFrame(tick) : null;\n      if (raf === null) last = 0;\n    };\n    wakeRef.current = () => {\n      if (raf === null && inView) raf = requestAnimationFrame(tick);\n    };\n    paint();\n    raf = requestAnimationFrame(tick);\n    const observer = new IntersectionObserver(([entry]) => {\n      inView = entry.isIntersecting;\n      if (inView) wakeRef.current();\n    });\n    if (rootRef.current) observer.observe(rootRef.current);\n    return () => {\n      if (raf) cancelAnimationFrame(raf);\n      observer.disconnect();\n    };\n  }, []);\n\n  React.useEffect(() => {\n    const el = rootRef.current;\n    if (!el) return;\n    const onDown = (e: PointerEvent) => {\n      if (e.button !== 0) return;\n      const cardEl = (e.target as HTMLElement).closest<HTMLElement>(\"[data-card]\");\n      drag.current = { active: true, moved: false, x: e.clientX, y: e.clientY, lastT: e.timeStamp, card: cardEl ? Number(cardEl.dataset.card) : null };\n      cam.current.vx = 0;\n      cam.current.vy = 0;\n      el.setPointerCapture(e.pointerId);\n      wakeRef.current();\n    };\n    const onMove = (e: PointerEvent) => {\n      const rect = el.getBoundingClientRect();\n      const { parallax } = optsRef.current;\n      if (e.pointerType === \"mouse\") {\n        cam.current.tpx = -((e.clientX - rect.left) / rect.width - 0.5) * 2 * parallax;\n        cam.current.tpy = -((e.clientY - rect.top) / rect.height - 0.5) * 2 * parallax;\n      }\n      idleSince.current = performance.now();\n      const d = drag.current;\n      if (!d.active) {\n        if (e.pointerType !== \"mouse\") return;\n        const cardEl = (e.target as HTMLElement).closest<HTMLElement>(\"[data-card]\");\n        const next = cardEl ? Number(cardEl.dataset.card) : null;\n        if (next !== hovered.current) {\n          hovered.current = next;\n          el.querySelectorAll<HTMLElement>(\"[data-card]\").forEach((c) => c.toggleAttribute(\"data-hover\", Number(c.dataset.card) === next));\n        }\n        wakeRef.current();\n        return;\n      }\n      const dx = e.clientX - d.x;\n      const dy = e.clientY - d.y;\n      if (!d.moved && Math.hypot(dx, dy) < 5) return;\n      if (!d.moved) {\n        d.moved = true;\n        el.style.cursor = \"grabbing\";\n        setTouched(true);\n      }\n      const c = cam.current;\n      c.tx -= dx;\n      c.ty -= dy;\n      const dt = Math.max((e.timeStamp - d.lastT) / 1000, 0.008);\n      c.vx = c.vx * 0.5 + (-dx / dt) * 0.5;\n      c.vy = c.vy * 0.5 + (-dy / dt) * 0.5;\n      d.x = e.clientX;\n      d.y = e.clientY;\n      d.lastT = e.timeStamp;\n      wakeRef.current();\n    };\n    const onUp = (e: PointerEvent) => {\n      const d = drag.current;\n      if (!d.active) return;\n      d.active = false;\n      el.style.cursor = \"\";\n      idleSince.current = performance.now();\n      if (e.timeStamp - d.lastT > 80) {\n        cam.current.vx = 0;\n        cam.current.vy = 0;\n      }\n      if (!d.moved && d.card !== null && enableLightbox) setLightbox(optsRef.current.layout.cards[d.card].photo);\n      wakeRef.current();\n    };\n    const onLeave = () => {\n      cam.current.tpx = 0;\n      cam.current.tpy = 0;\n      if (hovered.current !== null) {\n        hovered.current = null;\n        el.querySelectorAll<HTMLElement>(\"[data-hover]\").forEach((c) => c.removeAttribute(\"data-hover\"));\n      }\n      wakeRef.current();\n    };\n    el.addEventListener(\"pointerdown\", onDown);\n    el.addEventListener(\"pointermove\", onMove);\n    el.addEventListener(\"pointerup\", onUp);\n    el.addEventListener(\"pointercancel\", onUp);\n    el.addEventListener(\"pointerleave\", onLeave);\n    return () => {\n      el.removeEventListener(\"pointerdown\", onDown);\n      el.removeEventListener(\"pointermove\", onMove);\n      el.removeEventListener(\"pointerup\", onUp);\n      el.removeEventListener(\"pointercancel\", onUp);\n      el.removeEventListener(\"pointerleave\", onLeave);\n    };\n  }, [enableLightbox]);\n\n  React.useEffect(() => {\n    if (lightbox === null) {\n      lastFocusedRef.current?.focus();\n      lastFocusedRef.current = null;\n      return;\n    }\n    lastFocusedRef.current = document.activeElement as HTMLElement | null;\n    closeButtonRef.current?.focus();\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [lightbox !== null]);\n\n  React.useEffect(() => {\n    if (lightbox === null) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") setLightbox(null);\n      else if (e.key === \"ArrowRight\") setLightbox((i) => (i === null ? null : (i + 1) % photos.length));\n      else if (e.key === \"ArrowLeft\") setLightbox((i) => (i === null ? null : (i - 1 + photos.length) % photos.length));\n      else if (e.key === \"Tab\") {\n        const focusables = Array.from(dialogRef.current?.querySelectorAll<HTMLElement>(\"button\") ?? []);\n        if (focusables.length === 0) return;\n        const first = focusables[0];\n        const last = focusables[focusables.length - 1];\n        if (e.shiftKey && document.activeElement === first) {\n          e.preventDefault();\n          last.focus();\n        } else if (!e.shiftKey && document.activeElement === last) {\n          e.preventDefault();\n          first.focus();\n        }\n      }\n    };\n    window.addEventListener(\"keydown\", onKey);\n    return () => window.removeEventListener(\"keydown\", onKey);\n  }, [lightbox, photos.length]);\n\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    if (lightbox !== null) return;\n    const c = cam.current;\n    const stepPx = cardSize;\n    if (e.key === \"ArrowLeft\") c.tx -= stepPx;\n    else if (e.key === \"ArrowRight\") c.tx += stepPx;\n    else if (e.key === \"ArrowUp\") c.ty -= stepPx;\n    else if (e.key === \"ArrowDown\") c.ty += stepPx;\n    else if ((e.key === \"Enter\" || e.key === \" \") && enableLightbox) {\n      // Open the near card closest to the middle of the view.\n      const cx = size.w / 2;\n      const cy = size.h / 2;\n      let best = -1;\n      let bestD = Infinity;\n      cardRefs.current.forEach((el, i) => {\n        if (!el || layout.cards[i].layer !== 2) return;\n        const r = el.getBoundingClientRect();\n        const root = rootRef.current!.getBoundingClientRect();\n        const d = Math.hypot(r.left - root.left + r.width / 2 - cx, r.top - root.top + r.height / 2 - cy);\n        if (d < bestD) {\n          bestD = d;\n          best = i;\n        }\n      });\n      if (best >= 0) setLightbox(layout.cards[best].photo);\n    } else return;\n    e.preventDefault();\n    idleSince.current = performance.now();\n    setTouched(true);\n    wakeRef.current();\n  };\n\n  if (photos.length === 0) {\n    return (\n      <div className={cn(\"flex h-full w-full items-center justify-center rounded-xl\", className)} style={{ minHeight: 300, background: palette.background, border: palette.emptyBorder }} {...props}>\n        <span className=\"text-center text-sm leading-[1.6]\" style={{ color: palette.emptyText }}>\n          Add photos\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <div\n      ref={rootRef}\n      className={cn(\"group/wall relative w-full cursor-grab touch-none overflow-hidden outline-none select-none\", className)}\n      style={{ height, background: palette.background }}\n      tabIndex={0}\n      role=\"region\"\n      aria-roledescription=\"photo wall\"\n      aria-label=\"Photo wall. Drag or use the arrow keys to move around, Enter to open the photo in the middle.\"\n      onKeyDown={onKeyDown}\n      {...props}\n    >\n      {layout.cards.map((card, i) => {\n        const layer = LAYERS[card.layer];\n        const photo = photos[card.photo];\n        return (\n          <div\n            key={i}\n            ref={(el) => {\n              cardRefs.current[i] = el;\n            }}\n            data-card={i}\n            className=\"group absolute top-0 left-0 will-change-transform\"\n            style={{ width: card.w, height: card.h, transform: place(card, layout.period, 0, 0, 0, 0), cursor: enableLightbox ? \"pointer\" : undefined }}\n          >\n            <div\n              className=\"relative h-full w-full overflow-hidden transition-transform duration-500 group-data-[hover]:scale-[1.05]\"\n              style={{ borderRadius, background: palette.tile, boxShadow: card.layer === 2 ? palette.cardShadow : undefined, filter: layer.blur ? `blur(${layer.blur}px)` : undefined, transitionTimingFunction: \"cubic-bezier(0.22,1,0.36,1)\" }}\n            >\n              <img src={photo.src} alt={photo.alt || photo.title || \"\"} draggable={false} decoding=\"async\" className=\"pointer-events-none block h-full w-full object-cover\" />\n              <div\n                ref={(el) => {\n                  veilRefs.current[i] = el;\n                }}\n                className=\"pointer-events-none absolute inset-0 transition-opacity duration-300\"\n                style={{ background: palette.background, opacity: Number((1 - layer.opacity).toFixed(3)) }}\n              />\n            </div>\n            {photo.title && card.layer > 0 && (\n              <div className=\"pointer-events-none absolute -bottom-6 left-0 flex items-center gap-2 text-[9.5px] tracking-[0.2em] whitespace-nowrap uppercase opacity-0 transition-opacity duration-300 group-data-[hover]:opacity-100\" style={{ color: palette.text }}>\n                <span className=\"h-px w-3\" style={{ background: palette.line }} />\n                {photo.title}\n              </div>\n            )}\n          </div>\n        );\n      })}\n\n      <div className=\"pointer-events-none absolute inset-0\" style={{ background: palette.vignette }} />\n\n      {showHint && (\n        <div className=\"pointer-events-none absolute bottom-5 left-1/2 flex -translate-x-1/2 items-center gap-2.5 text-[10px] tracking-[0.2em] uppercase transition-opacity duration-700\" style={{ color: palette.muted, opacity: touched ? 0 : 1 }}>\n          <span className=\"h-px w-5\" style={{ background: palette.line }} />\n          Drag to explore\n          <span className=\"h-px w-5\" style={{ background: palette.line }} />\n        </div>\n      )}\n\n      {enableLightbox &&\n        lightbox !== null &&\n        createPortal(\n          <div ref={dialogRef} onClick={() => setLightbox(null)} role=\"dialog\" aria-modal=\"true\" aria-label=\"Photo preview\" className=\"fixed inset-0 z-[999999] flex flex-col items-center justify-center\" style={{ background: palette.lightboxBackground }}>\n            <button\n              ref={closeButtonRef}\n              onClick={(e) => {\n                e.stopPropagation();\n                setLightbox(null);\n              }}\n              aria-label=\"Close\"\n              className=\"absolute top-6 right-8 h-10 w-10 cursor-pointer border-0 bg-transparent text-[28px] leading-none\"\n              style={{ color: palette.controlColor }}\n            >\n              ×\n            </button>\n            {photos.length > 1 && (\n              <>\n                <button\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setLightbox((lightbox - 1 + photos.length) % photos.length);\n                  }}\n                  aria-label=\"Previous\"\n                  className=\"absolute top-1/2 left-6 h-11 w-11 -translate-y-1/2 cursor-pointer border-0 bg-transparent text-[32px]\"\n                  style={{ color: palette.controlColor }}\n                >\n                  ‹\n                </button>\n                <button\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setLightbox((lightbox + 1) % photos.length);\n                  }}\n                  aria-label=\"Next\"\n                  className=\"absolute top-1/2 right-6 h-11 w-11 -translate-y-1/2 cursor-pointer border-0 bg-transparent text-[32px]\"\n                  style={{ color: palette.controlColor }}\n                >\n                  ›\n                </button>\n              </>\n            )}\n            <img\n              src={photos[lightbox].src}\n              alt={photos[lightbox].alt || photos[lightbox].title || \"\"}\n              onClick={(e) => e.stopPropagation()}\n              className=\"max-w-[82%] object-contain\"\n              style={{ maxHeight: \"78%\", borderRadius: 4, boxShadow: \"0 20px 60px rgba(0,0,0,0.6)\" }}\n              draggable={false}\n            />\n            <div className=\"mt-5 flex items-baseline gap-3 text-[13px]\" style={{ color: palette.controlColor }} onClick={(e) => e.stopPropagation()}>\n              {photos[lightbox].title && <span>{photos[lightbox].title}</span>}\n              <span className=\"text-[11px] tracking-[0.16em] uppercase tabular-nums opacity-60\">\n                {String(lightbox + 1).padStart(2, \"0\")} / {String(photos.length).padStart(2, \"0\")}\n              </span>\n            </div>\n          </div>,\n          document.body,\n        )}\n    </div>\n  );\n}\n\nfunction clamp01(v: number) {\n  return Math.min(Math.max(v, 0), 1);\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}