{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shop-door-open-closed-enamel-sign-toggle-that-spins-on-its-chain-and-rings-a-brass-bell","type":"registry:component","title":"Shop Door Open Closed Enamel Sign Toggle That Spins on Its Chain and Rings a Brass Bell","description":"Toggle built as a shop door: an enamel sign on a chain spins from Open to Closed, a brass bell swings and the shop lights go out. Free React and HTML code.","dependencies":[],"files":[{"path":"components/we-inc/shop-door-open-closed-enamel-sign-toggle-that-spins-on-its-chain-and-rings-a-brass-bell.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/** Everything written on the door. */\nconst shop = {\n  open: { word: \"Open\", line: \"Please come in\" },\n  closed: { word: \"Closed\", line: \"Back at nine tomorrow\" },\n  hours: \"Tuesday to Sunday, nine to six\",\n  photo: {\n    src: \"https://images.pexels.com/photos/37309559/pexels-photo-37309559.jpeg?auto=compress&cs=tinysrgb&w=1400\",\n    alt: \"Buckets of pink carnations and wild flowers on wooden crates inside a florist\",\n    tone: \"#b9a184\",\n  },\n};\n\nconst PAINT = \"#1c2a45\"; // the door\nconst RED = \"#c8321f\"; // sign enamel\nconst CREAM = \"#f6efdc\";\nconst SCENE_W = 640;\nconst SCENE_H = 680;\nconst SWING = 40; // how hard the sign is knocked when it is flipped, 0 for none\nconst BELL_SOUND = false; // reserved: the piece is silent, wire your own audio to `ring` if you want it\n\nconst BRASS = \"linear-gradient(90deg, #4f3508 0%, #b98b2f 16%, #fff0b4 30%, #e3b64f 42%, #8f6418 68%, #c99c3e 86%, #47300a 100%)\";\n\nexport default function ShopDoorSignToggle() {\n  const [open, setOpen] = useState(true);\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const hangRef = useRef<HTMLDivElement>(null);\n  const shadeRef = useRef<HTMLDivElement>(null);\n  const armRef = useRef<HTMLDivElement>(null);\n  const bellRef = useRef<HTMLDivElement>(null);\n  const clapRef = useRef<SVGGElement>(null);\n  const photoRef = useRef<HTMLDivElement>(null);\n  const glareRef = useRef<HTMLDivElement>(null);\n  const sim = useRef({ th: 0.1, thV: 0, ph: 0, phV: 0, turns: 0, be: 0.2, beV: 0, cl: 0, clV: 0, px: 0, pxTo: 0, touched: -1e9, wake: () => {}, reduce: false });\n\n  const flip = useCallback((fromUser: boolean) => {\n    const s = sim.current;\n    if (fromUser) s.touched = performance.now();\n    s.turns += 1;\n    setOpen(s.turns % 2 === 0);\n    if (s.reduce) { s.ph = s.turns * Math.PI; s.th = 0; s.be = 0; s.cl = 0; }\n    else { s.thV += (SWING / 100) * (s.turns % 2 ? 1 : -1) * 2.4; s.beV += 5.5; if (BELL_SOUND) { /* play your sound here */ } }\n    s.wake();\n  }, []);\n\n  useEffect(() => {\n    const wrap = wrapRef.current, scene = sceneRef.current;\n    if (!wrap || !scene) return;\n    const s = sim.current;\n    s.reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    if (s.reduce) { s.th = 0; s.be = 0; }\n    const measure = () => {\n      const sc = Math.min(1.08, wrap.clientWidth / (SCENE_W + 12), wrap.clientHeight / SCENE_H);\n      scene.style.transform = `translate(-50%, -50%) scale(${sc.toFixed(4)})`;\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(wrap);\n\n    const paint = () => {\n      const c = Math.cos(s.ph);\n      if (hangRef.current) hangRef.current.style.transform = `rotateZ(${s.th.toFixed(4)}rad) rotateY(${s.ph.toFixed(4)}rad)`;\n      if (shadeRef.current) shadeRef.current.style.transform = `translateX(${(-s.th * 250 + 14).toFixed(1)}px) scaleX(${Math.max(0.06, Math.abs(c)).toFixed(3)})`;\n      if (armRef.current) armRef.current.style.transform = `rotate(${(s.be * 0.16).toFixed(4)}rad)`;\n      if (bellRef.current) bellRef.current.style.transform = `rotate(${s.be.toFixed(4)}rad)`;\n      if (clapRef.current) clapRef.current.style.transform = `rotate(${s.cl.toFixed(4)}rad)`;\n      if (photoRef.current) photoRef.current.style.transform = `translate3d(${(-s.px * 14).toFixed(2)}px, 0, 0) scale(1.08)`;\n      if (glareRef.current) glareRef.current.style.transform = `translate3d(${(s.px * 46).toFixed(2)}px, 0, 0)`;\n      // the gloss on the enamel slides as the plate turns and swings\n      hangRef.current?.style.setProperty(\"--gloss\", `${(50 + Math.sin(s.ph) * 60 + s.th * 160 + s.px * 12).toFixed(1)}%`);\n    };\n\n    let raf = 0, last = 0, seen = true, t0 = 0, nextDemo = 3600, nextBreeze = 1500;\n    const frame = (now: number) => {\n      raf = 0;\n      if (!t0) { t0 = now; last = now; }\n      const dt = Math.min(0.033, (now - last) / 1000); last = now;\n      const t = now - t0;\n      const sub = 2;\n      for (let k = 0; k < sub; k++) {\n        const h = dt / sub;\n        s.thV += (-36 * Math.sin(s.th) - 0.9 * s.thV) * h; s.th += s.thV * h;\n        // the chain is wound a half turn at a time and unwinds past the mark before it settles\n        s.phV += (46 * (s.turns * Math.PI - s.ph) - 4.6 * s.phV) * h; s.ph += s.phV * h;\n        const beA = -120 * Math.sin(s.be) - 1.5 * s.beV;\n        s.beV += beA * h; s.be += s.beV * h;\n        s.clV += (-70 * s.cl - 3.2 * s.clV - beA * 0.9) * h; s.cl += s.clV * h;\n        s.cl = Math.max(-0.5, Math.min(0.5, s.cl));\n      }\n      s.px += (s.pxTo - s.px) * Math.min(1, dt * 5);\n      if (now - s.touched > 7000) {\n        s.pxTo = 0.5 * Math.sin(t / 2600);\n        if (t > nextBreeze) { s.thV += 0.25 * (Math.sin(t) > 0 ? 1 : -1); nextBreeze = t + 2800; }\n        if (t > nextDemo) { nextDemo = t + 4200; flip(false); }\n      }\n      paint();\n      if (seen && !document.hidden) raf = requestAnimationFrame(frame);\n    };\n    s.wake = () => { if (s.reduce) paint(); else if (!raf) { last = performance.now(); raf = requestAnimationFrame(frame); } };\n    s.wake();\n\n    const onMove = (e: PointerEvent) => {\n      const b = wrap.getBoundingClientRect();\n      s.touched = Math.max(s.touched, performance.now() - 3000);\n      const x = ((e.clientX - b.left) / b.width) * 2 - 1;\n      // brushing past the sign nudges it\n      if (!s.reduce && e.target instanceof Element && e.target.closest(\"[data-sign]\")) s.thV += Math.max(-0.5, Math.min(0.5, (x - s.pxTo) * 6));\n      s.pxTo = x;\n      if (s.reduce) { s.px = x; paint(); }\n    };\n    wrap.addEventListener(\"pointermove\", onMove);\n    const io = new IntersectionObserver(([entry]) => { seen = entry.isIntersecting; if (seen) s.wake(); });\n    io.observe(wrap);\n    const onVis = () => { if (!document.hidden) s.wake(); };\n    document.addEventListener(\"visibilitychange\", onVis);\n    return () => {\n      cancelAnimationFrame(raf); ro.disconnect(); io.disconnect();\n      wrap.removeEventListener(\"pointermove\", onMove);\n      document.removeEventListener(\"visibilitychange\", onVis);\n    };\n  }, [flip]);\n\n  const face = (side: \"open\" | \"closed\") => {\n    const dark = side === \"closed\";\n    const ink = dark ? CREAM : RED;\n    return (\n      <span\n        aria-hidden=\"true\"\n        className=\"absolute inset-0 flex flex-col items-center justify-center overflow-hidden rounded-[18px]\"\n        style={{\n          backfaceVisibility: \"hidden\",\n          WebkitBackfaceVisibility: \"hidden\",\n          transform: dark ? \"rotateY(180deg) translateZ(2px)\" : \"translateZ(2px)\",\n          background: dark ? `radial-gradient(120% 90% at 30% 18%, #e2452d 0%, ${RED} 46%, #99200f 100%)` : `radial-gradient(120% 90% at 30% 18%, #fffaf0 0%, ${CREAM} 48%, #dccfae 100%)`,\n          boxShadow: \"inset 0 0 0 1.5px rgba(20,12,6,0.95), inset 0 0 0 3px rgba(255,255,255,0.4), inset 0 0 0 6px rgba(0,0,0,0.07), inset 0 -12px 18px rgba(60,20,0,0.28), inset 0 8px 12px rgba(255,255,255,0.35), inset 10px 0 14px -6px rgba(255,255,255,0.25), inset -12px 0 16px -6px rgba(40,10,0,0.22)\",\n        }}\n      >\n        {/* painted keyline, fired under the glaze */}\n        <span className=\"absolute inset-[13px] rounded-[9px]\" style={{ border: `2.5px solid ${ink}` }} />\n        <span className=\"absolute inset-[19px] rounded-[5px]\" style={{ border: `1px solid ${ink}`, opacity: 0.7 }} />\n        <span className=\"relative font-sans font-black uppercase leading-none\" style={{ color: ink, fontSize: dark ? 59 : 76, letterSpacing: dark ? \"0.03em\" : \"0.07em\", marginTop: dark ? 20 : 12, textShadow: dark ? \"0 1.5px 0 rgba(90,14,4,0.55)\" : \"0 1.5px 0 rgba(255,255,255,0.9)\" }}>\n          {shop[side].word}\n        </span>\n        <span className=\"relative mt-2.5 font-serif text-[17px] italic leading-none\" style={{ color: ink }}>\n          {shop[side].line}\n        </span>\n        {/* chips at the edge where the steel has rusted through */}\n        <span className=\"absolute left-[3px] top-[58%] h-[13px] w-[7px] rounded-r-full\" style={{ background: \"radial-gradient(circle at 0 50%, #2a1408 0 45%, #6e3a1a 46% 75%, rgba(0,0,0,0) 78%)\" }} />\n        <span className=\"absolute bottom-[2px] right-[22%] h-[6px] w-[16px] rounded-t-full\" style={{ background: \"radial-gradient(60% 100% at 50% 100%, #2a1408 0 50%, #6e3a1a 51% 80%, rgba(0,0,0,0) 84%)\" }} />\n        {/* eyelets */}\n        {[22, 278].map((x) => (\n          <span key={x} className=\"absolute top-[12px] h-[15px] w-[15px] -translate-x-1/2 rounded-full\" style={{ left: x, background: \"radial-gradient(circle, #0a0c12 0 34%, #6b4a10 36%, #ffe9a6 52%, #b98b2f 66%, #4f3508 80%)\", boxShadow: \"0 1px 1px rgba(0,0,0,0.5)\" }} />\n        ))}\n        {/* the glaze: a soft sky reflection up top and one hard window streak that slides */}\n        <span className=\"absolute inset-0\" style={{ background: \"linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.16) 9%, rgba(255,255,255,0) 26%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.2) 100%)\" }} />\n        <span className=\"absolute inset-y-0 w-[230%]\" style={{ left: \"-65%\", background: \"linear-gradient(104deg, rgba(255,255,255,0) 45.5%, rgba(255,255,255,0.34) 46.5%, rgba(255,255,255,0.3) 48.6%, rgba(255,255,255,0) 49.2%, rgba(255,255,255,0) 50.4%, rgba(255,255,255,0.2) 50.8%, rgba(255,255,255,0.18) 51.5%, rgba(255,255,255,0) 52%)\", transform: \"translateX(calc((var(--gloss, 50%) - 50%) * 0.5))\" }} />\n      </span>\n    );\n  };\n\n  const ballChain = \"radial-gradient(circle at 36% 32%, #fff6cc 0 14%, #dcb04c 34%, #8a6216 62%, #3d2905 78%, rgba(0,0,0,0) 80%)\";\n\n  return (\n    <section ref={wrapRef} className=\"relative h-[640px] w-full overflow-hidden sm:h-[720px]\" style={{ backgroundColor: PAINT }}>\n      {/* brushed gloss paint: long vertical strokes and a fall of light from the street */}\n      <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ background: \"radial-gradient(90% 80% at 30% 0%, rgba(120,150,210,0.3) 0%, rgba(0,0,0,0) 60%), repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, rgba(0,0,0,0) 1px 5px, rgba(0,0,0,0.03) 5px 6px, rgba(0,0,0,0) 6px 13px), linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.4) 100%)\" }} />\n      <div ref={sceneRef} className=\"absolute left-1/2 top-1/2 select-none\" style={{ width: SCENE_W, height: SCENE_H, transform: \"translate(-50%, -50%)\" }}>\n        {/* the door leaf: its edge against the frame, and a raised field around the glass */}\n        <div aria-hidden=\"true\" className=\"absolute -inset-y-[400px] left-0 right-0\" style={{ boxShadow: \"-1px 0 0 rgba(0,0,0,0.75), -3px 0 0 rgba(255,255,255,0.07), 1px 0 0 rgba(0,0,0,0.75), 3px 0 0 rgba(255,255,255,0.07), inset 14px 0 18px -14px rgba(0,0,0,0.5), inset -14px 0 18px -14px rgba(0,0,0,0.5)\" }} />\n\n        {/* glazing bead */}\n        <div aria-hidden=\"true\" className=\"absolute rounded-[5px]\" style={{ left: 54, top: 64, width: 532, height: 552, background: \"linear-gradient(135deg, #34476e 0%, #1c2a45 40%, #111a2e 100%)\", boxShadow: \"0 0 0 1px rgba(0,0,0,0.7), 0 1px 0 2px rgba(255,255,255,0.06), 0 18px 30px -8px rgba(0,0,0,0.5), inset 0 2px 1px rgba(255,255,255,0.2), inset 0 -2px 1px rgba(0,0,0,0.5)\" }} />\n        <div aria-hidden=\"true\" className=\"absolute rounded-[3px]\" style={{ left: 64, top: 74, width: 512, height: 532, background: \"linear-gradient(135deg, #0d1424 0%, #1a2742 60%, #2c3d62 100%)\", boxShadow: \"inset 0 0 0 1px rgba(0,0,0,0.6)\" }} />\n\n        {/* the pane */}\n        <div className=\"absolute overflow-hidden rounded-[2px]\" style={{ left: 72, top: 82, width: 496, height: 516, backgroundColor: shop.photo.tone, boxShadow: \"0 0 0 1px rgba(0,0,0,0.85)\" }}>\n          <div ref={photoRef} className=\"absolute inset-0\" style={{ transform: \"scale(1.08)\" }}>\n            <img src={shop.photo.src} alt={shop.photo.alt} draggable={false} className=\"h-full w-full object-cover transition-[filter] duration-700 ease-out motion-reduce:transition-none\" style={{ objectPosition: \"42% 60%\", filter: open ? \"blur(1.8px) brightness(0.8) contrast(1.1) saturate(1.3)\" : \"blur(1.6px) brightness(0.3) contrast(1.05) saturate(0.55) hue-rotate(-12deg)\" }} />\n          </div>\n          {/* lamp light inside when open, street dusk when closed */}\n          <div aria-hidden=\"true\" className=\"absolute inset-0 transition-opacity duration-700 motion-reduce:transition-none\" style={{ opacity: open ? 1 : 0, background: \"radial-gradient(70% 55% at 50% 0%, rgba(255,206,140,0.2) 0%, rgba(255,200,120,0) 70%), linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(40,20,0,0.35) 100%)\" }} />\n          <div aria-hidden=\"true\" className=\"absolute inset-0 transition-opacity duration-700 motion-reduce:transition-none\" style={{ opacity: open ? 0 : 1, background: \"linear-gradient(180deg, rgba(20,34,70,0.55) 0%, rgba(6,10,22,0.7) 100%)\" }} />\n          {/* shadow the frame throws onto whatever is behind the glass */}\n          <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ boxShadow: \"inset 0 22px 30px -12px rgba(0,0,0,0.6), inset 14px 0 22px -12px rgba(0,0,0,0.45), inset -8px 0 18px -12px rgba(0,0,0,0.3)\" }} />\n\n          {/* the bell on its sprung arm, screwed to the top of the frame */}\n          <div aria-hidden=\"true\" className=\"absolute\" style={{ left: 402, top: 0, transform: \"scale(1.32)\", transformOrigin: \"60px 0\" }}>\n            <div ref={armRef} style={{ transformOrigin: \"60px 0px\", width: 0, height: 0 }}>\n              <svg width=\"96\" height=\"72\" viewBox=\"0 0 96 72\" className=\"absolute left-[-18px] top-0 overflow-visible\">\n                <defs>\n                  <linearGradient id=\"door-bell-steel\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n                    <stop offset=\"0\" stopColor=\"#f1f4f8\" /><stop offset=\"0.35\" stopColor=\"#8d96a3\" /><stop offset=\"0.7\" stopColor=\"#3a414d\" /><stop offset=\"1\" stopColor=\"#141820\" />\n                  </linearGradient>\n                </defs>\n                <path d=\"M78 4 C 80 34, 58 46, 36 38 C 20 32, 14 44, 18 58\" fill=\"none\" stroke=\"rgba(0,0,0,0.45)\" strokeWidth=\"6\" strokeLinecap=\"round\" transform=\"translate(3 5)\" style={{ filter: \"blur(3px)\" }} />\n                <path d=\"M78 4 C 80 34, 58 46, 36 38 C 20 32, 14 44, 18 58\" fill=\"none\" stroke=\"url(#door-bell-steel)\" strokeWidth=\"5.5\" strokeLinecap=\"round\" />\n                <path d=\"M78 4 C 80 34, 58 46, 36 38 C 20 32, 14 44, 18 58\" fill=\"none\" stroke=\"rgba(255,255,255,0.6)\" strokeWidth=\"0.8\" strokeLinecap=\"round\" transform=\"translate(-1 -1)\" />\n                <rect x=\"66\" y=\"0\" width=\"24\" height=\"12\" rx=\"2\" fill=\"#2a303a\" stroke=\"#0b0d12\" />\n                <circle cx=\"72\" cy=\"6\" r=\"2.2\" fill=\"#aab2be\" /><circle cx=\"84\" cy=\"6\" r=\"2.2\" fill=\"#aab2be\" />\n              </svg>\n              <div ref={bellRef} className=\"absolute\" style={{ left: 0, top: 56, width: 0, height: 0, transformOrigin: \"0 0\" }}>\n                <svg width=\"92\" height=\"104\" viewBox=\"-46 -8 92 104\" className=\"absolute left-[-46px] top-[-8px] overflow-visible\">\n                  <defs>\n                    <linearGradient id=\"door-bell-brass\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n                      <stop offset=\"0\" stopColor=\"#3f2a06\" /><stop offset=\"0.14\" stopColor=\"#a97d26\" /><stop offset=\"0.27\" stopColor=\"#fff4c2\" /><stop offset=\"0.36\" stopColor=\"#edc35a\" /><stop offset=\"0.62\" stopColor=\"#8a6016\" /><stop offset=\"0.82\" stopColor=\"#d1a546\" /><stop offset=\"0.93\" stopColor=\"#7a5412\" /><stop offset=\"1\" stopColor=\"#332104\" />\n                    </linearGradient>\n                    <linearGradient id=\"door-bell-shade\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n                      <stop offset=\"0\" stopColor=\"rgba(255,250,220,0.35)\" /><stop offset=\"0.45\" stopColor=\"rgba(0,0,0,0)\" /><stop offset=\"1\" stopColor=\"rgba(40,18,0,0.5)\" />\n                    </linearGradient>\n                  </defs>\n                  <path d=\"M0 6 C 13 6, 18 16, 19 28 C 21 50, 25 62, 40 74 L -40 74 C -25 62, -21 50, -19 28 C -18 16, -13 6, 0 6 Z\" fill=\"rgba(0,0,0,0.5)\" transform=\"translate(8 9)\" style={{ filter: \"blur(6px)\" }} />\n                  <circle cx=\"0\" cy=\"2\" r=\"6\" fill=\"none\" stroke=\"url(#door-bell-brass)\" strokeWidth=\"3.2\" />\n                  <g ref={clapRef} style={{ transformOrigin: \"0px 20px\", transformBox: \"view-box\" }}>\n                    <rect x=\"-1.4\" y=\"40\" width=\"2.8\" height=\"42\" fill=\"#5a3f10\" />\n                    <circle cx=\"0\" cy=\"85\" r=\"6.5\" fill=\"url(#door-bell-brass)\" stroke=\"#2c1c03\" strokeWidth=\"0.8\" />\n                    <circle cx=\"-2\" cy=\"83\" r=\"1.8\" fill=\"rgba(255,250,220,0.8)\" />\n                  </g>\n                  <ellipse cx=\"0\" cy=\"74\" rx=\"40\" ry=\"7\" fill=\"#1f1403\" />\n                  <path d=\"M0 6 C 13 6, 18 16, 19 28 C 21 50, 25 62, 40 74 C 20 79, -20 79, -40 74 C -25 62, -21 50, -19 28 C -18 16, -13 6, 0 6 Z\" fill=\"url(#door-bell-brass)\" />\n                  <path d=\"M0 6 C 13 6, 18 16, 19 28 C 21 50, 25 62, 40 74 C 20 79, -20 79, -40 74 C -25 62, -21 50, -19 28 C -18 16, -13 6, 0 6 Z\" fill=\"url(#door-bell-shade)\" />\n                  <path d=\"M-21.5 44 C -8 47.5, 8 47.5, 21.5 44\" fill=\"none\" stroke=\"rgba(52,30,0,0.7)\" strokeWidth=\"1.1\" /><path d=\"M-21.8 45.6 C -8 49, 8 49, 21.8 45.6\" fill=\"none\" stroke=\"rgba(255,246,200,0.6)\" strokeWidth=\"0.8\" />\n                  <path d=\"M-23.5 51 C -9 54.8, 9 54.8, 23.5 51\" fill=\"none\" stroke=\"rgba(52,30,0,0.7)\" strokeWidth=\"1.1\" /><path d=\"M-23.9 52.6 C -9 56.4, 9 56.4, 23.9 52.6\" fill=\"none\" stroke=\"rgba(255,246,200,0.6)\" strokeWidth=\"0.8\" />\n                  <path d=\"M-39 74 C -20 78.6, 20 78.6, 39 74\" fill=\"none\" stroke=\"rgba(255,248,214,0.85)\" strokeWidth=\"1.2\" />\n                  <ellipse cx=\"-9\" cy=\"24\" rx=\"3.2\" ry=\"12\" fill=\"rgba(255,255,255,0.55)\" transform=\"rotate(8 -9 24)\" style={{ filter: \"blur(1.5px)\" }} />\n                </svg>\n              </div>\n            </div>\n          </div>\n\n          {/* the sign's soft shadow on the room behind it */}\n          <div ref={shadeRef} aria-hidden=\"true\" className=\"absolute rounded-[30px] bg-black\" style={{ left: 98, top: 238, width: 300, height: 178, opacity: 0.4, filter: \"blur(22px)\" }} />\n\n          {/* hook, chain and plate: everything that turns */}\n          <div className=\"absolute\" style={{ left: 248, top: 96, width: 0, height: 0, perspective: \"1100px\" }}>\n            {/* suction cup on the glass */}\n            <span aria-hidden=\"true\" className=\"absolute left-[-26px] top-[-26px] h-[52px] w-[52px] rounded-full\" style={{ background: \"radial-gradient(circle at 38% 30%, rgba(255,255,255,0.55) 0 8%, rgba(255,255,255,0.12) 22%, rgba(255,255,255,0.04) 55%, rgba(255,255,255,0.3) 66%, rgba(255,255,255,0.05) 71%)\", boxShadow: \"0 0 0 1px rgba(255,255,255,0.28), 0 6px 10px rgba(0,0,0,0.3), inset 0 -4px 8px rgba(0,0,0,0.25)\" }} />\n            <span aria-hidden=\"true\" className=\"absolute left-[-8px] top-[-8px] h-[16px] w-[16px] rounded-full\" style={{ background: \"radial-gradient(circle at 35% 30%, #fff3c0, #d1a444 40%, #6d4b10 82%)\", boxShadow: \"0 3px 4px rgba(0,0,0,0.5)\" }} />\n            <div ref={hangRef} className=\"absolute left-0 top-0\" style={{ width: 0, height: 0, transformStyle: \"preserve-3d\", transformOrigin: \"0 0\" }}>\n              {[-1, 1].map((d) => (\n                <span key={d} aria-hidden=\"true\" className=\"absolute left-[-3.5px] top-0 w-[7px]\" style={{ height: 187, transformOrigin: \"50% 0\", transform: `rotate(${-d * 43.2}deg)`, backgroundImage: ballChain, backgroundSize: \"7px 7px\", filter: \"drop-shadow(0 2px 1px rgba(0,0,0,0.35))\" }} />\n              ))}\n              <button\n                type=\"button\"\n                role=\"switch\"\n                data-sign=\"\"\n                aria-checked={open}\n                aria-label=\"Shop open\"\n                onClick={() => flip(true)}\n                className=\"absolute block cursor-pointer rounded-[18px] outline-none focus-visible:ring-4 focus-visible:ring-amber-300 focus-visible:ring-offset-4 focus-visible:ring-offset-transparent\"\n                style={{ left: -150, top: 118, width: 300, height: 184, transformStyle: \"preserve-3d\" }}\n              >\n                {/* the steel the enamel is fired onto: three layers give the plate an edge when it is side on */}\n                {[-1.2, 0, 1.2].map((z) => (\n                  <span key={z} aria-hidden=\"true\" className=\"absolute inset-0 rounded-[18px]\" style={{ transform: `translateZ(${z}px)`, background: \"linear-gradient(180deg, #7b808a, #23262e)\" }} />\n                ))}\n                {face(\"open\")}\n                {face(\"closed\")}\n              </button>\n            </div>\n          </div>\n\n          {/* gilded hours on the inside of the glass */}\n          <p className=\"absolute inset-x-0 bottom-[30px] text-center font-serif text-[15px] font-bold uppercase leading-none tracking-[0.3em]\" style={{ backgroundImage: \"linear-gradient(180deg, #fff2bc 0%, #e2b44c 45%, #9b6d18 55%, #f0cf7a 100%)\", WebkitBackgroundClip: \"text\", backgroundClip: \"text\", color: \"transparent\", filter: \"drop-shadow(0 1px 0 rgba(30,14,0,0.9)) drop-shadow(0 0 1px rgba(30,14,0,0.9))\" }}>\n            {shop.hours}\n          </p>\n\n          {/* the glass itself: the street reflected in it, brighter when the shop is dark */}\n          <div ref={glareRef} aria-hidden=\"true\" className=\"pointer-events-none absolute -inset-x-[80px] inset-y-0 transition-opacity duration-700 motion-reduce:transition-none\" style={{ opacity: open ? 0.75 : 1, background: \"linear-gradient(112deg, rgba(255,255,255,0) 6%, rgba(214,230,255,0.3) 9%, rgba(214,230,255,0.1) 19%, rgba(255,255,255,0) 19.4%, rgba(255,255,255,0) 22%, rgba(214,230,255,0.22) 22.4%, rgba(214,230,255,0.06) 26%, rgba(255,255,255,0) 26.3%, rgba(255,255,255,0) 68%, rgba(214,230,255,0.12) 72%, rgba(214,230,255,0.16) 78%, rgba(255,255,255,0) 78.4%)\" }} />\n          <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ boxShadow: \"inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 1px 0 1px rgba(255,255,255,0.12)\" }} />\n        </div>\n\n        {/* brass pull on the stile */}\n        <div aria-hidden=\"true\" className=\"absolute\" style={{ left: 600, top: 270, width: 16, height: 190 }}>\n          <span className=\"absolute left-[6px] top-[10px] h-full w-full rounded-full bg-black\" style={{ opacity: 0.45, filter: \"blur(6px)\" }} />\n          {[14, 162].map((y) => (\n            <span key={y} className=\"absolute left-[-3px] h-[22px] w-[22px] rounded-full\" style={{ top: y - 4, background: \"radial-gradient(circle at 35% 30%, #ffefb2, #c59735 45%, #5a3d0b 90%)\", boxShadow: \"0 2px 3px rgba(0,0,0,0.6)\" }} />\n          ))}\n          <span className=\"absolute inset-0 rounded-full\" style={{ background: BRASS, boxShadow: \"inset 0 3px 3px rgba(255,250,220,0.5), inset 0 -6px 8px rgba(40,20,0,0.5), 0 0 0 0.5px rgba(30,14,0,0.8)\" }} />\n        </div>\n      </div>\n\n      <p className=\"absolute bottom-5 left-5 font-mono text-[11px] uppercase leading-relaxed tracking-[0.18em] text-slate-300 sm:bottom-8 sm:left-8\">\n        <span className=\"text-white\" aria-live=\"polite\">{open ? \"The shop is open\" : \"The shop is closed\"}</span>\n        <span className=\"block\">Press the sign to turn it over</span>\n      </p>\n    </section>\n  );\n}\n"}]}
