{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"library-date-due-card-and-pocket-event-list-that-a-self-inking-dater-stamps-row-by-row","type":"registry:block","title":"Library Date Due Card and Pocket Event List That a Self Inking Dater Stamps Row by Row","description":"Event list drawn as a library date card in a manila pocket: a self-inking dater stamps each new date in rough ink. Free React and Tailwind code, or HTML.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/library-date-due-card-and-pocket-event-list-that-a-self-inking-dater-stamps-row-by-row.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { animate, motion, useMotionValue, useReducedMotion, useSpring, useTransform } from \"framer-motion\";\n\n/** What is printed on the pocket and typed on the card. `ink` is the colour a date was stamped in. */\nconst library = { name: \"Fennel Street Reading Room\", card: \"Evenings, autumn list\", number: \"No. 0417\" };\nconst INKS = { violet: \"#43349a\", red: \"#b3271c\", navy: \"#1c2b55\" };\nconst dates: { date: string; what: string; where: string; ink: keyof typeof INKS; turn: number; dx: number; dy: number }[] = [\n  { date: \"02 OCT 2026\", what: \"Poetry open mic\", where: \"Upstairs, 7 pm\", ink: \"red\", turn: -2.4, dx: 1, dy: 1 },\n  { date: \"09 OCT 2026\", what: \"Mending circle\", where: \"Bring a jumper\", ink: \"red\", turn: 1.6, dx: -2, dy: -1 },\n  { date: \"16 OCT 2026\", what: \"Zine fair\", where: \"Whole ground floor\", ink: \"navy\", turn: -0.8, dx: 2, dy: 2 },\n  { date: \"23 OCT 2026\", what: \"Ghost stories\", where: \"Candles, 8 pm\", ink: \"violet\", turn: 3.1, dx: -1, dy: 0 },\n  { date: \"30 OCT 2026\", what: \"Seed swap\", where: \"Courtyard, noon\", ink: \"violet\", turn: -1.9, dx: 3, dy: -2 },\n  { date: \"06 NOV 2026\", what: \"Letterpress hour\", where: \"Print room\", ink: \"navy\", turn: 0.9, dx: -3, dy: 1 },\n  { date: \"13 NOV 2026\", what: \"Translators read\", where: \"Upstairs, 7 pm\", ink: \"violet\", turn: -2.8, dx: 1, dy: -1 },\n  { date: \"20 NOV 2026\", what: \"Quiet disco\", where: \"Stacks, 9 pm\", ink: \"violet\", turn: 2.2, dx: -1, dy: 2 },\n];\n\n// Sizes in the scene's own pixels. Two layouts: stamp beside the pocket, or under it on narrow screens.\nconst PW = 330; // pocket\nconst CW = 262; // card\nconst CH = 430;\nconst HEAD = 74; // printed heading of the card\nconst ROW = 37;\nconst OUT = 270; // how far the card travels out of the pocket\nconst CARD_IN = 318; // top of the card when tucked in\nconst FRONT_Y = 418; // top edge of the pocket front\nconst BACK_Y = 340;\nconst FLOOR = 620;\nconst SW = 152; // stamp\nconst SH = 74;\nconst WIDE = { W: 920, H: 684, px: 196, restX: 700, restY: 498, restTurn: 11 };\nconst TALL = { W: 430, H: 800, px: 50, restX: 292, restY: 706, restTurn: -7 };\ntype Layout = typeof WIDE;\nconst STAGE = \"#c9c6ea\";\nconst fibre = \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.24 0 0 0 0 0.08 0 0 0 0.3 -0.06'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E\\\")\";\nconst manila = \"#e3c283\";\nconst INK_FILTER = \"library-date-due-card-ink\";\n\nexport default function LibraryDateDueCard() {\n  const reduce = !!useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const [tall, setTall] = useState(false);\n  const [stamped, setStamped] = useState(6);\n  const [out, setOut] = useState(true);\n  const [busy, setBusy] = useState(false);\n  const live = useRef({ paused: false, touched: false, busy: false, alive: true, stamped: 6, out: true });\n  const L: Layout = tall ? TALL : WIDE;\n  const lay = useRef(L);\n  lay.current = L;\n\n  const cardY = useMotionValue(reduce ? -OUT : -OUT + 30);\n  const sx = useMotionValue(WIDE.restX);\n  const sy = useMotionValue(WIDE.restY);\n  const turn = useMotionValue(WIDE.restTurn);\n  const lift = useMotionValue(0.35); // 0 pressed on the card, 1 carried in the hand\n  const body = useTransform([sx, sy, turn, lift], ([x, y, r, l]: number[]) => `translate3d(${x - SW / 2}px, ${y - SH / 2}px, ${14 + l * 90}px) rotate(${r}deg) scale(${1 + l * 0.03})`);\n  const shade = useTransform([sx, sy, turn, lift], ([x, y, r, l]: number[]) => `translate3d(${x - SW / 2 + 4 + l * 20}px, ${y - SH / 2 + 5 + l * 30}px, 11px) rotate(${r}deg) scale(${1 + l * 0.05})`);\n  const shadeBlur = useTransform(lift, (l) => `blur(${5 + l * 15}px)`);\n  const shadeFade = useTransform(lift, (l) => 0.5 - l * 0.22);\n\n  // the whole flat lay is one tray that tips a few degrees: with the pointer, and slowly by itself\n  const px = useSpring(0, { stiffness: 45, damping: 14 });\n  const py = useSpring(0, { stiffness: 45, damping: 14 });\n  const drift = useMotionValue(0);\n  const tipY = useTransform([px, drift], ([a, b]: number[]) => a * 5 + b);\n  const tipX = useTransform([py, drift], ([a, b]: number[]) => 5 - a * 4 + b * 0.4);\n  useEffect(() => {\n    if (reduce) return;\n    const a = animate(drift, [-2.6, 2.6], { duration: 6, ease: \"easeInOut\", repeat: Infinity, repeatType: \"mirror\" });\n    return () => a.stop();\n  }, [drift, reduce]);\n\n  const slide = useCallback(\n    (to: boolean) => {\n      live.current.out = to;\n      setOut(to);\n      if (reduce) cardY.set(to ? -OUT : 0);\n      else animate(cardY, to ? -OUT : 0, { type: \"spring\", stiffness: 130, damping: 17, mass: 1.1 });\n    },\n    [cardY, reduce],\n  );\n\n  /** Carry the dater to the next empty row, press it, and bring it home. */\n  const stamp = useCallback(async () => {\n    const s = live.current;\n    if (s.busy) return;\n    if (s.stamped >= dates.length) {\n      // a full card goes back in the pocket and a fresh one comes out\n      s.busy = true;\n      setBusy(true);\n      slide(false);\n      await new Promise((r) => window.setTimeout(r, reduce ? 0 : 750));\n      if (!s.alive) return;\n      s.stamped = 4;\n      setStamped(4);\n      slide(true);\n      s.busy = false;\n      setBusy(false);\n      return;\n    }\n    s.busy = true;\n    setBusy(true);\n    if (!s.out) {\n      slide(true);\n      await new Promise((r) => window.setTimeout(r, reduce ? 0 : 520));\n    }\n    const n = s.stamped;\n    const row = dates[n];\n    const now = lay.current;\n    const tx = now.px + (PW - CW) / 2 + 53 + row.dx;\n    const ty = CARD_IN - OUT + HEAD + n * ROW + ROW / 2 + row.dy;\n    if (!reduce) {\n      const go = { duration: 0.46, ease: [0.3, 0.7, 0.3, 1] } as const;\n      animate(lift, 1, { duration: 0.2 });\n      animate(turn, row.turn, go);\n      animate(sx, tx, go);\n      await animate(sy, ty, go);\n      await animate(lift, 0, { duration: 0.1, ease: \"easeIn\" });\n    }\n    if (!s.alive) return;\n    s.stamped = n + 1;\n    setStamped(n + 1);\n    if (!reduce) {\n      await new Promise((r) => window.setTimeout(r, 130));\n      await animate(lift, 1, { duration: 0.16, ease: \"easeOut\" });\n      const home = { type: \"spring\", stiffness: 120, damping: 17 } as const;\n      animate(turn, now.restTurn, home);\n      animate(sx, now.restX, home);\n      animate(sy, now.restY, home);\n      await animate(lift, 0.35, { duration: 0.5, delay: 0.25 });\n    }\n    s.busy = false;\n    setBusy(false);\n  }, [lift, reduce, slide, sx, sy, turn]);\n\n  useEffect(() => {\n    const s = live.current;\n    s.alive = true;\n    return () => {\n      s.alive = false;\n    };\n  }, []);\n\n  // the card settles the last little way as the page loads, then the dater works down the list by itself\n  useEffect(() => {\n    if (reduce) return;\n    const settle = animate(cardY, -OUT, { type: \"spring\", stiffness: 120, damping: 11, delay: 0.25 });\n    let timer = 0;\n    const tick = () => {\n      const s = live.current;\n      if (s.touched) return;\n      if (!s.paused && !document.hidden) stamp();\n      timer = window.setTimeout(tick, s.stamped >= dates.length ? 3200 : 2500);\n    };\n    timer = window.setTimeout(tick, 2750);\n    return () => {\n      settle.stop();\n      window.clearTimeout(timer);\n    };\n  }, [cardY, reduce, stamp]);\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    const scene = sceneRef.current;\n    if (!wrap || !scene) return;\n    const measure = () => {\n      const isTall = wrap.clientWidth < 700;\n      const now = isTall ? TALL : WIDE;\n      setTall(isTall);\n      if (!live.current.busy) {\n        sx.set(now.restX);\n        sy.set(now.restY);\n        turn.set(now.restTurn);\n      }\n      const sc = Math.min(1.06, wrap.clientWidth / now.W);\n      wrap.style.height = `${Math.round(now.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  }, [sx, sy, turn]);\n\n  const hand = () => (live.current.touched = true);\n  const full = stamped >= dates.length;\n  const next = dates[Math.min(stamped, dates.length - 1)];\n  const cardX = L.px + (PW - CW) / 2;\n  const paper = { backgroundColor: manila, backgroundImage: `linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0) 45%, rgba(120,80,20,0.14)), ${fibre}` } as const;\n\n  return (\n    <section className=\"relative overflow-hidden\" style={{ backgroundColor: STAGE }} onPointerEnter={() => (live.current.paused = true)}\n      onPointerMove={(e) => {\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      onPointerLeave={() => {\n        live.current.paused = false;\n        px.set(0);\n        py.set(0);\n      }}\n      onFocus={() => (live.current.paused = true)} onBlur={() => (live.current.paused = false)}>\n      <svg aria-hidden=\"true\" width=\"0\" height=\"0\" className=\"absolute\">\n        <filter id={INK_FILTER} x=\"-6%\" y=\"-25%\" width=\"112%\" height=\"150%\">\n          <feTurbulence type=\"fractalNoise\" baseFrequency=\"0.9\" numOctaves=\"2\" seed=\"3\" result=\"rough\" />\n          <feDisplacementMap in=\"SourceGraphic\" in2=\"rough\" scale=\"1.15\" xChannelSelector=\"R\" yChannelSelector=\"G\" result=\"bitten\" />\n          <feTurbulence type=\"fractalNoise\" baseFrequency=\"0.09 0.3\" numOctaves=\"2\" seed=\"11\" result=\"blot\" />\n          <feColorMatrix in=\"blot\" type=\"matrix\" values=\"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  2.6 0 0 0 -0.3\" result=\"patchy\" />\n          <feComposite in=\"bitten\" in2=\"patchy\" operator=\"in\" />\n        </filter>\n      </svg>\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ backgroundImage: \"radial-gradient(75% 70% at 42% 34%, #dedcf6 0%, #c9c6ea 52%, #a9a5d2 100%)\" }} />\n      <div ref={wrapRef} className=\"relative mx-auto w-full overflow-hidden\" style={{ height: WIDE.H }}>\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: \"1500px\", perspectiveOrigin: \"50% 45%\" }}>\n         <motion.div className=\"absolute inset-0\" style={{ transformStyle: \"preserve-3d\", transformOrigin: `${L.px + PW / 2}px 400px`, rotateX: reduce ? 0 : tipX, rotateY: reduce ? 0 : tipY }}>\n          {/* shadow the whole pocket throws on the table */}\n          <div aria-hidden=\"true\" className=\"absolute rounded-[10px]\" style={{ left: L.px + 12, top: BACK_Y + 18, width: PW - 6, height: FLOOR - BACK_Y - 14, background: \"rgba(40,30,90,0.5)\", filter: \"blur(16px)\" }} />\n          <div aria-hidden=\"true\" className=\"absolute rounded-[6px]\" style={{ left: L.px + 3, top: BACK_Y + 4, width: PW, height: FLOOR - BACK_Y, background: \"rgba(40,30,90,0.45)\", filter: \"blur(5px)\" }} />\n          {/* back of the pocket */}\n          <div aria-hidden=\"true\" className=\"absolute rounded-t-[7px] rounded-b-[3px]\" style={{ left: L.px, top: BACK_Y, width: PW, height: FLOOR - BACK_Y, transform: \"translateZ(1px)\", ...paper, boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.55), inset 0 0 0 1px rgba(120,80,20,0.18)\" }}>\n            <div className=\"absolute inset-x-0 top-0 h-[80px]\" style={{ background: \"linear-gradient(180deg, rgba(90,60,10,0) 0, rgba(90,60,10,0.32) 100%)\" }} />\n          </div>\n\n          {/* the card, cut off where it passes the glued bottom of the pocket */}\n          <div className=\"pointer-events-none absolute left-0 overflow-hidden\" style={{ top: -120, width: L.W, height: FLOOR + 120 - 5, transform: \"translateZ(5px)\" }}>\n          <motion.div\n            className=\"pointer-events-auto absolute cursor-grab touch-none active:cursor-grabbing\"\n            style={{ left: cardX, top: CARD_IN + 120, width: CW, height: CH, y: cardY }}\n            drag={reduce ? false : \"y\"}\n            dragConstraints={{ top: -OUT, bottom: 0 }}\n            dragElastic={0.06}\n            dragMomentum={false}\n            onDragStart={hand}\n            onDragEnd={(_, info) => slide(cardY.get() + info.velocity.y * 0.18 < -OUT / 2)}\n          >\n            <div className=\"absolute inset-0 rounded-[4px]\" style={{ backgroundColor: \"#f3ead3\", backgroundImage: `linear-gradient(120deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 40%, rgba(120,90,30,0.1)), ${fibre}`, boxShadow: \"inset 0 0 0 1px rgba(120,90,40,0.2), inset 0 1px 0 rgba(255,255,255,0.8), 3px 4px 7px rgba(60,40,10,0.3), 1px 1px 1px rgba(60,40,10,0.25)\" }}>\n              <div className=\"px-[14px] pt-[13px] text-center\">\n                <p className=\"font-serif text-[9px] uppercase tracking-[0.3em] text-[#a3261b]\">{library.name}</p>\n                <p className=\"mt-[5px] font-serif text-[17px] italic leading-none text-[#2c2620]\">{library.card}</p>\n              </div>\n              <div className=\"absolute inset-x-0 border-y-[1.5px] border-[#b23a2e]/80\" style={{ top: HEAD - 21, height: 21 }}>\n                <span className=\"absolute left-0 top-0 flex h-full w-[106px] items-center justify-center font-serif text-[8px] font-semibold uppercase tracking-[0.26em] text-[#a3261b]\">Date</span>\n                <span className=\"absolute left-[116px] top-0 flex h-full items-center font-serif text-[8px] font-semibold uppercase tracking-[0.26em] text-[#a3261b]\">What is on</span>\n              </div>\n              <div aria-hidden=\"true\" className=\"absolute bottom-0 w-px bg-[#b23a2e]/70\" style={{ left: 106, top: HEAD - 21 }} />\n              <ol className=\"absolute inset-x-0\" style={{ top: HEAD }}>\n                {dates.map((d, i) => (\n                  <li key={d.date} className=\"relative border-b border-[#7f9fc4]/60\" style={{ height: ROW }}>\n                    <span className=\"absolute left-0 top-0 flex h-full w-[106px] items-center justify-center\">\n                      {i < stamped ? (\n                        <span className=\"library-date-due-struck block whitespace-nowrap font-mono text-[12.5px] font-bold tracking-[0.02em]\" style={{ color: INKS[d.ink], transform: `translate(${d.dx}px, ${d.dy}px) rotate(${d.turn}deg)`, filter: `url(#${INK_FILTER})`, mixBlendMode: \"multiply\" }}>\n                          {d.date}\n                        </span>\n                      ) : (\n                        <span className=\"sr-only\">Date to be announced</span>\n                      )}\n                    </span>\n                    <span className=\"absolute left-[116px] right-[8px] top-0 flex h-full flex-col justify-center font-mono leading-none text-[#2b2925]\">\n                      <span className=\"text-[11px] font-semibold tracking-[-0.01em]\">{d.what}</span>\n                      <span className=\"mt-[4px] text-[8.5px] text-[#5d564b]\">{d.where}</span>\n                    </span>\n                  </li>\n                ))}\n              </ol>\n              <button\n                type=\"button\"\n                onClick={() => {\n                  hand();\n                  slide(!out);\n                }}\n                aria-expanded={out}\n                aria-label={out ? \"Tuck the card back into its pocket\" : \"Pull the card out of its pocket\"}\n                className=\"absolute inset-x-0 top-0 h-[52px] cursor-pointer rounded-t-[4px] outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[#43349a]\"\n              />\n            </div>\n          </motion.div>\n          </div>\n\n          {/* front of the pocket: a thumb notch cut in its top edge, glued down both sides */}\n          <div aria-hidden=\"true\" className=\"pointer-events-none absolute\" style={{ left: L.px, top: FRONT_Y, width: PW, height: FLOOR - FRONT_Y, transform: \"translateZ(10px)\", filter: \"drop-shadow(0 -1px 1px rgba(70,45,5,0.4)) drop-shadow(0 -3px 5px rgba(70,45,5,0.18))\" }}>\n            <div className=\"absolute inset-0 rounded-b-[3px]\" style={{ ...paper, WebkitMaskImage: \"radial-gradient(circle 31px at 50% -3px, rgba(0,0,0,0) 30px, #000 31px)\", maskImage: \"radial-gradient(circle 31px at 50% -3px, rgba(0,0,0,0) 30px, #000 31px)\" }}>\n              <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(120,80,20,0.2) 0, rgba(255,255,255,0.3) 2px, rgba(255,255,255,0) 12px, rgba(120,80,20,0.16) 13px, rgba(0,0,0,0) 15px, rgba(0,0,0,0) calc(100% - 15px), rgba(120,80,20,0.16) calc(100% - 13px), rgba(255,255,255,0) calc(100% - 12px), rgba(90,60,10,0.25) 100%)\" }} />\n              <div className=\"absolute inset-x-0 top-0 h-[3px]\" style={{ background: \"linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0))\" }} />\n              <div className=\"absolute inset-x-0 bottom-0 h-[16px]\" style={{ background: \"linear-gradient(0deg, rgba(90,60,10,0.3), rgba(90,60,10,0))\" }} />\n              <div className=\"absolute inset-x-[30px] top-[50px] text-center text-[#3a2a12]\" style={{ mixBlendMode: \"multiply\" }}>\n                <svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" className=\"mx-auto\">\n                  <circle cx=\"15\" cy=\"15\" r=\"13.5\" stroke=\"currentColor\" strokeWidth=\"1\" />\n                  <path d=\"M8 20V11l7-3 7 3v9M8 20h14M12 20v-6M15 20v-6M18 20v-6\" stroke=\"currentColor\" strokeWidth=\"1\" />\n                </svg>\n                <p className=\"mt-[9px] font-serif text-[12.5px] uppercase tracking-[0.24em]\">{library.name}</p>\n                <div className=\"mx-auto mt-[9px] h-px w-[150px] bg-[#3a2a12]/60\" />\n                <p className=\"mx-auto mt-[9px] max-w-[220px] font-serif text-[10.5px] italic leading-[1.5]\">A date is stamped on this card each time an evening is announced. Please leave it in the pocket.</p>\n              </div>\n              <span className=\"absolute right-[20px] top-[14px] font-mono text-[10px] font-bold tracking-[0.12em] text-[#a3261b]\" style={{ mixBlendMode: \"multiply\" }}>\n                {library.number}\n              </span>\n            </div>\n          </div>\n\n          {/* the dater, seen from straight above */}\n          <motion.div aria-hidden=\"true\" className=\"pointer-events-none absolute left-0 top-0 rounded-[14px] bg-[#1f1750]\" style={{ width: SW, height: SH, transform: shade, filter: shadeBlur, opacity: shadeFade }} />\n          <motion.button\n            type=\"button\"\n            onClick={() => {\n              hand();\n              stamp();\n            }}\n            aria-disabled={busy}\n            aria-label={full ? \"Put this card away and start a new one\" : `Stamp the next date, ${next.date}, ${next.what}`}\n            className=\"absolute left-0 top-0 block cursor-pointer rounded-[13px] outline-none focus-visible:ring-[3px] focus-visible:ring-[#43349a] focus-visible:ring-offset-2 focus-visible:ring-offset-[#c9c6ea]\"\n            style={{ width: SW, height: SH, transform: body, backgroundColor: \"#17171a\", backgroundImage: \"linear-gradient(180deg, #4a4a52 0%, #26262b 12%, #141417 55%, #0a0a0c 100%)\", boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 3px rgba(0,0,0,0.8), inset 2px 0 2px rgba(255,255,255,0.08), inset -2px 0 3px rgba(0,0,0,0.6), 0 0 0 1px #050506, 0 0 0 4px #1b1b1f, 0 0 0 5px #000, 0 1px 0 5px rgba(255,255,255,0.18)\" }}\n          >\n            {/* ridged grips at either end */}\n            {[0, 1].map((side) => (\n              <span key={side} aria-hidden=\"true\" className=\"absolute inset-y-[9px] w-[13px] rounded-[3px]\" style={{ [side ? \"right\" : \"left\"]: 6, backgroundImage: \"repeating-linear-gradient(180deg, #050506 0 1.5px, #3c3c44 1.5px 2.5px, #1c1c20 2.5px 4px)\", boxShadow: \"inset 0 0 2px rgba(0,0,0,0.9)\" }} />\n            ))}\n            {/* four knurled wheels that set day, month and year */}\n            <span aria-hidden=\"true\" className=\"absolute left-1/2 top-[7px] flex -translate-x-1/2 gap-[5px]\">\n              {[0, 1, 2, 3].map((w) => (\n                <span key={w} className=\"block h-[11px] w-[19px] rounded-[2px]\" style={{ backgroundImage: \"repeating-linear-gradient(90deg, #6f7178 0 1px, #e9eaee 1px 2px, #9b9da5 2px 3px), linear-gradient(180deg, rgba(255,255,255,0.5), rgba(0,0,0,0.3))\", backgroundBlendMode: \"multiply, normal\", boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 1px rgba(0,0,0,0.6), 0 1px 1px rgba(0,0,0,0.8)\" }} />\n              ))}\n            </span>\n            {/* the index window: a paper slip under clear plastic that shows what it will print */}\n            <span aria-hidden=\"true\" className=\"absolute left-1/2 top-[25px] flex h-[34px] w-[104px] -translate-x-1/2 items-center justify-center overflow-hidden rounded-[4px] bg-[#f1ead8]\" style={{ boxShadow: \"inset 0 2px 3px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.18), 0 0 0 1.5px #050506\" }}>\n              <span className=\"font-mono text-[12px] font-bold tracking-[0.04em]\" style={{ color: INKS.violet }}>\n                {full ? \"NEW CARD\" : next.date}\n              </span>\n              <span className=\"absolute inset-0\" style={{ background: \"linear-gradient(115deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.1) 26%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.12) 100%)\" }} />\n            </span>\n            {/* a dot of the ink it is loaded with, and the long reflection of the lamp across its gloss top */}\n            <span aria-hidden=\"true\" className=\"absolute bottom-[5px] left-1/2 h-[5px] w-[22px] -translate-x-1/2 rounded-full\" style={{ backgroundColor: INKS.violet, boxShadow: \"inset 0 1px 1px rgba(255,255,255,0.5), 0 0 0 1px #050506\" }} />\n            <span aria-hidden=\"true\" className=\"absolute inset-0 rounded-[13px]\" style={{ background: \"linear-gradient(108deg, rgba(255,255,255,0) 18%, rgba(255,255,255,0.16) 24%, rgba(255,255,255,0.03) 34%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.07) 78%, rgba(255,255,255,0) 84%)\" }} />\n            <span aria-hidden=\"true\" className=\"absolute inset-x-[16px] top-[2px] h-[5px] rounded-full\" style={{ background: \"linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.5) 30%, rgba(255,255,255,0.15) 70%, rgba(255,255,255,0))\" }} />\n          </motion.button>\n         </motion.div>\n        </div>\n      </div>\n\n      <div className=\"relative flex items-end justify-between gap-4 px-5 pb-5 sm:px-8 sm:pb-7\">\n        <p aria-live=\"polite\" className=\"font-mono text-[11px] uppercase leading-relaxed tracking-[0.18em] text-[#3f3a75]\">\n          <span className=\"text-[#17143a]\">\n            {stamped} of {dates.length} dates stamped\n          </span>\n          <span className=\"block\">{full ? \"Card full: press the stamp for a new one\" : `Next: ${next.what}`}</span>\n        </p>\n        <button\n          type=\"button\"\n          onClick={() => {\n            hand();\n            stamp();\n          }}\n          aria-disabled={busy}\n          className=\"min-h-[40px] shrink-0 rounded-full border border-[#17143a]/40 bg-white/40 px-4 font-mono text-[11px] uppercase tracking-[0.18em] text-[#17143a] outline-none transition-colors hover:bg-white/80 focus-visible:ring-2 focus-visible:ring-[#17143a]\"\n        >\n          {full ? \"New card\" : \"Stamp next\"}\n        </button>\n      </div>\n      <style>{`@keyframes library-date-due-card-strike { 0% { opacity: 0; } 100% { opacity: 1; } }\n.library-date-due-struck { animation: library-date-due-card-strike 60ms linear both; }\n@media (prefers-reduced-motion: reduce) { .library-date-due-struck { animation: none; } }`}</style>\n    </section>\n  );\n}\n"}]}
