{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"beehive-frame-progress-meter-whose-wax-cells-fill-with-honey-and-cap-over-as-the-job-finishes","type":"registry:component","title":"Beehive Frame Progress Meter Whose Wax Cells Fill with Honey and Cap Over as the Job Finishes","description":"Progress meter on a canvas: wax cells in a hive frame fill with honey, then seal under pale caps as the job ends. Free React code and HTML to copy.","dependencies":[],"files":[{"path":"components/we-inc/beehive-frame-progress-meter-whose-wax-cells-fill-with-honey-and-cap-over-as-the-job-finishes.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\n\n// What the meter says. The first is read while it runs, the second when it finishes.\nconst LABEL = \"Backing up your photos\";\nconst DONE_LABEL = \"Backup sealed\";\nconst DEMO_SECONDS = 11; // length of one self-running fill\nconst DEMO_START = 0.36; // the first run opens part way through so the comb is never bare\nconst STAGE = \"#10231d\";\nconst W = 380, H = 330; // drawing size in its own units; the canvas scales to its box\nconst R = 10.4; // radius of one cell\nconst OPEN = 0.07; // share of cells the bees leave uncapped at the end\n\nconst clamp = (v: number, a = 0, b = 1) => Math.max(a, Math.min(b, v));\n\nexport default function BeehiveFrameHoneyProgress() {\n  const canvas = useRef<HTMLCanvasElement>(null);\n  // Write your own 0 to 1 value into this ref and delete the demo clock in the frame loop.\n  const progress = useRef(DEMO_START);\n  const restart = useRef<(() => void) | null>(null);\n  const [view, setView] = useState({ pct: Math.round(DEMO_START * 100), filled: 0, total: 0 });\n\n  useEffect(() => {\n    const cv = canvas.current;\n    if (!cv) return;\n    const ctx = cv.getContext(\"2d\");\n    if (!ctx) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const K = Math.min(2, window.devicePixelRatio || 1) * 1.7;\n    cv.width = W * K; cv.height = H * K;\n    const TAU = Math.PI * 2, S3 = Math.sqrt(3);\n    const IN = { x0: 44, y0: 62, x1: 336, y1: 268 }; // the opening inside the wooden bars\n    let seed = 23;\n    const rand = () => { seed = (seed * 16807) % 2147483647; return seed / 2147483647; };\n    const layer = (w: number, h: number) => { const c = document.createElement(\"canvas\"); c.width = Math.ceil(w * K); c.height = Math.ceil(h * K); const x = c.getContext(\"2d\") as CanvasRenderingContext2D; x.scale(K, K); return { c, x }; };\n    const hex = (x: CanvasRenderingContext2D, cx: number, cy: number, r: number, wobble = 0) => {\n      x.beginPath();\n      for (let i = 0; i < 6; i++) { const a = -Math.PI / 2 + (i * TAU) / 6, rr = r + (wobble ? (rand() - 0.5) * wobble : 0); if (i) x.lineTo(cx + Math.cos(a) * rr, cy + Math.sin(a) * rr); else x.moveTo(cx + Math.cos(a) * rr, cy + Math.sin(a) * rr); }\n      x.closePath();\n    };\n\n    // Three little pictures stamped once per cell: the empty wax cup, the honey and the wax cap.\n    const SP = R * 2 + 6, M = SP / 2;\n    const empty = layer(SP, SP);\n    {\n      const x = empty.x;\n      const wall = x.createLinearGradient(M - R, M - R, M + R, M + R);\n      wall.addColorStop(0, \"#f6cf74\"); wall.addColorStop(0.45, \"#d79a33\"); wall.addColorStop(1, \"#8f5713\");\n      hex(x, M, M, R + 0.9); x.fillStyle = wall; x.fill();\n      const cup = x.createLinearGradient(M - R, M - R, M + R * 0.9, M + R * 0.9);\n      cup.addColorStop(0, \"#1a0c02\"); cup.addColorStop(0.42, \"#3a1f07\"); cup.addColorStop(0.8, \"#8a5213\"); cup.addColorStop(1, \"#c98a2b\");\n      hex(x, M, M, R - 1.5); x.fillStyle = cup; x.fill();\n      const deep = x.createRadialGradient(M - 1.2, M - 1.2, 0.5, M - 0.6, M - 0.6, R * 0.78);\n      deep.addColorStop(0, \"rgba(10,5,1,0.96)\"); deep.addColorStop(0.6, \"rgba(18,9,2,0.82)\"); deep.addColorStop(1, \"rgba(18,9,2,0)\");\n      hex(x, M, M, R - 1.5); x.fillStyle = deep; x.fill();\n      x.lineWidth = 0.5; x.strokeStyle = \"rgba(255,236,170,0.75)\"; hex(x, M - 0.25, M - 0.25, R - 0.2); x.stroke();\n    }\n    const honeys = Array.from({ length: 4 }, (_, v) => {\n      const honey = layer(SP, SP), x = honey.x;\n      const body = x.createRadialGradient(M + 2.6 - v * 0.5, M + 3 - (v % 2), 0.6, M, M, R);\n      body.addColorStop(0, \"#ffd65c\"); body.addColorStop(0.34, \"#f7a71b\"); body.addColorStop(0.72, \"#c96a08\"); body.addColorStop(1, \"#6d3004\");\n      hex(x, M, M, R - 1.3); x.fillStyle = body; x.fill();\n      x.save(); hex(x, M, M, R - 1.3); x.clip();\n      const shade = x.createLinearGradient(M - R, M - R, M + R * 0.2, M + R * 0.2);\n      shade.addColorStop(0, \"rgba(70,26,2,0.7)\"); shade.addColorStop(1, \"rgba(70,26,2,0)\");\n      x.fillStyle = shade; x.fillRect(0, 0, SP, SP);\n      x.translate(M - 2.9 + (v % 2) * 0.7, M - 3.4 - (v >> 1) * 0.6); x.rotate(-0.62 - v * 0.09);\n      x.beginPath(); x.ellipse(0, 0, 3.5 - v * 0.35, 1.25 - (v % 2) * 0.25, 0, 0, TAU); x.fillStyle = \"rgba(255,255,255,0.95)\"; x.fill();\n      x.beginPath(); x.ellipse(5.2, 0.9, 0.9, 0.6, 0, 0, TAU); x.fillStyle = \"rgba(255,255,255,0.8)\"; x.fill();\n      x.restore();\n      x.lineWidth = 0.9; x.strokeStyle = \"rgba(255,226,140,0.5)\"; x.beginPath(); x.arc(M, M, R - 3.4, 0.35 + v * 0.1, 1.3); x.stroke();\n      return honey.c;\n    });\n    const caps = Array.from({ length: 4 }, () => {\n      const l = layer(SP, SP), x = l.x;\n      const dome = x.createRadialGradient(M - 2.4, M - 2.8, 0.4, M, M, R + 1);\n      dome.addColorStop(0, \"#fff4cf\"); dome.addColorStop(0.42, \"#f1d488\"); dome.addColorStop(0.82, \"#d2a04a\"); dome.addColorStop(1, \"#9c6a1f\");\n      hex(x, M, M, R + 0.2, 1.5); x.fillStyle = dome; x.fill();\n      x.save(); x.clip();\n      for (let i = 0; i < 9; i++) { const a = rand() * TAU, d = rand() * R * 0.8, rr = 0.5 + rand() * 1.5; x.beginPath(); x.arc(M + Math.cos(a) * d, M + Math.sin(a) * d, rr, 0, TAU); x.fillStyle = rand() > 0.5 ? \"rgba(255,250,224,0.5)\" : \"rgba(150,98,26,0.24)\"; x.fill(); }\n      x.restore();\n      return l.c;\n    });\n\n    // Lay the cells out, then number them so honey spreads down from the top bar in an arc, as it does in a hive.\n    const cells: { x: number; y: number; k: number; kv: number; c: number; cap: HTMLCanvasElement; honey: HTMLCanvasElement; open: boolean; order: number }[] = [];\n    for (let row = -1, y = IN.y0 + 2; y < IN.y1 + R; row++, y = IN.y0 + 2 + (row + 1) * 1.5 * R) {\n      for (let x = IN.x0 + ((row & 1) ? S3 * R / 2 : 0); x < IN.x1 + R; x += S3 * R) {\n        cells.push({ x, y, k: 0, kv: 0, c: 0, cap: caps[(rand() * 4) | 0], honey: honeys[(rand() * 4) | 0], open: rand() < OPEN, order: Math.hypot((x - 190) * 0.62, y - IN.y0 + 70) + rand() * 34 });\n      }\n    }\n    const visible = cells.filter((c) => c.x > IN.x0 - 2 && c.x < IN.x1 + 2 && c.y > IN.y0 - 2 && c.y < IN.y1 + 2);\n    [...cells].sort((a, b) => a.order - b.order).forEach((c, i) => { c.order = i; });\n    const N = cells.length;\n\n    // The wooden frame, drawn once: top bar with lugs, two side bars, a thin bottom bar and the pegs it hangs on.\n    const frameArt = layer(W, H);\n    {\n      const x = frameArt.x;\n      const bar = (bx: number, by: number, bw: number, bh: number, along: boolean) => {\n        const g = along ? x.createLinearGradient(0, by, 0, by + bh) : x.createLinearGradient(bx, 0, bx + bw, 0);\n        g.addColorStop(0, \"#f0d3a0\"); g.addColorStop(0.16, \"#dfba80\"); g.addColorStop(0.7, \"#c79a5e\"); g.addColorStop(1, \"#946a38\");\n        x.save(); x.beginPath(); x.roundRect(bx, by, bw, bh, 1.4); x.fillStyle = g; x.fill(); x.clip();\n        for (let i = 0; i < (along ? bh : bw) * 1.6; i++) {\n          const o = rand() * (along ? bh : bw), wave = (rand() - 0.5) * 1.6, len = along ? bw : bh;\n          x.beginPath();\n          if (along) { x.moveTo(bx, by + o); x.bezierCurveTo(bx + len * 0.3, by + o + wave, bx + len * 0.7, by + o - wave, bx + len, by + o + wave * 0.4); }\n          else { x.moveTo(bx + o, by); x.bezierCurveTo(bx + o + wave, by + len * 0.3, bx + o - wave, by + len * 0.7, bx + o + wave * 0.4, by + len); }\n          x.lineWidth = 0.25 + rand() * 0.5; x.strokeStyle = rand() > 0.4 ? `rgba(120,78,34,${0.1 + rand() * 0.2})` : `rgba(255,240,206,${0.1 + rand() * 0.2})`; x.stroke();\n        }\n        x.restore();\n        x.fillStyle = \"rgba(255,246,222,0.7)\"; if (along) x.fillRect(bx + 1, by + 0.3, bw - 2, 0.7); else x.fillRect(bx + 0.3, by + 1, 0.7, bh - 2);\n        x.fillStyle = \"rgba(70,42,14,0.5)\"; if (along) x.fillRect(bx + 1, by + bh - 0.8, bw - 2, 0.8); else x.fillRect(bx + bw - 0.8, by + 1, 0.8, bh - 2);\n      };\n      const peg = (px: number, py: number) => {\n        const g = x.createRadialGradient(px - 1.6, py - 1.8, 0.4, px, py, 5.4);\n        g.addColorStop(0, \"#fff3c4\"); g.addColorStop(0.4, \"#d8ad52\"); g.addColorStop(0.85, \"#7c5516\"); g.addColorStop(1, \"#4a310a\");\n        x.beginPath(); x.arc(px, py, 5.2, 0, TAU); x.fillStyle = g; x.fill();\n        x.lineWidth = 0.6; x.strokeStyle = \"rgba(255,240,190,0.6)\"; x.beginPath(); x.arc(px, py, 3.1, 0, TAU); x.stroke();\n      };\n      peg(21, 65); peg(359, 65);\n      bar(32, 58, 13, 214, false); bar(335, 58, 13, 214, false);\n      bar(32, 266, 316, 9, true);\n      bar(12, 42, 356, 19, true);\n      // End grain on the lugs, the saw kerf under them and the nail heads.\n      for (const ex of [12, 364]) { x.fillStyle = \"rgba(110,72,30,0.45)\"; x.fillRect(ex, 43, 4, 17); }\n      for (const [nx, ny] of [[38.5, 51], [341.5, 51], [38.5, 270.5], [341.5, 270.5]]) {\n        x.beginPath(); x.arc(nx + 0.4, ny + 0.5, 1.9, 0, TAU); x.fillStyle = \"rgba(60,36,10,0.55)\"; x.fill();\n        const g = x.createRadialGradient(nx - 0.5, ny - 0.6, 0.1, nx, ny, 1.7);\n        g.addColorStop(0, \"#f4f6f8\"); g.addColorStop(0.6, \"#8d949c\"); g.addColorStop(1, \"#3c4046\");\n        x.beginPath(); x.arc(nx, ny, 1.6, 0, TAU); x.fillStyle = g; x.fill();\n      }\n      x.font = \"600 5.2px ui-monospace, SFMono-Regular, Menlo, monospace\"; x.textAlign = \"center\"; x.fillStyle = \"rgba(92,58,22,0.7)\";\n      x.fillText(\"N O.  0 7   ·   S U P E R\", 190, 54);\n    }\n\n    const s = { lx: 120, ly: 110, tx: 120, ty: 110, drip: 0, fall: 0, fv: 0 };\n    const draw = (p: number) => {\n      ctx.setTransform(K, 0, 0, K, 0, 0);\n      ctx.clearRect(0, 0, W, H);\n\n      // Shadow of the frame on the wall behind it.\n      ctx.save(); ctx.shadowColor = \"rgba(0,0,0,0.62)\"; ctx.shadowBlur = 22 * K; ctx.shadowOffsetX = 7 * K; ctx.shadowOffsetY = 14 * K;\n      ctx.fillStyle = \"#000\"; ctx.fillRect(34, 46, 312, 226); ctx.restore();\n\n      ctx.save(); ctx.beginPath(); ctx.rect(IN.x0, IN.y0 - 2, IN.x1 - IN.x0, IN.y1 - IN.y0 + 2); ctx.clip();\n      ctx.fillStyle = \"#8f5713\"; ctx.fillRect(IN.x0, IN.y0 - 2, IN.x1 - IN.x0, IN.y1 - IN.y0 + 2);\n      for (const c of cells) {\n        ctx.drawImage(empty.c, c.x - M, c.y - M, SP, SP);\n        if (c.k > 0.01 && c.c < 0.995) {\n          const z = (0.5 + 0.5 * Math.min(1, c.k)) * SP;\n          ctx.globalAlpha = clamp(c.k * 2.2); ctx.drawImage(c.honey, c.x - z / 2, c.y - z / 2, z, z);\n          // A fresh cell is brighter for a moment, like a drop still settling.\n          const fresh = clamp(1 - Math.abs(c.k - 0.75) * 3) * (1 - c.c);\n          if (fresh > 0.02) { ctx.globalAlpha = fresh * 0.5; ctx.globalCompositeOperation = \"lighter\"; ctx.drawImage(c.honey, c.x - z / 2, c.y - z / 2, z, z); ctx.globalCompositeOperation = \"source-over\"; }\n          ctx.globalAlpha = 1;\n        }\n        if (c.c > 0.01) { const z = (0.72 + 0.28 * c.c) * SP; ctx.globalAlpha = clamp(c.c * 1.6); ctx.drawImage(c.cap, c.x - z / 2, c.y - z / 2, z, z); ctx.globalAlpha = 1; }\n      }\n      // A lamp glancing off the comb. It follows the pointer and drifts when left alone.\n      ctx.globalCompositeOperation = \"lighter\";\n      const sheen = ctx.createRadialGradient(s.lx, s.ly, 4, s.lx, s.ly, 150);\n      sheen.addColorStop(0, \"rgba(255,214,130,0.3)\"); sheen.addColorStop(0.4, \"rgba(255,190,90,0.1)\"); sheen.addColorStop(1, \"rgba(255,190,90,0)\");\n      ctx.fillStyle = sheen; ctx.fillRect(IN.x0, IN.y0, IN.x1 - IN.x0, IN.y1 - IN.y0);\n      ctx.globalCompositeOperation = \"source-over\";\n      const far = ctx.createRadialGradient(s.lx, s.ly, 120, s.lx, s.ly, 330);\n      far.addColorStop(0, \"rgba(20,8,0,0)\"); far.addColorStop(1, \"rgba(20,8,0,0.5)\");\n      ctx.fillStyle = far; ctx.fillRect(IN.x0, IN.y0, IN.x1 - IN.x0, IN.y1 - IN.y0);\n      // The bars stand proud of the comb and shade its top and left edges.\n      const top = ctx.createLinearGradient(0, IN.y0 - 2, 0, IN.y0 + 15); top.addColorStop(0, \"rgba(30,12,0,0.78)\"); top.addColorStop(1, \"rgba(30,12,0,0)\");\n      ctx.fillStyle = top; ctx.fillRect(IN.x0, IN.y0 - 2, IN.x1 - IN.x0, 18);\n      const left = ctx.createLinearGradient(IN.x0, 0, IN.x0 + 10, 0); left.addColorStop(0, \"rgba(30,12,0,0.6)\"); left.addColorStop(1, \"rgba(30,12,0,0)\");\n      ctx.fillStyle = left; ctx.fillRect(IN.x0, IN.y0, 10, IN.y1 - IN.y0);\n      ctx.restore();\n      ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.drawImage(frameArt.c, 0, 0); ctx.setTransform(K, 0, 0, K, 0, 0);\n\n      // Honey that has run down to the bottom bar: a bead that swells, then lets go.\n      if (s.drip > 0.02 || s.fall > 0) {\n        const dx = 232, dy = 274.5, len = 3 + s.drip * 13, bulb = 2.2 + s.drip * 2.3;\n        const g = ctx.createLinearGradient(dx - bulb, 0, dx + bulb, 0);\n        g.addColorStop(0, \"#8a4505\"); g.addColorStop(0.35, \"#f5a81c\"); g.addColorStop(0.6, \"#ffd465\"); g.addColorStop(1, \"#a85607\");\n        const bead = (by: number, r: number, neck: number) => {\n          ctx.beginPath(); ctx.moveTo(dx - neck, by - r * 2.6); ctx.bezierCurveTo(dx - neck, by - r, dx - r, by - r * 0.9, dx - r, by);\n          ctx.arc(dx, by, r, Math.PI, 0, true); ctx.bezierCurveTo(dx + r, by - r * 0.9, dx + neck, by - r, dx + neck, by - r * 2.6); ctx.closePath(); ctx.fillStyle = g; ctx.fill();\n          ctx.beginPath(); ctx.ellipse(dx - r * 0.34, by - r * 0.2, r * 0.2, r * 0.42, 0.3, 0, TAU); ctx.fillStyle = \"rgba(255,255,255,0.9)\"; ctx.fill();\n        };\n        ctx.beginPath(); ctx.ellipse(dx, dy - 3, 9, 1.8, 0, 0, TAU); ctx.fillStyle = \"#e39413\"; ctx.fill();\n        ctx.beginPath(); ctx.ellipse(dx - 2, dy - 3.5, 5, 0.6, 0, 0, TAU); ctx.fillStyle = \"rgba(255,240,190,0.8)\"; ctx.fill();\n        ctx.fillStyle = g; ctx.fillRect(dx - 1.1, dy - 2, 2.2, len - bulb + 2);\n        bead(dy + len, bulb, 1.1);\n        if (s.fall > 0) bead(dy + 16 + s.fall, 3.6, 0.5);\n      }\n      void p;\n    };\n\n    let raf = 0, last = 0, seen = true, clock = DEMO_START * DEMO_SECONDS, touched = -1e9, idle = 0, shownPct = -1, shownFilled = -1;\n    const HOLD = 3.4;\n    const report = (p: number, filled: number) => { const n = Math.round(p * 100); if (n !== shownPct || filled !== shownFilled) { shownPct = n; shownFilled = filled; setView({ pct: n, filled, total: visible.length }); } };\n    const targets = (p: number) => {\n      const fill = p * N, capped = N * clamp((p - 0.34) / 0.66) ** 1.7;\n      let filled = 0;\n      for (const c of visible) if (c.order < fill) filled++;\n      return { fill, capped, filled };\n    };\n    const frame = (now: number) => {\n      raf = 0;\n      if (!last) last = now;\n      const dt = Math.min(0.033, (now - last) / 1000); last = now;\n\n      // Demo clock. Delete this block when `progress.current` is fed from real work.\n      clock += dt;\n      if (clock < DEMO_SECONDS) { const t = clock / DEMO_SECONDS; progress.current = Math.min(1, t + 0.025 * Math.sin(t * Math.PI * 6) * (1 - t)); }\n      else if (clock < DEMO_SECONDS + HOLD) progress.current = 1;\n      else { clock = 0; progress.current = 0; }\n\n      const p = clamp(progress.current), t = targets(p);\n      for (const c of cells) {\n        const full = c.order < t.fill ? 1 : 0, cap = c.order < t.capped && !c.open ? 1 : 0;\n        if (full) { c.kv += (90 * (1 - c.k) - 11 * c.kv) * dt; c.k += c.kv * dt; } else { c.kv = 0; c.k = Math.max(0, c.k - dt * 4); }\n        c.c += ((cap && c.k > 0.9 ? 1 : 0) - c.c) * Math.min(1, dt * (cap ? 3.2 : 6));\n      }\n      idle += dt;\n      if (now - touched > 3500) { s.tx = 190 + 120 * Math.sin(idle / 2.9); s.ty = 150 + 60 * Math.sin(idle / 2.1 + 1); }\n      s.lx += (s.tx - s.lx) * Math.min(1, dt * 5); s.ly += (s.ty - s.ly) * Math.min(1, dt * 5);\n      // The bead grows while honey is coming in, drops once it is heavy, and stops after the comb is sealed.\n      if (s.fall > 0) { s.fv += 520 * dt; s.fall += s.fv * dt; if (s.fall > 90) { s.fall = 0; s.fv = 0; } }\n      if (p > 0.2 && p < 1) { s.drip += dt * 0.36; if (s.drip >= 1) { s.drip = 0.12; s.fall = 0.01; } } else s.drip = Math.max(0, s.drip - dt * 0.5);\n      report(p, t.filled);\n      draw(p);\n      if (seen && !document.hidden) raf = requestAnimationFrame(frame);\n    };\n    const wake = () => { if (!raf && !reduce) { last = 0; raf = requestAnimationFrame(frame); } };\n    const still = () => { progress.current = 1; for (const c of cells) { c.k = 1; c.c = c.open ? 0 : 1; } report(1, visible.length); draw(1); };\n    // Start the comb already holding what the opening percentage implies.\n    { const t = targets(DEMO_START); for (const c of cells) { c.k = c.order < t.fill - 6 ? 1 : 0; c.c = c.order < t.capped - 4 && !c.open ? 1 : 0; } }\n    restart.current = () => { clock = 0; progress.current = 0; if (reduce) still(); else wake(); };\n    if (reduce) still(); else wake();\n\n    const onMove = (e: PointerEvent) => { const b = cv.getBoundingClientRect(); touched = performance.now(); s.tx = ((e.clientX - b.left) / b.width) * W; s.ty = ((e.clientY - b.top) / b.height) * H; };\n    cv.addEventListener(\"pointermove\", onMove); cv.addEventListener(\"pointerdown\", onMove);\n    const io = new IntersectionObserver(([entry]) => { seen = entry.isIntersecting; if (seen) wake(); });\n    io.observe(cv);\n    const onVis = () => { if (!document.hidden) wake(); };\n    document.addEventListener(\"visibilitychange\", onVis);\n    return () => {\n      cancelAnimationFrame(raf); restart.current = null;\n      cv.removeEventListener(\"pointermove\", onMove); cv.removeEventListener(\"pointerdown\", onMove);\n      io.disconnect(); document.removeEventListener(\"visibilitychange\", onVis);\n    };\n  }, []);\n\n  const done = view.pct >= 100;\n  return (\n    <div\n      className=\"flex min-h-[560px] w-full flex-col items-center justify-center overflow-hidden bg-[radial-gradient(80%_70%_at_50%_40%,#1d3b31_0%,#10231d_55%,#0a1612_100%)] px-4 py-10 sm:min-h-[780px]\"\n      style={{ backgroundColor: STAGE }}\n    >\n      <div\n        role=\"progressbar\"\n        aria-label={LABEL}\n        aria-valuemin={0}\n        aria-valuemax={100}\n        aria-valuenow={view.pct}\n        aria-valuetext={done ? DONE_LABEL : `${view.pct} percent, ${view.filled} of ${view.total} cells filled`}\n        className=\"w-full max-w-[660px]\"\n      >\n        <canvas ref={canvas} aria-hidden=\"true\" className=\"block h-auto w-full\" style={{ aspectRatio: `${W} / ${H}` }} />\n      </div>\n      <div className=\"flex flex-col items-center gap-3\">\n        <p aria-hidden=\"true\" className=\"font-mono text-[34px] font-medium tabular-nums leading-none tracking-tight text-amber-100\">\n          {view.pct}\n          <span className=\"ml-1 text-[15px] text-amber-200\">%</span>\n        </p>\n        <p role=\"status\" className=\"font-mono text-[11px] uppercase tracking-[0.2em] text-amber-100\">\n          {done ? DONE_LABEL : LABEL}\n        </p>\n        <button\n          type=\"button\"\n          onClick={() => restart.current?.()}\n          className=\"flex h-10 items-center rounded-full border border-amber-200/50 px-5 font-mono text-[11px] uppercase tracking-[0.18em] text-amber-50 outline-none transition-colors hover:bg-amber-100/10 focus-visible:ring-2 focus-visible:ring-amber-200 motion-reduce:transition-none\"\n        >\n          Fill again\n        </button>\n      </div>\n    </div>\n  );\n}\n"}]}
