{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"brass-counter-bell-notification-that-rings-and-raises-a-message-card-from-a-slot-in-the-desk","type":"registry:component","title":"Brass Counter Bell Notification That Rings and Raises a Message Card from a Slot in the Desk","description":"Notification drawn as a brass reception bell: press the plunger, the dome rings and a printed card rises with the next message. Free React code and HTML.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/brass-counter-bell-notification-that-rings-and-raises-a-message-card-from-a-slot-in-the-desk.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { motion, useReducedMotion, useSpring } from \"framer-motion\";\n\n/** The messages the bell hands over, in order. Ringing the bell shows the next one. */\nconst notes = [\n  { from: \"Front desk\", time: \"7:42 pm\", title: \"Your table is ready\", body: \"Table nine by the window, laid for four.\" },\n  { from: \"Bookings\", time: \"7:45 pm\", title: \"New booking confirmed\", body: \"Mara Ellison, two nights from Friday.\" },\n  { from: \"Payments\", time: \"7:51 pm\", title: \"Deposit received\", body: \"The garden room is paid for and held.\" },\n  { from: \"Housekeeping\", time: \"8:03 pm\", title: \"Room 14 is made up\", body: \"Fresh linen in, key back on its hook.\" },\n];\n\nconst SOUND = false; // set to true for a short ding on each ring (it only ever plays after the visitor has pressed the bell)\nconst HOLD = 4200; // milliseconds a card stays up while the piece plays by itself\nconst TRAVEL = 400; // how far the card sinks into the desk\n\n// The bell is a turned object, so it is drawn as one: each part is a profile of [radius, height] points spun round the centre.\ntype Pt = [number, number];\nconst CW = 320; // drawing size in CSS pixels at phone width\nconst CH = 260;\nconst CX = 160;\nconst FOOT = 214; // screen y of the centre of the underside\nconst TILT = (14 * Math.PI) / 180; // how far above the desk the eye is\nconst BASE: Pt[] = [[0, 0], [116, 0], [116, 0], [125, 2], [125, 10], [125, 10], [119, 16], [103, 19], [92, 24], [92, 24], [40, 25], [0, 25]];\nconst DOME: Pt[] = [[104, 19], [104, 19], [112, 20], [113.5, 23], [112, 26.5], [112, 26.5], [109, 34], [103, 50], [93, 70], [78, 90], [58, 106], [36, 117], [18, 122], [10, 123], [10, 123], [9.5, 129], [9.5, 129], [5, 130], [0, 130]];\nconst STEM: Pt[] = [[0, 100], [3.4, 100], [3.4, 100], [3.4, 151], [3.4, 151], [10, 151.5], [13, 155], [13.5, 160], [12, 165], [7, 168.5], [0, 169]];\n\n// long wood grain for the desk, as a repeating picture\nconst GRAIN = `url(\"data:image/svg+xml,${encodeURIComponent(\"<svg xmlns='http://www.w3.org/2000/svg' width='900' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.0035 0.18' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.04  0 0 0 0 0.01  0 0 0 -2.6 1.5'/></filter><rect width='900' height='300' filter='url(#n)'/></svg>\")}\")`;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst smooth = (a: number, b: number, v: number) => {\n  const t = clamp((v - a) / (b - a), 0, 1);\n  return t * t * (3 - 2 * t);\n};\nconst band = (v: number, a: number, b: number, s: number) => smooth(a - s, a + s, v) * (1 - smooth(b - s, b + s, v));\n\n/** Round every corner of a profile a little, the way a lathe tool leaves it. Doubled points stay sharp. */\nfunction soften(pts: Pt[], rounds: number): Pt[] {\n  let out = pts;\n  for (let k = 0; k < rounds; k++) {\n    const next: Pt[] = [out[0]];\n    for (let i = 0; i < out.length - 1; i++) {\n      const [r0, h0] = out[i];\n      const [r1, h1] = out[i + 1];\n      next.push([r0 * 0.75 + r1 * 0.25, h0 * 0.75 + h1 * 0.25], [r0 * 0.25 + r1 * 0.75, h0 * 0.25 + h1 * 0.75]);\n    }\n    next.push(out[out.length - 1]);\n    out = next;\n  }\n  return out;\n}\n\n/** What the polished metal sees: a dim lobby, a tall window up to the left, a lamp to the right and the desk below. */\nfunction room(x: number, y: number, z: number): [number, number, number] {\n  const el = Math.asin(clamp(y, -1, 1));\n  const az = Math.atan2(x, z);\n  const high = Math.max(0, el);\n  let r = 0.07 + 0.34 * high * high;\n  let g = 0.05 + 0.3 * high * high;\n  let b = 0.05 + 0.28 * high * high;\n  const win = band(az, -1.2, -0.42, 0.07) * band(el, 0.16, 1.02, 0.07) * (1 - 0.9 * band(az, -0.84, -0.78, 0.022)) * (1 - 0.9 * band(el, 0.56, 0.61, 0.022));\n  r += win * 4.6;\n  g += win * 4.5;\n  b += win * 4.2;\n  const slit = band(az, -0.3, -0.16, 0.03) * band(el, 0.2, 0.95, 0.07);\n  r += slit * 2.4;\n  g += slit * 2.3;\n  b += slit * 2.1;\n  const lamp = band(az, 0.7, 1.0, 0.08) * band(el, 0.04, 0.5, 0.1);\n  r += lamp * 2.3;\n  g += lamp * 1.7;\n  b += lamp * 1.0;\n  const fill = band(az, -0.2, 0.3, 0.22) * band(el, 0.5, 1.2, 0.2);\n  r += fill * 0.55;\n  g += fill * 0.5;\n  b += fill * 0.46;\n  const wall = band(el, 0.0, 0.14, 0.04) * (1 - win) * 0.7;\n  r *= 1 - wall;\n  g *= 1 - wall;\n  b *= 1 - wall;\n  if (el < 0.02) {\n    const d = smooth(0.02, -0.7, el);\n    const k = smooth(0.02, -0.05, el);\n    r = r * (1 - k) + (0.5 - 0.44 * d) * k;\n    g = g * (1 - k) + (0.27 - 0.24 * d) * k;\n    b = b * (1 - k) + (0.13 - 0.12 * d) * k;\n  }\n  return [r, g, b];\n}\n\ntype Part = { pts: Pt[]; metal: 1 | 2 };\n\n/** Spin the profiles, keep the nearest surface at each pixel, then light every pixel once. Drawn at three times size and scaled down for clean edges. */\nfunction turn(parts: Part[]): HTMLCanvasElement {\n  const S = 3;\n  const W = CW * S;\n  const H = CH * S;\n  const sinT = Math.sin(TILT);\n  const cosT = Math.cos(TILT);\n  const depth = new Float32Array(W * H).fill(-1e9);\n  const nx = new Float32Array(W * H);\n  const ny = new Float32Array(W * H);\n  const nz = new Float32Array(W * H);\n  const hh = new Float32Array(W * H);\n  const kind = new Uint8Array(W * H);\n  for (const part of parts) {\n    const p = soften(part.pts, 3);\n    const tn: Pt[] = p.map((_, i) => {\n      const a = p[Math.max(0, i - 1)];\n      const c = p[Math.min(p.length - 1, i + 1)];\n      const dr = c[0] - a[0];\n      const dh = c[1] - a[1];\n      const l = Math.hypot(dr, dh) || 1;\n      return [dh / l, -dr / l];\n    });\n    for (let i = 0; i < p.length - 1; i++) {\n      const steps = Math.max(1, Math.ceil(Math.hypot(p[i + 1][0] - p[i][0], p[i + 1][1] - p[i][1]) * S * 2));\n      for (let s = 0; s < steps; s++) {\n        const t = s / steps;\n        const r = p[i][0] + (p[i + 1][0] - p[i][0]) * t;\n        const h = p[i][1] + (p[i + 1][1] - p[i][1]) * t;\n        let nr = tn[i][0] + (tn[i + 1][0] - tn[i][0]) * t;\n        let nh = tn[i][1] + (tn[i + 1][1] - tn[i][1]) * t;\n        const nl = Math.hypot(nr, nh) || 1;\n        nr /= nl;\n        nh /= nl;\n        const count = Math.ceil(Math.PI * 2 * r * S * 2) + 8;\n        const da = (Math.PI * 2) / count;\n        const ca = Math.cos(da);\n        const sa = Math.sin(da);\n        let c = 1;\n        let sn = 0;\n        for (let k = 0; k < count; k++) {\n          const z = r * sn;\n          const facing = nh * sinT + nr * sn * cosT;\n          if (facing > 0) {\n            const px = Math.round((CX + r * c) * S);\n            const py = Math.round((FOOT - (h * cosT - z * sinT)) * S);\n            if (px >= 0 && px < W && py >= 0 && py < H) {\n              const d = z * cosT + h * sinT;\n              const at = py * W + px;\n              if (d > depth[at]) {\n                depth[at] = d;\n                nx[at] = nr * c;\n                ny[at] = nh;\n                nz[at] = nr * sn;\n                hh[at] = h;\n                kind[at] = part.metal;\n              }\n            }\n          }\n          const c2 = c * ca - sn * sa;\n          sn = sn * ca + c * sa;\n          c = c2;\n        }\n      }\n    }\n  }\n  const sheet = document.createElement(\"canvas\");\n  sheet.width = W;\n  sheet.height = H;\n  const g2 = sheet.getContext(\"2d\");\n  if (!g2) return sheet;\n  const img = g2.createImageData(W, H);\n  const px = img.data;\n  for (let i = 0; i < W * H; i++) {\n    if (!kind[i]) continue;\n    let a = nx[i];\n    let b = ny[i];\n    let c = nz[i];\n    const brass = kind[i] === 1;\n    if (brass) {\n      // the faint rings a spinning chuck leaves in the metal\n      b += 0.02 * Math.sin(hh[i] * 2.6) + 0.012 * Math.sin(hh[i] * 7.1);\n      const l = Math.hypot(a, b, c);\n      a /= l;\n      b /= l;\n      c /= l;\n    }\n    const nv = b * sinT + c * cosT;\n    const [er, eg, eb] = room(2 * nv * a, 2 * nv * b - sinT, 2 * nv * c - cosT);\n    const key = Math.max(0, a * -0.56 + b * 0.6 + c * 0.57);\n    const edge = Math.pow(1 - clamp(nv, 0, 1), 4);\n    let r: number;\n    let g: number;\n    let bl: number;\n    if (brass) {\n      const shade = hh[i] < 30 ? 0.55 + 0.45 * smooth(19, 30, hh[i]) : 1;\n      const body = 0.03 + 0.15 * key;\n      const hot = Math.max(0, (er + eg + eb) / 3 - 1.1);\n      r = (body + er) * 1.0 * shade + hot * 0.5 + edge * er * 0.3;\n      g = (body + eg) * 0.63 * shade + hot * 0.46 + edge * eg * 0.22;\n      bl = (body + eb) * 0.15 * shade + hot * 0.3 + edge * eb * 0.1;\n    } else {\n      // black stove enamel: nearly no colour of its own, a soft mirror on top\n      const shade = hh[i] > 18 ? 0.35 : 1;\n      const f = 0.008 + 0.06 * edge + (er > 1.2 ? 0.07 : 0);\n      r = (0.003 + er * f) * shade;\n      g = (0.003 + eg * f) * shade;\n      bl = (0.004 + eb * f) * shade;\n    }\n    const o = i * 4;\n    px[o] = 255 * Math.pow(1 - Math.exp(-r * 1.5), 0.4545);\n    px[o + 1] = 255 * Math.pow(1 - Math.exp(-g * 1.5), 0.4545);\n    px[o + 2] = 255 * Math.pow(1 - Math.exp(-bl * 1.5), 0.4545);\n    px[o + 3] = 255;\n  }\n  g2.putImageData(img, 0, 0);\n  return sheet;\n}\n\nexport default function BrassCounterBellNotification() {\n  const reduce = !!useReducedMotion();\n  const rootRef = useRef<HTMLElement>(null);\n  const bellRef = useRef<HTMLButtonElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const [index, setIndex] = useState(0);\n  const [up, setUp] = useState(true);\n  const [said, setSaid] = useState(\"\");\n  const live = useRef({ index: 0, up: true, press: 0, pressTo: 0, pressVel: 0, rang: -1e9, paused: false, touched: false, seen: true, kick: () => {}, audio: null as AudioContext | null });\n  const timers = useRef<number[]>([]);\n\n  const y = useSpring(0, { stiffness: 210, damping: 15, mass: 1 });\n  const lean = useSpring(-1.6, { stiffness: 150, damping: 5, mass: 1 });\n\n  const later = useCallback((fn: () => void, ms: number) => {\n    timers.current.push(window.setTimeout(fn, ms));\n  }, []);\n\n  const ding = useCallback(() => {\n    const s = live.current;\n    if (!SOUND || !s.touched) return;\n    try {\n      s.audio = s.audio || new AudioContext();\n      const t = s.audio.currentTime;\n      [2093, 4186, 5587].forEach((f, i) => {\n        const osc = s.audio!.createOscillator();\n        const gain = s.audio!.createGain();\n        osc.frequency.value = f;\n        gain.gain.setValueAtTime(0.12 / (i + 1), t);\n        gain.gain.exponentialRampToValueAtTime(0.0001, t + 1.6 - i * 0.4);\n        osc.connect(gain).connect(s.audio!.destination);\n        osc.start(t);\n        osc.stop(t + 1.7);\n      });\n    } catch {\n      // no audio available: the bell stays silent\n    }\n  }, []);\n\n  const lower = useCallback(\n    (tell: boolean) => {\n      const s = live.current;\n      if (!s.up) return;\n      s.up = false;\n      setUp(false);\n      if (reduce) y.jump(TRAVEL);\n      else y.set(TRAVEL);\n      if (tell) {\n        setSaid(\"Message put away. Ring the bell for the next one.\");\n        // the button on the card is about to leave the tab order, so hand focus to the bell\n        if (rootRef.current?.contains(document.activeElement)) bellRef.current?.focus();\n      }\n    },\n    [reduce, y],\n  );\n\n  const raise = useCallback(\n    (to: number) => {\n      const s = live.current;\n      s.index = to;\n      s.up = true;\n      setIndex(to);\n      setUp(true);\n      const n = notes[to];\n      setSaid(`${n.from}: ${n.title}. ${n.body}`);\n      if (reduce) {\n        y.jump(0);\n        return;\n      }\n      y.set(0);\n      lean.jump(to % 2 ? 3.5 : -5);\n      lean.set(to % 2 ? 1.2 : -1.6);\n    },\n    [lean, reduce, y],\n  );\n\n  const ring = useCallback(() => {\n    const s = live.current;\n    const next = (s.index + 1) % notes.length;\n    s.rang = performance.now();\n    s.pressTo = 1;\n    later(() => {\n      s.pressTo = 0;\n      s.kick();\n    }, 110);\n    s.kick();\n    ding();\n    if (s.up) {\n      lower(false);\n      later(() => raise(next), reduce ? 0 : 330);\n    } else later(() => raise(next), reduce ? 0 : 140);\n  }, [ding, later, lower, raise, reduce]);\n\n  // the bell itself: turned once, then redrawn only while it is moving\n  useEffect(() => {\n    const canvas = canvasRef.current;\n    const ctx = canvas?.getContext(\"2d\");\n    if (!canvas || !ctx) return;\n    const s = live.current;\n    const body = turn([{ pts: BASE, metal: 2 }, { pts: DOME, metal: 1 }]);\n    const plunger = turn([{ pts: STEM, metal: 1 }]);\n    const dpr = Math.min(2.6, (window.devicePixelRatio || 1) * 1.3);\n    canvas.width = Math.round(CW * dpr);\n    canvas.height = Math.round(CH * dpr);\n    let raf = 0;\n    let last = 0;\n\n    const paint = (now: number) => {\n      raf = 0;\n      const dt = Math.min(0.032, (now - (last || now)) / 1000);\n      last = now;\n      s.pressVel += ((s.pressTo - s.press) * 900 - s.pressVel * 34) * dt;\n      s.press += s.pressVel * dt;\n      const age = (now - s.rang) / 1000;\n      const hum = reduce || age > 1.3 ? 0 : Math.exp(-age * 3.4) * Math.sin(age * 150) * 1.5;\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      ctx.clearRect(0, 0, CW, CH);\n      ctx.imageSmoothingQuality = \"high\";\n      // where the bell sits on the polished wood: a soft pool of shade and a faint upside-down bell\n      ctx.save();\n      ctx.translate(CX + 4, FOOT + 6);\n      ctx.scale(1, 0.25);\n      const pool = ctx.createRadialGradient(0, 0, 60, 0, 0, 148);\n      pool.addColorStop(0, \"rgba(8,3,2,0.7)\");\n      pool.addColorStop(0.6, \"rgba(8,3,2,0.34)\");\n      pool.addColorStop(1, \"rgba(8,3,2,0)\");\n      ctx.fillStyle = pool;\n      ctx.beginPath();\n      ctx.arc(0, 0, 148, 0, Math.PI * 2);\n      ctx.fill();\n      ctx.restore();\n      ctx.save();\n      ctx.beginPath();\n      ctx.rect(0, FOOT + 4, CW, CH);\n      ctx.clip();\n      ctx.globalAlpha = 0.16;\n      ctx.translate(0, FOOT * 2 + 34);\n      ctx.scale(1, -0.62);\n      ctx.drawImage(body, hum * 0.6, FOOT - FOOT / 0.62 + 2, CW, CH);\n      ctx.restore();\n      ctx.drawImage(plunger, 0, s.press * 8, CW, CH);\n      if (Math.abs(hum) > 0.12) {\n        // a ringing dome is a blur at its edges\n        ctx.globalAlpha = 0.32;\n        ctx.drawImage(body, -hum * 1.3, 0, CW, CH);\n        ctx.globalAlpha = 1;\n      }\n      ctx.drawImage(body, hum, 0, CW, CH);\n      const busy = Math.abs(s.pressTo - s.press) > 0.002 || Math.abs(s.pressVel) > 0.02 || (!reduce && age < 1.3);\n      if (busy && s.seen && !document.hidden) raf = requestAnimationFrame(paint);\n      else last = 0;\n    };\n    s.kick = () => {\n      if (!raf) raf = requestAnimationFrame(paint);\n    };\n    s.kick();\n    const io = new IntersectionObserver(([e]) => {\n      s.seen = e.isIntersecting;\n      if (s.seen) s.kick();\n    });\n    io.observe(canvas);\n    return () => {\n      cancelAnimationFrame(raf);\n      io.disconnect();\n      s.kick = () => {};\n    };\n  }, [reduce]);\n\n  // plays by itself until someone takes over\n  useEffect(() => {\n    const first = notes[0];\n    setSaid(`${first.from}: ${first.title}. ${first.body}`);\n    if (reduce) return;\n    const s = live.current;\n    const loop = window.setInterval(() => {\n      if (s.paused || s.touched || document.hidden || !s.seen) return;\n      ring();\n    }, HOLD);\n    const pending = timers.current;\n    return () => {\n      window.clearInterval(loop);\n      pending.forEach((t) => window.clearTimeout(t));\n    };\n  }, [reduce, ring]);\n\n  const note = notes[index];\n\n  return (\n    <section\n      ref={rootRef}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && live.current.up) {\n          live.current.touched = true;\n          lower(true);\n        }\n      }}\n      onPointerEnter={() => (live.current.paused = true)}\n      onPointerLeave={() => (live.current.paused = false)}\n      onFocus={() => (live.current.paused = true)}\n      onBlur={() => (live.current.paused = false)}\n      className=\"relative h-[590px] overflow-hidden bg-[#2b0f17] sm:h-[700px]\"\n    >\n      <style>{`@keyframes brass-counter-bell-notification-sway { 0%, 100% { transform: rotate(-0.55deg); } 50% { transform: rotate(0.6deg); } } .bcb-sway { animation: brass-counter-bell-notification-sway 3.1s ease-in-out infinite; } @media (prefers-reduced-motion: reduce) { .bcb-sway { animation: none; } }`}</style>\n      {/* the wall: painted plaster with the light from the window falling across it */}\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"radial-gradient(70% 62% at 30% 22%, #6c2a36 0%, #4a1a25 42%, #2a0e16 100%)\" }} />\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 opacity-60\" style={{ background: \"linear-gradient(112deg, rgba(255,214,170,0) 12%, rgba(255,214,170,0.07) 13%, rgba(255,214,170,0.07) 27%, rgba(255,214,170,0) 28%, rgba(255,214,170,0) 31%, rgba(255,214,170,0.06) 32%, rgba(255,214,170,0.06) 46%, rgba(255,214,170,0) 47%)\" }} />\n\n      {/* everything above the slot: the card and the rod it stands on */}\n      <div className=\"pointer-events-none absolute inset-x-0 top-0 bottom-[197px] overflow-hidden sm:bottom-[243px]\">\n        <motion.div className=\"absolute bottom-[150px] left-1/2 w-[min(312px,calc(100%-40px))] sm:bottom-[190px] sm:w-[372px]\" style={{ x: \"-50%\", y, rotate: lean, transformOrigin: \"50% 240%\" }}>\n          <div className=\"bcb-sway relative\" style={{ transformOrigin: \"50% 240%\" }}>\n          <div aria-hidden=\"true\" className=\"absolute left-[7%] top-[9%] h-full w-full rounded-[3px] bg-black/50\" style={{ filter: \"blur(22px)\" }} />\n          <div aria-hidden=\"true\" className=\"absolute left-1/2 top-[calc(100%-4px)] h-[460px] w-[9px] -translate-x-1/2 rounded-[2px]\" style={{ background: \"linear-gradient(90deg, #4f3510 0%, #b98a34 22%, #ffe9a8 40%, #d9a742 55%, #7a5417 82%, #3c2709 100%)\", boxShadow: \"6px 4px 8px rgba(0,0,0,0.4)\" }} />\n          <div className={`relative rounded-[3px] bg-[#f3ead6] px-5 pb-4 pt-4 text-[#2a1d14] sm:px-6 sm:pb-5 sm:pt-5 ${up ? \"pointer-events-auto\" : \"\"}`} style={{ backgroundImage: \"linear-gradient(118deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0) 52%, rgba(94,60,24,0.1) 100%), repeating-linear-gradient(0deg, rgba(120,90,50,0.035) 0 1px, rgba(0,0,0,0) 1px 3px)\", boxShadow: \"0 1px 0 #d9ccb0, 0 2px 0 #c2b393, 0 3px 0 #a99a79, inset 0 0 0 1px rgba(255,255,255,0.5), inset 0 -18px 24px -18px rgba(96,64,28,0.3)\" }}>\n            <div className=\"flex items-baseline justify-between border-b-2 border-[#a3231c] pb-2 font-mono text-[10px] font-semibold uppercase tracking-[0.2em] text-[#a3231c] sm:text-[11px]\">\n              <span>{note.from}</span>\n              <span className=\"text-[#5a4433]\">{note.time}</span>\n            </div>\n            <p className=\"mt-3 font-serif text-[27px] font-semibold leading-[1.05] tracking-[-0.01em] sm:mt-4 sm:text-[34px]\">{note.title}</p>\n            <p className=\"mt-2 text-[14px] leading-snug text-[#4a382a] sm:text-[15px]\">{note.body}</p>\n            <div className=\"mt-4 flex items-center justify-between border-t border-dashed border-[#bdaa86] pt-3\">\n              <span className=\"font-mono text-[10px] uppercase tracking-[0.2em] text-[#5a4433]\">\n                Card {index + 1} of {notes.length}\n              </span>\n              <button\n                type=\"button\"\n                tabIndex={up ? 0 : -1}\n                aria-hidden={!up}\n                onClick={() => {\n                  live.current.touched = true;\n                  lower(true);\n                }}\n                className=\"flex h-10 items-center gap-2 rounded-full border border-[#2a1d14]/30 bg-[#2a1d14]/[0.04] pl-4 pr-3 font-mono text-[10px] font-semibold uppercase tracking-[0.18em] text-[#2a1d14] outline-none transition-colors hover:bg-[#2a1d14]/10 focus-visible:ring-2 focus-visible:ring-[#a3231c] focus-visible:ring-offset-2 focus-visible:ring-offset-[#f3ead6]\"\n              >\n                Put away\n                <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\">\n                  <path d=\"M10 4v10M5.5 10.5 10 15l4.5-4.5\" />\n                </svg>\n              </button>\n            </div>\n            {/* the brass channel that grips the bottom edge */}\n            <div aria-hidden=\"true\" className=\"absolute inset-x-[22%] -bottom-[9px] h-[15px] rounded-[2px]\" style={{ background: \"linear-gradient(180deg, #fff0b8 0%, #e0b24c 18%, #b98a2e 52%, #7d5a17 86%, #4b340c 100%)\", boxShadow: \"0 3px 5px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.6)\" }}>\n              <span className=\"absolute left-[9px] top-1/2 h-[5px] w-[5px] -translate-y-1/2 rounded-full\" style={{ background: \"radial-gradient(circle at 35% 30%, #fff3c4, #8a6418 70%)\", boxShadow: \"inset 0 0 0 0.5px rgba(0,0,0,0.5)\" }} />\n              <span className=\"absolute right-[9px] top-1/2 h-[5px] w-[5px] -translate-y-1/2 rounded-full\" style={{ background: \"radial-gradient(circle at 35% 30%, #fff3c4, #8a6418 70%)\", boxShadow: \"inset 0 0 0 0.5px rgba(0,0,0,0.5)\" }} />\n            </div>\n          </div>\n          </div>\n        </motion.div>\n      </div>\n\n      {/* the desk: a polished top seen from just above, and its front edge */}\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-x-0 bottom-[110px] h-[100px] sm:bottom-[130px] sm:h-[126px]\" style={{ background: \"linear-gradient(180deg, #2a1509 0%, #4a2812 16%, #6b3c1c 58%, #7e4821 100%)\" }}>\n        <div className=\"absolute inset-0 opacity-60\" style={{ backgroundImage: GRAIN, backgroundSize: \"900px 100%\" }} />\n        <div className=\"absolute inset-0\" style={{ background: \"radial-gradient(46% 120% at 34% 100%, rgba(255,214,160,0.2), rgba(255,214,160,0) 70%), linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 22%)\" }} />\n        {/* the slot the card lives in, trimmed in brass */}\n        <div className=\"absolute left-1/2 top-[7px] h-[12px] w-[min(356px,calc(100%-16px))] -translate-x-1/2 rounded-[6px] sm:w-[424px]\" style={{ background: \"linear-gradient(180deg, #6a4a14 0%, #e7bd58 30%, #fbe6a4 48%, #b98a2e 74%, #5c3f0f 100%)\", boxShadow: \"0 2px 3px rgba(0,0,0,0.5)\" }}>\n          <div className=\"absolute inset-x-[5px] inset-y-[3px] rounded-[3px] bg-[#0b0503]\" style={{ boxShadow: \"inset 0 2px 2px rgba(0,0,0,0.9)\" }} />\n        </div>\n      </div>\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-x-0 bottom-0 h-[110px] sm:h-[130px]\" style={{ background: \"linear-gradient(180deg, #c58a4a 0px, #8f5526 3px, #5a3115 9px, #3d200d 40%, #1f0f06 100%)\" }}>\n        <div className=\"absolute inset-0 opacity-30\" style={{ backgroundImage: GRAIN, backgroundSize: \"1500px 100%\", backgroundPosition: \"140px 0\" }} />\n      </div>\n\n      {/* the bell */}\n      <div className=\"absolute bottom-[109px] left-1/2 h-[260px] w-[320px] -translate-x-1/2 sm:bottom-[126px] sm:h-[338px] sm:w-[416px]\">\n        <canvas ref={canvasRef} aria-hidden=\"true\" className=\"h-full w-full\" />\n        <button\n          ref={bellRef}\n          type=\"button\"\n          aria-label=\"Ring the bell for the next message\"\n          onPointerDown={() => {\n            live.current.pressTo = 1;\n            live.current.kick();\n          }}\n          onPointerLeave={() => {\n            live.current.pressTo = 0;\n            live.current.kick();\n          }}\n          onClick={() => {\n            live.current.touched = true;\n            ring();\n          }}\n          className=\"absolute left-[14%] top-[12%] h-[70%] w-[72%] cursor-pointer rounded-[50%_50%_18%_18%] outline-none focus-visible:ring-2 focus-visible:ring-[#ffe2a0] focus-visible:ring-offset-4 focus-visible:ring-offset-transparent\"\n        />\n      </div>\n\n      <p role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n        {said}\n      </p>\n      <p className=\"absolute bottom-5 left-5 font-mono text-[11px] uppercase leading-relaxed tracking-[0.18em] text-[#e8c9a0]/80 sm:bottom-8 sm:left-8\">\n        <span className=\"text-white\">Desk bell</span>\n        <span className=\"block\">{up ? \"Press the plunger for the next card\" : \"Press the plunger to ring\"}</span>\n      </p>\n    </section>\n  );\n}\n"}]}
