{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"magazine-stack-gallery-that-fans-out-across-the-table-and-lifts-the-chosen-issue-to-face-you","type":"registry:block","title":"Magazine Stack Gallery That Fans out Across the Table and Lifts the Chosen Issue to Face You","description":"Gallery of magazines on a dark table: the pile slides into a fan and the issue you press is lifted and turned to face you. Free React and HTML to copy.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/magazine-stack-gallery-that-fans-out-across-the-table-and-lifts-the-chosen-issue-to-face-you.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { motion, useReducedMotion, useSpring, useTransform } from \"framer-motion\";\nimport type { MotionValue } from \"framer-motion\";\n\n/** The pile, bottom first. `look` picks one of the masthead treatments in `Masthead`. */\nconst issues = [\n  { name: \"Loud\", no: \"No. 14\", season: \"Autumn\", line: \"The colour issue\", second: \"Forty pages without a single neutral\", look: \"block\", ink: \"#ffffff\", spine: \"#c2185b\", photo: \"https://images.pexels.com/photos/11026096/pexels-photo-11026096.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Dancer in a lime top and blue trousers stretching her arms up against a pink wall\", tone: \"#b81d63\", focus: \"30% 30%\" },\n  { name: \"Halide\", no: \"No. 31\", season: \"Winter\", line: \"Portraits by one lamp\", second: \"A light, a wall and an afternoon\", look: \"italic\", ink: \"#fff3d6\", spine: \"#2f3c41\", photo: \"https://images.pexels.com/photos/31569208/pexels-photo-31569208.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Man in round sunglasses and a black roll neck in front of a glowing orange disc\", tone: \"#56676a\", focus: \"50% 30%\" },\n  { name: \"Tangent\", no: \"No. 08\", season: \"Spring\", line: \"One figure, one field of blue\", second: \"Notes on standing still\", look: \"mono\", ink: \"#ffffff\", spine: \"#0a2fd0\", photo: \"https://images.pexels.com/photos/13767168/pexels-photo-13767168.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Woman in black wearing white sunglasses standing side on against a deep blue backdrop\", tone: \"#0832dc\", focus: \"50% 40%\" },\n  { name: \"Pollen\", no: \"No. 22\", season: \"Summer\", line: \"Orange, all the way down\", second: \"Dressing for the hottest week\", look: \"serif\", ink: \"#1a0f08\", spine: \"#ef6a10\", photo: \"https://images.pexels.com/photos/18506138/pexels-photo-18506138.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Woman in a black hat and top and orange trousers sitting against an orange studio wall\", tone: \"#f2700f\", focus: \"40% 30%\" },\n  { name: \"Overcast\", no: \"No. 05\", season: \"Autumn\", line: \"After dark, in violet\", second: \"Shirts worn two sizes up\", look: \"wide\", ink: \"#ffffff\", spine: \"#7a1fb0\", photo: \"https://images.pexels.com/photos/11813320/pexels-photo-11813320.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Model with a short bob and an oversized shirt lit red against a purple and pink glow\", tone: \"#a41ec0\", focus: \"50% 30%\" },\n  { name: \"Marrow\", no: \"No. 17\", season: \"Spring\", line: \"Everything you own, at once\", second: \"The wardrobe edit\", look: \"stack\", ink: \"#f1ee4a\", spine: \"#4d2a86\", photo: \"https://images.pexels.com/photos/11059420/pexels-photo-11059420.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"Woman in a lime blazer and red glasses holding an armful of bright clothes against a purple wall\", tone: \"#55308e\", focus: \"50% 30%\" },\n];\ntype Issue = (typeof issues)[number];\n\n// Sizes in the scene's own pixels. The table is tipped back and turned, and every issue lies on it.\nconst W = 250;\nconst H = 330;\nconst T = 7; // thickness of one issue\nconst TIP = 46;\nconst TURN = -14;\nconst LIFT = 190; // how high the chosen issue is held\nconst FACE = 0.86; // 1 would hold it square to the camera\nconst WIDE = { W: 1000, H: 690, cx: 500, cy: 420, step: 128, sweep: 6.5 };\nconst SMALL = { W: 620, H: 900, cx: 310, cy: 470, step: 62, sweep: 5 };\ntype Layout = typeof WIDE;\nconst TABLE = \"#141217\";\nconst grain = \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E\\\")\";\nconst pages = \"repeating-linear-gradient(0deg, #fbf9f4 0 1px, #c9c3b6 1px 1.7px)\";\nconst jitter = [\n  { x: -6, y: 5, r: -3.5 },\n  { x: 7, y: -4, r: 2.4 },\n  { x: -3, y: -7, r: -1.2 },\n  { x: 5, y: 6, r: 4.1 },\n  { x: -8, y: 1, r: -2.2 },\n  { x: 2, y: -2, r: 1.1 },\n];\n\nconst spin = (x: number, y: number, deg: number) => {\n  const a = (deg * Math.PI) / 180;\n  return [x * Math.cos(a) - y * Math.sin(a), x * Math.sin(a) + y * Math.cos(a)];\n};\n\n/** Where issue i rests for a given amount of fan (0 piled, 1 spread) and whether it is the one held up. */\nfunction place(i: number, fan: number, held: boolean, L: Layout) {\n  const mid = (issues.length - 1) / 2;\n  const j = jitter[i % jitter.length];\n  const lean = (Math.asin((T + 0.8) / L.step) * 180) / Math.PI;\n  if (held) return { x: 0, y: 58, z: LIFT, r: -TURN + 2, tilt: 0, lift: -TIP * FACE };\n  const k = i - mid;\n  // the fan runs level on screen, so its line is turned back against the table's own turn\n  const [fx, fy] = spin(k * L.step, k * k * 5 - 14, -TURN);\n  return {\n    x: j.x * (1 - fan) + fx * fan,\n    y: j.y * (1 - fan) + fy * fan,\n    z: i * (T + 0.6) * (1 - fan) + (i === 0 ? 0 : (W / 2) * Math.sin((lean * Math.PI) / 180) * fan),\n    r: j.r * (1 - fan) + k * L.sweep * fan,\n    tilt: i === 0 ? 0 : lean * fan,\n    lift: 0,\n  };\n}\n\nfunction Masthead({ m }: { m: Issue }) {\n  const c = { color: m.ink };\n  if (m.look === \"block\") return <span className=\"absolute inset-x-[12px] top-[6px] block text-left font-sans text-[84px] font-black uppercase leading-[0.86] tracking-[-0.07em]\" style={c}>{m.name}</span>;\n  if (m.look === \"italic\") return <span className=\"absolute inset-x-0 top-[10px] block text-center font-serif text-[70px] italic leading-none tracking-[-0.03em]\" style={c}>{m.name}</span>;\n  if (m.look === \"mono\")\n    return (\n      <span className=\"absolute inset-x-[14px] top-[14px] block border-b border-white/80 pb-[9px] text-left font-mono text-[25px] font-medium uppercase leading-none tracking-[0.36em]\" style={c}>\n        {m.name}\n      </span>\n    );\n  if (m.look === \"serif\") return <span className=\"absolute inset-x-[12px] top-[2px] block text-left font-serif text-[82px] lowercase leading-none tracking-[-0.06em]\" style={c}>{m.name}</span>;\n  if (m.look === \"wide\") return <span className=\"absolute inset-x-0 top-[16px] block text-center font-sans text-[30px] font-light uppercase leading-none tracking-[0.3em]\" style={{ ...c, textIndent: \"0.3em\" }}>{m.name}</span>;\n  return <span className=\"absolute left-[12px] top-[8px] block w-[110px] break-all text-left font-sans text-[66px] font-black uppercase leading-[0.8] tracking-[-0.05em]\" style={c}>{m.name}</span>;\n}\n\nfunction Magazine({ m, i, L, fan, held, covered, reduce, rx, rz, onPress }: { m: Issue; i: number; L: Layout; fan: number; held: boolean; covered: boolean; reduce: boolean; rx: MotionValue<number>; rz: MotionValue<number>; onPress: () => void }) {\n  const to = place(i, fan, held, L);\n  // issues higher in the pile are on looser springs, so they trail the ones beneath\n  const cfg = { stiffness: 190 - i * 17, damping: 19 - i * 0.6, mass: 1 };\n  const sx = useSpring(to.x, cfg);\n  const sy = useSpring(to.y, cfg);\n  const sz = useSpring(to.z, { stiffness: 150 - i * 8, damping: 15, mass: 1 });\n  const sr = useSpring(to.r, cfg);\n  const st = useSpring(to.tilt, cfg);\n  const sl = useSpring(to.lift, { stiffness: 110, damping: 13, mass: 1 });\n  useEffect(() => {\n    const pairs = [[sx, to.x], [sy, to.y], [sz, to.z], [sr, to.r], [st, to.tilt], [sl, to.lift]] as const;\n    pairs.forEach(([s, v]) => (reduce ? s.jump(v) : s.set(v)));\n  }, [reduce, sl, sr, st, sx, sy, sz, to.lift, to.r, to.tilt, to.x, to.y, to.z]);\n\n  const transform = useTransform([sx, sy, sz, sr, st, sl], ([x, y, z, r, t, l]: number[]) => `translate3d(${x.toFixed(2)}px, ${y.toFixed(2)}px, ${z.toFixed(2)}px) rotateZ(${r.toFixed(2)}deg) rotateY(${t.toFixed(2)}deg) rotateX(${l.toFixed(2)}deg)`);\n  const shadow = useTransform([sx, sy, sz, sr], ([x, y, z, r]: number[]) => `translate3d(${(x + z * 0.3).toFixed(1)}px, ${(y + z * 0.46).toFixed(1)}px, 0.4px) rotateZ(${r.toFixed(2)}deg) scale(${(1 + z / 700).toFixed(3)})`);\n  const shadowFade = useTransform(sz, (z) => 0.62 - Math.min(0.34, z / 520));\n  const gloss = useTransform(sl, (l) => `${(120 + l * 3.4).toFixed(1)}% 0`);\n  // where the next issue's bound edge crosses this cover, in this cover's own pixels\n  const k = i - (issues.length - 1) / 2;\n  const [dx, dy] = spin(L.step, 5 * (2 * k + 1), -TURN - k * L.sweep);\n  const edge = [W / 2 + dx - (W / 2) * Math.cos((L.sweep * Math.PI) / 180), H / 2 + dy - (W / 2) * Math.sin((L.sweep * Math.PI) / 180)];\n  const base = { left: L.cx - W / 2, top: L.cy - H / 2, width: W, height: H } as const;\n\n  // a held issue is painted over the rest, and keeps that place until it has landed again\n  const [above, setAbove] = useState(held);\n  useEffect(() => {\n    if (held) {\n      setAbove(true);\n      return;\n    }\n    const t = window.setTimeout(() => setAbove(false), reduce ? 0 : 520);\n    return () => window.clearTimeout(t);\n  }, [held, reduce]);\n\n  // every issue is its own little 3D world on the same tipped table, stacked in paint order\n  return (\n    <motion.div className=\"pointer-events-none absolute inset-0\" style={{ zIndex: above ? 40 : i + 1, transformStyle: \"preserve-3d\", transformOrigin: `${L.cx}px ${L.cy}px`, rotateX: rx, rotateZ: rz }}>\n      <motion.div aria-hidden=\"true\" className=\"pointer-events-none absolute rounded-[6px] bg-black\" style={{ ...base, transform: shadow, opacity: shadowFade, filter: \"blur(13px)\" }} />\n      <motion.div className=\"pointer-events-none absolute\" style={{ ...base, transformStyle: \"preserve-3d\", transform }}>\n        <div className={`absolute inset-0 ${held ? \"magazine-fan-held\" : \"\"}`} style={{ transformStyle: \"preserve-3d\" }}>\n          {/* underside, then the three cut edges and the glued spine */}\n          <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ backgroundColor: m.tone, backgroundImage: \"linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55))\" }} />\n          <div aria-hidden=\"true\" className=\"absolute left-0\" style={{ top: H, width: W, height: T, transformOrigin: \"50% 0\", transform: `translateZ(${T}px) rotateX(-90deg)`, backgroundImage: `linear-gradient(90deg, rgba(0,0,0,0.3) 0, rgba(0,0,0,0) 10px), ${pages}` }} />\n          <div aria-hidden=\"true\" className=\"absolute left-0 top-0\" style={{ width: W, height: T, transformOrigin: \"50% 0\", transform: \"rotateX(90deg)\", backgroundImage: pages }} />\n          <div aria-hidden=\"true\" className=\"absolute top-0\" style={{ left: W, width: T, height: H, transformOrigin: \"0 50%\", transform: `translateZ(${T}px) rotateY(90deg)`, backgroundImage: \"repeating-linear-gradient(90deg, #f3f0e9 0 1px, #bdb7aa 1px 1.7px)\" }} />\n          <div aria-hidden=\"true\" className=\"absolute left-0 top-0 overflow-hidden\" style={{ width: T, height: H, transformOrigin: \"0 50%\", transform: \"rotateY(-90deg)\", backgroundColor: m.spine, backgroundImage: \"linear-gradient(90deg, rgba(0,0,0,0.3), rgba(255,255,255,0.16) 60%, rgba(255,255,255,0.3))\" }}>\n            <span className=\"absolute left-0 right-0 top-[18px] h-[70px] bg-white/85\" />\n            <span className=\"absolute bottom-[16px] left-0 right-0 h-[26px] bg-white/60\" />\n          </div>\n          {/* cover */}\n          <button\n            type=\"button\"\n            onClick={onPress}\n            aria-pressed={held}\n            aria-label={`${m.name} ${m.no}, ${m.line}`}\n            className=\"pointer-events-auto absolute inset-0 block cursor-pointer overflow-hidden rounded-r-[2px] outline-none focus-visible:ring-4 focus-visible:ring-inset focus-visible:ring-white\"\n            style={{ transform: `translateZ(${T}px)`, backgroundColor: m.tone }}\n          >\n            <img src={m.photo} alt={m.alt} draggable={false} className=\"absolute inset-0 h-full w-full object-cover\" style={{ objectPosition: m.focus }} />\n            <span aria-hidden=\"true\" className=\"absolute inset-x-0 top-0 h-[42%]\" style={{ background: m.look === \"serif\" ? \"none\" : \"linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0))\" }} />\n            <span aria-hidden=\"true\" className=\"absolute inset-x-0 bottom-0 h-[38%]\" style={{ background: \"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0))\" }} />\n            <Masthead m={m} />\n            <span className=\"absolute bottom-[14px] left-[14px] right-[78px] block text-left text-white\">\n              <span className=\"block font-mono text-[7.5px] uppercase tracking-[0.24em] text-white/90\">\n                {m.no} / {m.season}\n              </span>\n              <span className=\"mt-[5px] block font-sans text-[15px] font-bold leading-[1.08] tracking-[-0.01em]\">{m.line}</span>\n              <span className=\"mt-[4px] block font-serif text-[10px] italic leading-[1.25] text-white/90\">{m.second}</span>\n            </span>\n            {/* a plain price box with rules standing in for the code strip */}\n            <span aria-hidden=\"true\" className=\"absolute bottom-[14px] right-[12px] block h-[34px] w-[52px] bg-white p-[4px]\">\n              <span className=\"block h-[18px] w-full\" style={{ backgroundImage: \"repeating-linear-gradient(90deg, #111 0 1px, #fff 1px 2px, #111 2px 4px, #fff 4px 5px, #111 5px 6px, #fff 6px 8.5px)\" }} />\n              <span className=\"mt-[2px] block text-center font-mono text-[5.5px] leading-none tracking-[0.12em] text-black\">12.00</span>\n            </span>\n            {/* the shadow the next issue in the fan drops along its bound edge */}\n            <span aria-hidden=\"true\" className=\"absolute transition-opacity duration-300\" style={{ left: edge[0] - 26, top: edge[1] - (H + 160) / 2, width: 26, height: H + 160, transformOrigin: \"100% 50%\", transform: `rotate(${L.sweep}deg)`, opacity: covered && !held ? fan * fan : 0, background: \"linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.12) 45%, rgba(0,0,0,0.5))\" }} />\n            {/* the crease beside the glued spine, the sheen of coated stock, a bright cut edge */}\n            <span aria-hidden=\"true\" className=\"absolute inset-y-0 left-0 w-[14px]\" style={{ background: \"linear-gradient(90deg, rgba(255,255,255,0.3) 0, rgba(255,255,255,0.05) 4px, rgba(0,0,0,0.3) 7px, rgba(0,0,0,0) 14px)\" }} />\n            <motion.span aria-hidden=\"true\" className=\"absolute inset-0\" style={{ backgroundImage: \"linear-gradient(112deg, rgba(255,255,255,0) 34%, rgba(255,255,255,0.1) 42%, rgba(255,255,255,0.42) 50%, rgba(255,255,255,0.1) 58%, rgba(255,255,255,0) 66%)\", backgroundSize: \"260% 100%\", backgroundPosition: gloss, backgroundRepeat: \"no-repeat\" }} />\n            <span aria-hidden=\"true\" className=\"absolute inset-0\" style={{ background: \"linear-gradient(150deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.2))\", boxShadow: \"inset 0 0 0 0.5px rgba(255,255,255,0.35)\" }} />\n          </button>\n        </div>\n      </motion.div>\n    </motion.div>\n  );\n}\n\nexport default function MagazineStackFanGallery() {\n  const reduce = !!useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const [small, setSmall] = useState(false);\n  const [fan, setFan] = useState(1);\n  const [held, setHeld] = useState<number | null>(3);\n  const idle = useRef({ paused: false, touched: false, scale: 1 });\n  const drag = useRef({ on: false, x: 0, from: 1, moved: 0 });\n  const L = small ? SMALL : WIDE;\n  const px = useSpring(0, { stiffness: 50, damping: 14 });\n  const py = useSpring(0, { stiffness: 50, damping: 14 });\n  const rz = useTransform(px, (v) => TURN + v * 3.2);\n  const rx = useTransform(py, (v) => TIP - v * 2.4);\n\n  const press = useCallback(\n    (i: number) => {\n      idle.current.touched = true;\n      if (drag.current.moved > 8) return;\n      if (fan < 0.5) {\n        setFan(1);\n        return;\n      }\n      setHeld((h) => (h === i ? null : i));\n    },\n    [fan],\n  );\n\n  // self-playing demo: put the held issue down, square the pile, fan it again, pick up another\n  useEffect(() => {\n    if (reduce) return;\n    let step = 0;\n    let next = 3;\n    let timer = 0;\n    const plan = [3500, 1100, 1700, 1300];\n    const tick = () => {\n      const s = idle.current;\n      if (s.touched) return;\n      if (!s.paused && !document.hidden) {\n        const phase = step % 4;\n        if (phase === 0) setHeld(null);\n        if (phase === 1) setFan(0);\n        if (phase === 2) setFan(1);\n        if (phase === 3) {\n          next = (next + 4) % issues.length;\n          setHeld(next);\n        }\n        step += 1;\n      }\n      timer = window.setTimeout(tick, plan[step % 4]);\n    };\n    timer = window.setTimeout(tick, plan[0]);\n    return () => window.clearTimeout(timer);\n  }, [reduce]);\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    const scene = sceneRef.current;\n    if (!wrap || !scene) return;\n    const measure = () => {\n      const isSmall = wrap.clientWidth < 700;\n      const lay = isSmall ? SMALL : WIDE;\n      setSmall(isSmall);\n      const sc = Math.min(1.1, wrap.clientWidth / lay.W);\n      idle.current.scale = sc;\n      wrap.style.height = `${Math.round(lay.H * sc)}px`;\n      scene.style.transform = `translateX(-50%) scale(${sc.toFixed(4)})`;\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(wrap);\n    return () => ro.disconnect();\n  }, []);\n\n  const shown = held === null ? null : issues[held];\n  const piled = fan < 0.5;\n\n  return (\n    <section className=\"relative overflow-hidden\" style={{ backgroundColor: TABLE }}>\n      <style>{`@keyframes magazine-stack-gallery-that-fans-out-hold { 0%, 100% { transform: translateZ(0) rotateZ(-0.5deg) rotateY(-1.4deg); } 50% { transform: translateZ(9px) rotateZ(0.5deg) rotateY(1.6deg); } }\n.magazine-fan-held { animation: magazine-stack-gallery-that-fans-out-hold 4.6s ease-in-out infinite; }\n@media (prefers-reduced-motion: reduce) { .magazine-fan-held { animation: none; } }`}</style>\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ backgroundImage: `radial-gradient(70% 62% at 50% 56%, #37323d 0%, #201d25 44%, #0d0c10 100%), ${grain}`, backgroundBlendMode: \"screen\" }} />\n      <div\n        ref={wrapRef}\n        onPointerMove={(e) => {\n          const d = drag.current;\n          if (d.on) {\n            const dx = e.clientX - d.x;\n            d.moved = Math.max(d.moved, Math.abs(dx));\n            if (d.moved > 8) {\n              setHeld(null);\n              setFan(Math.min(1, Math.max(0, d.from + dx / (360 * idle.current.scale))));\n            }\n          }\n          if (reduce || e.pointerType === \"touch\") return;\n          const r = e.currentTarget.getBoundingClientRect();\n          px.set(((e.clientX - r.left) / r.width) * 2 - 1);\n          py.set(((e.clientY - r.top) / r.height) * 2 - 1);\n        }}\n        onPointerDown={(e) => {\n          if (e.button !== 0) return;\n          idle.current.touched = true;\n          drag.current = { on: true, x: e.clientX, from: fan, moved: 0 };\n        }}\n        onPointerUp={() => {\n          const d = drag.current;\n          if (d.on && d.moved > 8) setFan((f) => (f > 0.5 ? 1 : 0));\n          d.on = false;\n          // the press that ends a drag still reaches the cover under it: let that one pass, then forget the drag\n          window.setTimeout(() => (d.moved = 0), 0);\n        }}\n        onPointerCancel={() => (drag.current.on = false)}\n        onPointerEnter={() => (idle.current.paused = true)}\n        onPointerLeave={() => {\n          idle.current.paused = false;\n          drag.current.on = false;\n          px.set(0);\n          py.set(0);\n        }}\n        onFocus={() => (idle.current.paused = true)}\n        onBlur={() => (idle.current.paused = false)}\n        className=\"relative mx-auto w-full touch-pan-y overflow-hidden\"\n        style={{ height: WIDE.H }}\n      >\n        <div ref={sceneRef} className=\"absolute left-1/2 top-0 select-none\" style={{ width: L.W, height: L.H, transformOrigin: \"50% 0\", transform: \"translateX(-50%)\", perspective: \"1900px\", perspectiveOrigin: \"50% 34%\" }}>\n          {issues.map((m, i) => (\n            <Magazine key={m.name} m={m} i={i} L={L} fan={fan} held={held === i} covered={i < issues.length - 1 && held !== i + 1} reduce={reduce} rx={rx} rz={rz} onPress={() => press(i)} />\n          ))}\n        </div>\n\n        <div className=\"absolute inset-x-5 bottom-4 flex items-end justify-between gap-4 sm:inset-x-8 sm:bottom-7\">\n          <p aria-live=\"polite\" className=\"font-mono text-[11px] uppercase leading-relaxed tracking-[0.18em] text-stone-400\">\n            <span className=\"text-white\">{shown ? `${shown.name} ${shown.no} / ${shown.line}` : piled ? `${issues.length} issues in the pile` : `${issues.length} issues on the table`}</span>\n            <span className=\"block\">{piled ? \"Press the pile or drag right to fan it\" : shown ? \"Press it again to put it down\" : \"Press a cover to pick it up\"}</span>\n          </p>\n          <button\n            type=\"button\"\n            onClick={() => {\n              idle.current.touched = true;\n              setHeld(null);\n              setFan(piled ? 1 : 0);\n            }}\n            aria-pressed={!piled}\n            className=\"min-h-[40px] shrink-0 rounded-full border border-white/30 bg-white/10 px-4 font-mono text-[11px] uppercase tracking-[0.18em] text-white outline-none transition-colors hover:bg-white/20 focus-visible:ring-2 focus-visible:ring-white\"\n          >\n            {piled ? \"Fan out\" : \"Stack\"}\n          </button>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
