{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"wooden-block-perpetual-calendar-date-picker-with-number-cubes-you-lift-turn-and-drop-into-a-walnut-cradle","type":"registry:component","title":"Wooden Block Perpetual Calendar Date Picker with Number Cubes You Lift, Turn and Drop into a Walnut Cradle","description":"Date picker built as a perpetual calendar: maple number cubes and a month bar lift out of a walnut cradle, turn and drop back. Free React and HTML to copy.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/wooden-block-perpetual-calendar-date-picker-with-number-cubes-you-lift-turn-and-drop-into-a-walnut-cradle.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport type { CSSProperties, KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent, ReactNode } from \"react\";\nimport { animate, motion, useMotionValue, useReducedMotion, useSpring, useTransform } from \"framer-motion\";\nimport type { MotionValue } from \"framer-motion\";\n\nconst VENUE = \"Kiln & Ash supper club\"; // the small line under the date\nconst NOTE = \"one long table, 7 pm\"; // second half of that line\nconst AUTOPLAY = true; // turn a block every few seconds until the calendar is first touched\nconst OPEN_ON = 6; // weekday the calendar opens on (0 Sunday ... 6 Saturday), the next one after today\n\nconst S = 200, BAR = 66, GAP = 6, W = S * 2 + GAP, CHEEK = 28, CHEEK_H = 178, BASE_H = 30, DEPTH = 236, BASE_W = W + CHEEK * 2 + 34;\nconst DOW = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\nconst MON = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nconst NUMERALS = '\"Bodoni 72\", Didot, \"Bodoni MT\", \"Times New Roman\", serif';\nconst mod = (a: number, n: number) => ((a % n) + n) % n;\n\n// Wood drawn once into a small canvas: long grain, upright grain or end grain.\nfunction wood(w: number, h: number, lo: number[], hi: number[], seed: number, kind: \"long\" | \"upright\" | \"end\") {\n  const c = document.createElement(\"canvas\"); c.width = w; c.height = h;\n  const x = c.getContext(\"2d\"); if (!x) return \"\";\n  const img = x.createImageData(w, h), d = img.data;\n  const hash = (i: number, j: number) => { const n = Math.sin(i * 127.1 + j * 311.7 + seed * 74.7) * 43758.5453; return n - Math.floor(n); };\n  const noise = (a: number, b: number) => {\n    const i = Math.floor(a), j = Math.floor(b), u = a - i, v = b - j, p = u * u * (3 - 2 * u), q = v * v * (3 - 2 * v);\n    return hash(i, j) * (1 - p) * (1 - q) + hash(i + 1, j) * p * (1 - q) + hash(i, j + 1) * (1 - p) * q + hash(i + 1, j + 1) * p * q;\n  };\n  for (let py = 0; py < h; py++) for (let px = 0; px < w; px++) {\n    const a = kind === \"upright\" ? py : px, b = kind === \"upright\" ? px : py;\n    let t: number;\n    if (kind === \"end\") {\n      const dx = px - w * 0.15, dy = py - h * 1.5, r = Math.sqrt(dx * dx + dy * dy) + 16 * noise(px * 0.011, py * 0.011);\n      t = 0.34 + 0.3 * (0.5 + 0.5 * Math.sin(r * 0.36 + 4 * noise(r * 0.015, 2))) + 0.3 * noise(px * 0.35, py * 0.35) + 0.12 * noise(px * 0.05, py * 0.05);\n    } else {\n      const u = b + 30 * noise(a * 0.0035, b * 0.011) + 7 * noise(a * 0.018, b * 0.05);\n      t = 0.5 * noise(u * 0.2, a * 0.0018) + 0.32 * noise(u * 0.62, a * 0.005) + 0.2 * noise(u * 1.9, a * 0.02) + 0.06 * hash(px, py);\n      const pore = noise(a * 0.04, u * 1.7); if (pore > 0.76) t -= (pore - 0.76) * 1.5;\n      t += 0.1 * Math.sin(a * 0.011 + 5 * noise(u * 0.02, 7)); // slow shimmer along the board\n    }\n    t = Math.max(0, Math.min(1, t)); const q = (py * w + px) * 4;\n    d[q] = lo[0] + (hi[0] - lo[0]) * t; d[q + 1] = lo[1] + (hi[1] - lo[1]) * t; d[q + 2] = lo[2] + (hi[2] - lo[2]) * t; d[q + 3] = 255;\n  }\n  x.putImageData(img, 0, 0);\n  return c.toDataURL(\"image/jpeg\", 0.88);\n}\ntype Tex = { maple: string; mapleEnd: string; walnut: string; walnutUp: string; walnutEnd: string };\n// Each face shows its own patch of the sheet, chosen so the edge of the sheet never crosses it.\nconst skin = (url: string, fallback: string, seed: number, w: number, h: number, size = 512): CSSProperties => ({ backgroundColor: fallback, backgroundImage: url ? `url(${url})` : undefined, backgroundSize: `${size}px ${size}px`, backgroundPosition: `-${Math.round(mod(seed * 97.3, Math.max(1, size - w)))}px -${Math.round(mod(seed * 61.7, Math.max(1, size - h)))}px` });\nconst BEVEL = \"inset 0 3px 2px -1px rgba(255,247,230,0.55), inset 3px 0 2px -1px rgba(255,247,230,0.28), inset 0 -4px 3px -1px rgba(70,36,8,0.55), inset -4px 0 3px -1px rgba(70,36,8,0.45), inset 0 0 18px rgba(120,70,24,0.3)\";\n\n// A fixed block of wood: front, top and both ends, each shaded for one light from the upper left.\nfunction Box({ w, h, d, x, y, z, front, top, side, children }: { w: number; h: number; d: number; x: number; y: number; z: number; front: CSSProperties; top: CSSProperties; side: CSSProperties; children?: ReactNode }) {\n  const face = (fw: number, fh: number, transform: string, s: CSSProperties, shade: string) => (\n    <div style={{ position: \"absolute\", left: -fw / 2, top: -fh / 2, width: fw, height: fh, transform, borderRadius: 3, ...s }}>\n      <div style={{ position: \"absolute\", inset: 0, borderRadius: 3, background: shade, boxShadow: \"inset 0 2px 1px -1px rgba(255,226,190,0.34), inset 2px 0 1px -1px rgba(255,226,190,0.12), inset 0 -3px 3px -1px rgba(8,3,0,0.6), inset -3px 0 3px -1px rgba(8,3,0,0.5), inset 0 0 12px rgba(20,8,0,0.35)\" }} />\n    </div>\n  );\n  return (\n    <div style={{ position: \"absolute\", transformStyle: \"preserve-3d\", transform: `translate3d(${x}px,${y}px,${z}px)` }}>\n      {face(w, h, `translateZ(${d / 2}px)`, front, \"linear-gradient(180deg,rgba(255,225,190,0.1),rgba(20,8,0,0.2) 55%,rgba(10,4,0,0.42))\")}\n      {face(w, d, `rotateX(90deg) translateZ(${h / 2}px)`, top, \"linear-gradient(180deg,rgba(255,240,215,0.02),rgba(255,236,205,0.2))\")}\n      {face(d, h, `rotateY(90deg) translateZ(${w / 2}px)`, side, \"linear-gradient(90deg,rgba(10,4,0,0.5),rgba(10,4,0,0.66))\")}\n      {face(d, h, `rotateY(-90deg) translateZ(${w / 2}px)`, side, \"rgba(10,4,0,0.2)\")}\n      {children}\n    </div>\n  );\n}\n\n// One of the four long faces of a turning block. Its shade follows the angle it is held at.\nfunction Side({ i, rot, w, s, style, ring, children }: { i: number; rot: MotionValue<number>; w: number; s: number; style: CSSProperties; ring: boolean; children: ReactNode }) {\n  const lit = (r: number) => { const a = ((r + i * 90) * Math.PI) / 180; return Math.max(0, 0.86 * Math.sin(a) + 0.5 * Math.cos(a)); };\n  const dark = useTransform(rot, (r) => Math.min(0.62, (1 - lit(r)) * 0.56));\n  const shine = useTransform(rot, (r) => Math.max(0, lit(r) - 0.7) * 0.55);\n  return (\n    <div style={{ position: \"absolute\", left: -w / 2, top: -s / 2, width: w, height: s, transform: `rotateX(${i * 90}deg) translateZ(${s / 2}px)`, borderRadius: 5, backfaceVisibility: \"hidden\", ...style }}>\n      <div className=\"flex h-full w-full select-none items-center justify-center\">{children}</div>\n      <motion.div style={{ position: \"absolute\", inset: 0, borderRadius: 5, background: \"#1c0d02\", opacity: dark }} />\n      <motion.div style={{ position: \"absolute\", inset: 0, borderRadius: 5, background: \"linear-gradient(180deg,#fff8ea,rgba(255,248,234,0.4))\", opacity: shine }} />\n      <div style={{ position: \"absolute\", inset: 0, borderRadius: 5, boxShadow: ring ? \"inset 0 0 0 4px #fff, inset 0 0 0 7px #0f2a2e\" : BEVEL }} />\n    </div>\n  );\n}\n\n// A block that shows `value` on its front. A new value comes up from underneath (or down from the top when it is already there):\n// the block is lifted clear, turned a quarter and dropped back.\nfunction Turner({ value, before, w, s, x, y, z, slide, tex, seed, ring, render }: { value: string; before: string; w: number; s: number; x: number; y: number; z: number; slide: boolean; tex: Tex | null; seed: number; ring: boolean; render: (v: string) => ReactNode }) {\n  const reduce = useReducedMotion();\n  const st = useRef({ step: 0, faces: [value, before, \"\", \"\"] });\n  const [, bump] = useState(0);\n  const rot = useMotionValue(0), lift = useMotionValue(0);\n  const my = useTransform(lift, (v) => y - v * (slide ? 5 : 78)), mz = useTransform(lift, (v) => z + (slide ? v * 96 : 0));\n  const shadow = useTransform(lift, (v) => 0.85 - v * 0.5), spread = useTransform(lift, (v) => 1 + v * 0.14);\n  useEffect(() => {\n    const q = st.current, f = mod(q.step, 4);\n    if (q.faces[f] === value) return;\n    if (q.faces[mod(f + 1, 4)] === value) { q.step += 1; q.faces[mod(q.step + 1, 4)] = before; }\n    else { q.faces[mod(f - 1, 4)] = value; q.step -= 1; }\n    bump((n) => n + 1);\n    if (reduce) { rot.set(-90 * q.step); return; }\n    const a = animate(lift, [0, 1, 1, 0, 0.07, 0], { duration: 0.74, times: [0, 0.24, 0.56, 0.8, 0.9, 1], ease: [\"easeOut\", \"linear\", \"easeIn\", \"easeOut\", \"easeIn\"] });\n    const b = animate(rot, -90 * q.step, { delay: 0.1, duration: 0.4, ease: [0.4, 0, 0.2, 1] });\n    return () => { a.stop(); b.stop(); rot.set(-90 * q.step); lift.set(0); };\n  }, [value, before, reduce, rot, lift]);\n  const maple = tex?.maple ?? \"\", core = s - 6;\n  return (\n    <>\n      {!slide && (\n        <div aria-hidden=\"true\" style={{ position: \"absolute\", left: x - w / 2, top: -DEPTH / 2 + 18, width: w, height: DEPTH - 36, transform: `translate3d(0,${y + s / 2 - 0.6}px,0) rotateX(90deg)` }}>\n          <motion.div style={{ position: \"absolute\", inset: 0, background: \"radial-gradient(closest-side,rgba(12,5,0,0.9),rgba(12,5,0,0.5) 70%,rgba(12,5,0,0))\", filter: \"blur(5px)\", opacity: shadow, scale: spread }} />\n        </div>\n      )}\n      <motion.div style={{ position: \"absolute\", transformStyle: \"preserve-3d\", x, y: my, z: mz }}>\n        <motion.div style={{ position: \"absolute\", transformStyle: \"preserve-3d\", rotateX: rot }}>\n          {[0, 1, 2, 3].map((i) => <div key={`c${i}`} style={{ position: \"absolute\", left: -(w - 6) / 2, top: -core / 2, width: w - 6, height: core, transform: `rotateX(${i * 90}deg) translateZ(${core / 2}px)`, background: \"#b98a52\" }} />)}\n          {[0, 1, 2, 3].map((i) => (\n            <Side key={i} i={i} rot={rot} w={w} s={s} ring={ring} style={skin(maple, \"#dcb680\", seed * 3.1 + i * 1.7, w, s)}>{render(st.current.faces[i])}</Side>\n          ))}\n          {[1, -1].map((dir) => (\n            <div key={dir} style={{ position: \"absolute\", left: -s / 2, top: -s / 2, width: s, height: s, borderRadius: 5, transform: `rotateY(${dir * 90}deg) translateZ(${w / 2}px)`, boxShadow: BEVEL, ...skin(tex?.mapleEnd ?? \"\", \"#c9a06a\", seed + dir, s, s, 256) }}>\n              <div style={{ position: \"absolute\", inset: 0, borderRadius: 5, background: dir > 0 ? \"linear-gradient(90deg,rgba(24,10,0,0.42),rgba(24,10,0,0.6))\" : \"rgba(24,10,0,0.2)\" }} />\n            </div>\n          ))}\n        </motion.div>\n      </motion.div>\n    </>\n  );\n}\n\nexport default function WoodenBlockPerpetualCalendar() {\n  const reduce = useReducedMotion();\n  const [today] = useState(() => { const n = new Date(); return new Date(n.getFullYear(), n.getMonth(), n.getDate()); });\n  const [pick, setPick] = useState(() => { const d = new Date(today.getFullYear(), today.getMonth(), today.getDate() + (mod(OPEN_ON - today.getDay(), 7) || 7)); return { m: d.getMonth(), d: d.getDate() }; });\n  const [tex, setTex] = useState<Tex | null>(null);\n  const [focus, setFocus] = useState<\"\" | \"day\" | \"month\">(\"\");\n  const touched = useRef(false), stage = useRef<HTMLDivElement>(null), drag = useRef({ y: 0, moved: false, on: false });\n  const px = useMotionValue(0), py = useMotionValue(0), sway = useMotionValue(0);\n  const sx = useSpring(px, { stiffness: 60, damping: 14 }), sy = useSpring(py, { stiffness: 60, damping: 14 });\n  const rotateY = useTransform([sx, sway], ([a, b]: number[]) => -25 + a * 9 + b * 2.4), rotateX = useTransform(sy, (v) => -17 - v * 5);\n\n  // The year is not on the blocks: it is the next time that date comes round.\n  const yearOf = (m: number, d: number) => (new Date(today.getFullYear(), m, d) < today ? today.getFullYear() + 1 : today.getFullYear());\n  const lengthOf = (m: number) => new Date(yearOf(m, 28), m + 1, 0).getDate();\n  const date = new Date(yearOf(pick.m, pick.d), pick.m, pick.d), len = lengthOf(pick.m);\n  const label = `${DOW[date.getDay()]} ${pick.d} ${MON[pick.m]}`;\n  const stepDay = (n: number) => setPick((p) => { const y = new Date(today.getFullYear(), p.m, p.d) < today ? today.getFullYear() + 1 : today.getFullYear(), d = new Date(y, p.m, p.d + n); return { m: d.getMonth(), d: d.getDate() }; });\n  const setDay = (d: number) => setPick((p) => ({ m: p.m, d: Math.max(1, Math.min(lengthOf(p.m), d)) }));\n  const stepMonth = (n: number) => setPick((p) => { const m = mod(p.m + n, 12); return { m, d: Math.min(p.d, lengthOf(m)) }; });\n  const touch = () => { touched.current = true; };\n\n  useEffect(() => {\n    setTex({ maple: wood(512, 512, [200, 154, 98], [240, 212, 166], 3, \"long\"), mapleEnd: wood(256, 256, [168, 120, 70], [226, 190, 140], 5, \"end\"), walnut: wood(512, 512, [44, 26, 16], [122, 80, 48], 8, \"long\"), walnutUp: wood(512, 512, [44, 26, 16], [118, 76, 46], 11, \"upright\"), walnutEnd: wood(256, 256, [40, 24, 14], [104, 68, 40], 13, \"end\") });\n  }, []);\n  useEffect(() => {\n    if (reduce) return;\n    const s = animate(sway, [-1, 1], { duration: 7, repeat: Infinity, repeatType: \"mirror\", ease: \"easeInOut\" });\n    let seen = true;\n    const io = new IntersectionObserver(([e]) => { seen = e.isIntersecting; });\n    if (stage.current) io.observe(stage.current);\n    let timer = 0;\n    const first = window.setTimeout(() => {\n      const tick = () => { if (!touched.current && seen && !document.hidden) stepDay(1); };\n      if (AUTOPLAY) { tick(); timer = window.setInterval(tick, 2600); }\n    }, 3050);\n    return () => { s.stop(); io.disconnect(); window.clearTimeout(first); window.clearInterval(timer); };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [reduce]);\n\n  const onMove = (e: ReactPointerEvent) => { const b = e.currentTarget.getBoundingClientRect(); px.set(((e.clientX - b.left) / b.width - 0.5) * 2); py.set(((e.clientY - b.top) / b.height - 0.5) * 2); };\n  const onLeave = () => { px.set(0); py.set(0); };\n  // Drag a block up to roll on, down to roll back; a plain press rolls it on once.\n  const grab = (step: (n: number) => void, press: () => void) => ({\n    onPointerDown: (e: ReactPointerEvent) => { touch(); drag.current = { y: e.clientY, moved: false, on: true }; e.currentTarget.setPointerCapture(e.pointerId); },\n    onPointerMove: (e: ReactPointerEvent) => { const g = drag.current; if (!g.on) return; const dy = e.clientY - g.y; if (Math.abs(dy) > 34) { step(dy < 0 ? 1 : -1); g.y = e.clientY; g.moved = true; } },\n    onPointerUp: () => { const g = drag.current; if (g.on && !g.moved) press(); g.on = false; },\n    onPointerCancel: () => { drag.current.on = false; },\n  });\n  const keys = (step: (n: number) => void, big: number, home: () => void, end: () => void) => (e: ReactKeyboardEvent) => {\n    const k = e.key;\n    if (k === \"ArrowUp\" || k === \"ArrowRight\") step(1); else if (k === \"ArrowDown\" || k === \"ArrowLeft\") step(-1); else if (k === \"PageUp\") step(big); else if (k === \"PageDown\") step(-big); else if (k === \"Home\") home(); else if (k === \"End\") end(); else return;\n    e.preventDefault(); touch();\n  };\n  const watch = (name: \"day\" | \"month\") => ({ onFocus: (e: { currentTarget: Element }) => setFocus(e.currentTarget.matches(\":focus-visible\") ? name : \"\"), onBlur: () => setFocus(\"\") });\n\n  const tens = Math.floor(pick.d / 10), ones = pick.d % 10;\n  const prev = new Date(date.getFullYear(), pick.m, pick.d - 1).getDate();\n  const digit = (v: string) => <span style={{ fontFamily: NUMERALS, fontSize: 176, lineHeight: 1, fontWeight: 700, color: \"#2a1608\", opacity: 0.92, mixBlendMode: \"multiply\", textShadow: \"0 1.5px 0 rgba(255,240,214,0.6)\", transform: \"translateY(-4px)\" }}>{v}</span>;\n  const word = (v: string) => <span style={{ fontFamily: NUMERALS, fontSize: 34, lineHeight: 1, fontWeight: 700, letterSpacing: \"0.34em\", marginRight: \"-0.34em\", color: \"#2a1608\", opacity: 0.9, mixBlendMode: \"multiply\", textShadow: \"0 1px 0 rgba(255,240,214,0.6)\", textTransform: \"uppercase\" }}>{v}</span>;\n  const wal = (seed: number, w: number, h: number) => skin(tex?.walnut ?? \"\", \"#5a3a22\", seed, w, h), walUp = (seed: number, w: number) => skin(tex?.walnutUp ?? \"\", \"#573821\", seed, w, CHEEK_H), walEnd = (seed: number) => skin(tex?.walnutEnd ?? \"\", \"#4a2e1a\", seed, DEPTH, BASE_H, 256);\n  const map = (seed: number, h: number) => skin(tex?.maple ?? \"\", \"#dcb680\", seed, W, h);\n  const arrow = \"flex h-10 w-10 items-center justify-center rounded-full text-[#b9d2cf] outline-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-white motion-reduce:transition-none\";\n  const cubeY = -BAR - S / 2, barZ = (DEPTH - 38) / 3;\n\n  return (\n    <div ref={stage} onPointerMove={onMove} onPointerLeave={onLeave} className=\"relative flex min-h-[720px] w-full flex-col items-center justify-center overflow-hidden bg-[#0f2a2e] bg-[radial-gradient(95%_70%_at_38%_30%,#2a5f63_0%,#143438_52%,#0a1d20_100%)] px-4 py-10\">\n      <div className=\"-my-[86px] h-[470px] w-[640px] shrink-0 scale-[0.56] sm:-my-6 sm:scale-[0.86] lg:my-0 lg:scale-100\">\n        <div className=\"relative h-full w-full\" style={{ perspective: 1900, perspectiveOrigin: \"50% 30%\" }}>\n          <motion.div role=\"group\" aria-label=\"Date\" style={{ position: \"absolute\", left: \"50%\", top: 340, transformStyle: \"preserve-3d\", rotateX, rotateY }}>\n            <div aria-hidden=\"true\" style={{ position: \"absolute\", left: -470, top: -330, width: 1020, height: 660, transform: `translate3d(60px,${BASE_H + 1}px,30px) rotateX(90deg)`, background: \"radial-gradient(closest-side,rgba(2,8,9,0.78),rgba(2,8,9,0.5) 46%,rgba(2,8,9,0) 100%)\", filter: \"blur(16px)\" }} />\n            <div aria-hidden=\"true\" style={{ position: \"absolute\", left: -BASE_W / 2 - 14, top: -DEPTH / 2 - 14, width: BASE_W + 60, height: DEPTH + 28, transform: `translate3d(14px,${BASE_H + 0.5}px,6px) rotateX(90deg)`, background: \"rgba(0,4,5,0.85)\", borderRadius: 12, filter: \"blur(9px)\" }} />\n            <Box w={BASE_W} h={BASE_H} d={DEPTH} x={0} y={BASE_H / 2} z={0} front={wal(2, BASE_W, BASE_H)} top={wal(5, BASE_W, DEPTH)} side={walEnd(1)} />\n            {[-1, 1].map((dir) => <Box key={dir} w={CHEEK} h={CHEEK_H} d={DEPTH - 30} x={dir * (W / 2 + CHEEK / 2 + 3)} y={-CHEEK_H / 2} z={0} front={walUp(dir + 3, CHEEK)} top={wal(dir + 7, CHEEK, DEPTH)} side={walUp(dir + 9, DEPTH)} />)}\n            {[-1, 0].map((k) => <Box key={k} w={W} h={BAR} d={barZ} x={0} y={-BAR / 2} z={k * barZ} front={map(k + 11, BAR)} top={map(k + 14, barZ)} side={skin(tex?.mapleEnd ?? \"\", \"#c9a06a\", k + 4, barZ, BAR, 256)} />)}\n            <div role=\"spinbutton\" tabIndex={0} aria-label=\"Month\" aria-valuemin={1} aria-valuemax={12} aria-valuenow={pick.m + 1} aria-valuetext={MON[pick.m]} onKeyDown={keys(stepMonth, 3, () => setPick((p) => ({ m: 0, d: Math.min(p.d, lengthOf(0)) })), () => setPick((p) => ({ m: 11, d: p.d })))} {...watch(\"month\")} {...grab(stepMonth, () => stepMonth(1))} className=\"cursor-grab touch-none outline-none active:cursor-grabbing\" style={{ position: \"absolute\", transformStyle: \"preserve-3d\" }}>\n              <Turner value={MON[pick.m]} before={MON[mod(pick.m - 1, 12)]} w={W} s={BAR} x={0} y={-BAR / 2} z={barZ + (BAR - barZ) / 2 - 1} slide tex={tex} seed={4} ring={focus === \"month\"} render={word} />\n            </div>\n            <div role=\"spinbutton\" tabIndex={0} aria-label=\"Day\" aria-valuemin={1} aria-valuemax={len} aria-valuenow={pick.d} aria-valuetext={label} onKeyDown={keys(stepDay, 7, () => setDay(1), () => setDay(31))} {...watch(\"day\")} className=\"cursor-grab touch-none outline-none active:cursor-grabbing\" style={{ position: \"absolute\", transformStyle: \"preserve-3d\" }}>\n              <div {...grab((n) => stepDay(n * 10), () => setDay(pick.d + 10 <= len ? pick.d + 10 : pick.d % 10 || 10))} style={{ position: \"absolute\", transformStyle: \"preserve-3d\" }}>\n                <Turner value={String(tens)} before={String(mod(tens - 1, 4))} w={S} s={S} x={-(S + GAP) / 2} y={cubeY} z={0} slide={false} tex={tex} seed={1} ring={focus === \"day\"} render={digit} />\n              </div>\n              <div {...grab(stepDay, () => stepDay(1))} style={{ position: \"absolute\", transformStyle: \"preserve-3d\" }}>\n                <Turner value={String(ones)} before={String(prev % 10)} w={S} s={S} x={(S + GAP) / 2} y={cubeY} z={0} slide={false} tex={tex} seed={2} ring={focus === \"day\"} render={digit} />\n              </div>\n            </div>\n          </motion.div>\n        </div>\n      </div>\n      <div className=\"relative mt-4 flex items-center gap-1 sm:mt-8\">\n        <button type=\"button\" onClick={() => { touch(); stepDay(-1); }} aria-label=\"Previous day\" className={arrow}>\n          <svg aria-hidden=\"true\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"M12 4.5 6.5 10l5.5 5.5\" /></svg>\n        </button>\n        <p aria-live=\"polite\" className=\"min-w-[230px] text-center\">\n          <span className=\"block text-[17px] font-semibold leading-6 tracking-tight text-white\">{label} <span className=\"font-normal text-[#b9d2cf]\">{date.getFullYear()}</span></span>\n          <span className=\"block font-mono text-[11px] uppercase leading-5 tracking-[0.16em] text-[#b9d2cf]\">{VENUE} <span className=\"mx-1 hidden text-[#6f9794] sm:inline\">/</span> <span className=\"block sm:inline\">{NOTE}</span></span>\n        </p>\n        <button type=\"button\" onClick={() => { touch(); stepDay(1); }} aria-label=\"Next day\" className={arrow}>\n          <svg aria-hidden=\"true\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"m8 4.5 5.5 5.5L8 15.5\" /></svg>\n        </button>\n      </div>\n    </div>\n  );\n}\n"}]}
