{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"brick-wall-footer-with-screwed-on-street-name-plates-lit-by-a-torch-that-follows-the-pointer","type":"registry:block","title":"Brick Wall Footer with Screwed-On Street Name Plates Lit by a Torch That Follows the Pointer","description":"Footer whose links are enamel street name plates on a brick wall at night, lit by a torch beam that follows the pointer. Free React and HTML code to copy.","dependencies":[],"files":[{"path":"components/we-inc/brick-wall-footer-with-screwed-on-street-name-plates-lit-by-a-torch-that-follows-the-pointer.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\n// Everything a visitor is likely to change sits here.\nconst BRAND = \"Aldous & Reeve\"; // painted across the top of the wall, long since faded\nconst quarters = [\n  { title: \"Shop\", finish: \"white\", links: [[\"Catalogue\", \"Row\"], [\"Seconds\", \"Yard\"], [\"Gift Cards\", \"Lane\"]] },\n  { title: \"Studio\", finish: \"blue\", links: [[\"About\", \"Street\"], [\"Journal\", \"Walk\"], [\"Open Days\", \"Court\"]] },\n  { title: \"Help\", finish: \"iron\", links: [[\"Contact\", \"Place\"], [\"Delivery\", \"Mews\"], [\"Returns\", \"Passage\"]] },\n] as const;\nconst small = [\"Privacy\", \"Terms\", \"Trade accounts\"];\nconst BRICKS = [\"#7c3a2b\", \"#8b4633\", \"#6d3024\", \"#96503a\", \"#5c2a22\", \"#a25a40\", \"#743427\"]; // the mix of fired clay in the wall\nconst TORCH = { warm: \"255,206,142\", night: 0.48, reach: 430 }; // light colour, how dark the unlit wall gets (0 to 0.6), and the pool's radius in pixels\nconst DRIFT = true; // let the light wander by itself until a pointer or the keyboard takes it\n\nconst GRAIN = `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")`;\nconst finishes = {\n  white: { face: \"#f4f1e8\", ink: \"#141518\", line: \"#141518\", sub: \"#b3261c\", gloss: 0.62, font: '\"Arial Narrow\", \"Helvetica Neue\", Helvetica, Arial, sans-serif', raised: false },\n  blue: { face: \"#143278\", ink: \"#f8f5ec\", line: \"#f8f5ec\", sub: \"#c9d6f2\", gloss: 0.5, font: '\"Arial Narrow\", \"Helvetica Neue\", Helvetica, Arial, sans-serif', raised: false },\n  iron: { face: \"#1c1d20\", ink: \"#f1ead9\", line: \"#f1ead9\", sub: \"#d8cfba\", gloss: 0.16, font: 'Georgia, \"Times New Roman\", serif', raised: true },\n};\nconst TILT = [-0.5, 0.35, -0.2, 0.3, -0.4, 0.15, 0.45, -0.3, 0.2];\n\n// Lays the wall once: mortar bed, bricks in stretcher bond, the faded painted name, and two sets of\n// edge lines (lit from the left, lit from the right) that the moving light fades between.\nfunction layWall(base: HTMLCanvasElement, fromLeft: HTMLCanvasElement, fromRight: HTMLCanvasElement, W: number, H: number, k: number) {\n  for (const c of [base, fromLeft, fromRight]) { c.width = Math.ceil(W * k); c.height = Math.ceil(H * k); }\n  const c = base.getContext(\"2d\"), l = fromLeft.getContext(\"2d\"), r = fromRight.getContext(\"2d\");\n  if (!c || !l || !r) return;\n  for (const x of [c, l, r]) x.setTransform(k, 0, 0, k, 0, 0);\n  let seed = 11;\n  const rand = () => { seed = (seed * 16807) % 2147483647; return seed / 2147483647; };\n  const rr = (x: number, y: number, w: number, h: number, q: number) => { c.beginPath(); c.moveTo(x + q, y); c.arcTo(x + w, y, x + w, y + h, q); c.arcTo(x + w, y + h, x, y + h, q); c.arcTo(x, y + h, x, y, q); c.arcTo(x, y, x + w, y, q); c.closePath(); };\n  c.fillStyle = \"#81776a\"; c.fillRect(0, 0, W, H);\n  for (let i = 0; i < (W * H) / 26; i++) { c.fillStyle = rand() > 0.5 ? \"rgba(255,245,225,0.09)\" : \"rgba(0,0,0,0.13)\"; c.fillRect(rand() * W, rand() * H, 1 + rand(), 1 + rand()); }\n  const BW = W < 700 ? 70 : 88, BH = W < 700 ? 21 : 26, M = W < 700 ? 3.2 : 4;\n  for (let y = -BH * 0.4, row = 0; y < H; y += BH + M, row++) {\n    for (let x = row % 2 ? -(BW + M) / 2 : -rand() * 3; x < W; x += BW + M) {\n      const w = BW + (rand() - 0.5) * 1.6, h = BH + (rand() - 0.5) * 1.2, yy = y + (rand() - 0.5) * 0.9;\n      const tone = rand() < 0.07 ? \"#3b2723\" : BRICKS[Math.floor(rand() * BRICKS.length)];\n      c.fillStyle = \"rgba(0,0,0,0.42)\"; rr(x + 0.4, yy + 1.8, w, h, 2); c.fill(); // the brick's own shadow on the raked joint below\n      c.fillStyle = tone; rr(x, yy, w, h, 2.2); c.fill();\n      c.save(); c.clip();\n      const face = c.createLinearGradient(0, yy, 0, yy + h);\n      face.addColorStop(0, \"rgba(255,226,196,0.2)\"); face.addColorStop(0.35, \"rgba(255,226,196,0)\"); face.addColorStop(1, \"rgba(0,0,0,0.24)\");\n      c.fillStyle = face; c.fillRect(x, yy, w, h);\n      for (let i = 0; i < 4; i++) { c.fillStyle = `rgba(${rand() > 0.5 ? \"255,196,150\" : \"24,8,6\"},${0.02 + rand() * 0.05})`; c.beginPath(); c.ellipse(x + rand() * w, yy + rand() * h, 14 + rand() * 30, 5 + rand() * 9, rand() * 3, 0, 6.3); c.fill(); }\n      for (let i = 0; i < 34; i++) { c.fillStyle = rand() > 0.55 ? `rgba(20,8,6,${0.12 + rand() * 0.25})` : `rgba(255,220,190,${0.06 + rand() * 0.14})`; c.fillRect(x + rand() * w, yy + rand() * h, 0.7 + rand() * 1.3, 0.7 + rand() * 1.1); }\n      if (rand() < 0.12) { c.fillStyle = \"rgba(238,228,206,0.1)\"; c.fillRect(x, yy, w, h); } // a touch of lime bloom\n      c.restore();\n      l.fillStyle = \"rgba(255,216,170,0.6)\"; l.fillRect(x, yy + 1.5, 1.5, h - 3); l.fillStyle = \"rgba(0,0,0,0.55)\"; l.fillRect(x + w - 0.5, yy + 1, 2.6, h);\n      r.fillStyle = \"rgba(255,216,170,0.6)\"; r.fillRect(x + w - 1.5, yy + 1.5, 1.5, h - 3); r.fillStyle = \"rgba(0,0,0,0.55)\"; r.fillRect(x - 2.1, yy + 1, 2.6, h);\n    }\n  }\n  // The old painted name: cream lead paint that has let go of the joints and flaked off the faces.\n  const ghost = document.createElement(\"canvas\");\n  ghost.width = base.width; ghost.height = base.height;\n  const g = ghost.getContext(\"2d\");\n  if (g) {\n    g.setTransform(k, 0, 0, k, 0, 0);\n    let size = Math.min(104, W / 9.2);\n    g.font = `700 ${size}px Georgia, \"Times New Roman\", serif`;\n    const fit = (W - 48) / g.measureText(BRAND.toUpperCase()).width;\n    if (fit < 1) { size *= fit; g.font = `700 ${size}px Georgia, \"Times New Roman\", serif`; }\n    g.textAlign = \"center\"; g.textBaseline = \"middle\"; g.fillStyle = \"#efe5cd\";\n    const cy = W < 700 ? 62 : 92;\n    g.fillText(BRAND.toUpperCase(), W / 2, cy);\n    g.fillRect(W / 2 - size * 2.2, cy + size * 0.62, size * 4.4, Math.max(2, size * 0.045));\n    g.globalCompositeOperation = \"destination-out\";\n    for (let y = -BH * 0.4 + BH; y < cy + size; y += BH + M) { g.fillStyle = \"rgba(0,0,0,0.8)\"; g.fillRect(0, y - 0.5, W, M + 1); }\n    for (let i = 0; i < W * 2.2; i++) { g.fillStyle = `rgba(0,0,0,${0.3 + rand() * 0.7})`; g.beginPath(); g.ellipse(rand() * W, cy - size + rand() * size * 2, 0.6 + rand() * 3.6, 0.5 + rand() * 2.2, rand() * 3, 0, 6.3); g.fill(); }\n    c.globalAlpha = 0.62; c.setTransform(1, 0, 0, 1, 0, 0); c.drawImage(ghost, 0, 0); c.setTransform(k, 0, 0, k, 0, 0); c.globalAlpha = 1;\n  }\n  const soot = c.createLinearGradient(0, 0, 0, H);\n  soot.addColorStop(0, \"rgba(10,6,8,0.2)\"); soot.addColorStop(0.2, \"rgba(10,6,8,0)\"); soot.addColorStop(0.75, \"rgba(10,6,8,0)\"); soot.addColorStop(1, \"rgba(10,6,8,0.36)\");\n  c.fillStyle = soot; c.fillRect(0, 0, W, H);\n}\n\nexport default function BrickWallFooter() {\n  const root = useRef<HTMLElement>(null);\n  const layers = useRef<(HTMLCanvasElement | null)[]>([]);\n  const plates = useRef<(HTMLAnchorElement | null)[]>([]);\n  const aim = useRef<(x: number, y: number, hold: boolean) => void>(() => {});\n\n  useEffect(() => {\n    const el = root.current, [base, fromLeft, fromRight] = layers.current;\n    if (!el || !base || !fromLeft || !fromRight) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    let W = 0, H = 0, raf = 0, seen = true, last = 0;\n    let rects: { x: number; y: number; w: number; h: number }[] = [];\n    const light = { x: 0, y: 0, tx: 0, ty: 0, held: 0, born: performance.now() };\n    const measure = () => {\n      const box = el.getBoundingClientRect();\n      rects = plates.current.map((p) => { const b = p ? p.getBoundingClientRect() : box; return { x: b.left - box.left, y: b.top - box.top, w: b.width, h: b.height }; });\n      if (Math.abs(box.width - W) < 1 && Math.abs(box.height - H) < 1) return;\n      const first = !W;\n      W = box.width; H = box.height;\n      layWall(base, fromLeft, fromRight, W, H, Math.min(1.5, window.devicePixelRatio || 1));\n      if (first) { light.x = light.tx = W * 0.36; light.y = light.ty = H * 0.44; }\n    };\n    const paint = () => {\n      el.style.setProperty(\"--lx\", `${light.x.toFixed(1)}px`);\n      el.style.setProperty(\"--ly\", `${light.y.toFixed(1)}px`);\n      rects.forEach((b, i) => {\n        const p = plates.current[i];\n        if (!p) return;\n        const dx = b.x + b.w / 2 - light.x, dy = b.y + b.h / 2 - light.y, d = Math.hypot(dx, dy) || 1, far = Math.min(1, d / 260);\n        p.style.setProperty(\"--gx\", `${(light.x - b.x).toFixed(1)}px`);\n        p.style.setProperty(\"--gy\", `${(light.y - b.y).toFixed(1)}px`);\n        p.style.setProperty(\"--sx\", ((dx / d) * far).toFixed(3));\n        p.style.setProperty(\"--sy\", ((dy / d) * far * 0.8 + 0.25).toFixed(3)); // the street lamp overhead keeps a little shadow underneath\n      });\n    };\n    const tick = (now: number) => {\n      raf = 0;\n      const dt = Math.min(0.05, last ? (now - last) / 1000 : 0.016), t = (now - light.born) / 1000;\n      last = now;\n      if (DRIFT && now > light.held) { light.tx = W * (0.5 + 0.33 * Math.sin(t * 0.46 - 1.55)); light.ty = H * (0.47 + 0.19 * Math.sin(t * 0.71 + 0.4)); }\n      const ease = 1 - Math.exp(-dt * (now > light.held ? 2.2 : 11));\n      light.x += (light.tx - light.x) * ease; light.y += (light.ty - light.y) * ease;\n      paint();\n      if (seen && !document.hidden) raf = requestAnimationFrame(tick);\n    };\n    const wake = () => { if (!reduce && !raf && seen && !document.hidden) { last = 0; raf = requestAnimationFrame(tick); } };\n    aim.current = (x, y, hold) => {\n      const box = el.getBoundingClientRect();\n      light.tx = x - box.left; light.ty = y - box.top;\n      light.held = hold ? performance.now() + 1600 : 0;\n      if (reduce) { light.x = light.tx; light.y = light.ty; paint(); }\n    };\n    const ro = new ResizeObserver(() => { measure(); paint(); });\n    ro.observe(el);\n    const io = new IntersectionObserver(([e]) => { seen = e.isIntersecting; wake(); });\n    io.observe(el);\n    document.addEventListener(\"visibilitychange\", wake);\n    measure(); paint(); wake();\n    return () => { cancelAnimationFrame(raf); ro.disconnect(); io.disconnect(); document.removeEventListener(\"visibilitychange\", wake); };\n  }, []);\n\n  const mask = (side: \"left\" | \"right\") => {\n    const m = side === \"left\" ? \"linear-gradient(90deg,transparent calc(var(--lx) - 30px),#000 calc(var(--lx) + 170px))\" : \"linear-gradient(90deg,#000 calc(var(--lx) - 170px),transparent calc(var(--lx) + 30px))\";\n    return { maskImage: m, WebkitMaskImage: m };\n  };\n  let n = 0;\n\n  return (\n    <footer\n      ref={root}\n      onPointerMove={(e) => aim.current(e.clientX, e.clientY, true)}\n      onPointerDown={(e) => aim.current(e.clientX, e.clientY, true)}\n      className=\"relative isolate w-full overflow-clip bg-[#5d2c23] text-[#f1ead9]\"\n      style={{ [\"--lx\" as string]: \"36%\", [\"--ly\" as string]: \"44%\" }}\n    >\n      {[0, 1, 2].map((i) => (\n        <canvas key={i} ref={(c) => { layers.current[i] = c; }} aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 -z-10 h-full w-full\" style={i === 1 ? mask(\"left\") : i === 2 ? mask(\"right\") : undefined} />\n      ))}\n\n      <div className=\"relative mx-auto flex min-h-[660px] max-w-5xl flex-col px-4 pb-6 pt-[124px] sm:px-8 sm:pt-[196px]\">\n        <p className=\"sr-only\">{BRAND}, potters</p>\n        <div className=\"grid grid-cols-1 gap-x-9 gap-y-7 sm:grid-cols-3\">\n          {quarters.map((q) => {\n            const f = finishes[q.finish];\n            return (\n              <nav key={q.title} aria-label={q.title}>\n                <h2 className=\"relative z-20 mb-3 font-mono text-[11px] font-bold uppercase tracking-[0.34em] text-[#f1ead9]\" style={{ textShadow: \"0 1px 1px rgba(0,0,0,0.6)\" }}>{q.title}</h2>\n                <ul className=\"m-0 flex list-none flex-col gap-4 p-0\">\n                  {q.links.map(([name, kind], row) => {\n                    const i = n++;\n                    return (\n                      <li key={name}>\n                        <a\n                          href=\"#\"\n                          ref={(a) => { plates.current[i] = a; }}\n                          onFocus={(e) => { const b = e.currentTarget.getBoundingClientRect(); aim.current(b.left + b.width * 0.3, b.top + b.height * 0.4, true); }}\n                          className=\"group relative block min-h-[68px] rounded-[7px] transition-transform duration-200 ease-out hover:-translate-y-0.5 focus-visible:outline focus-visible:outline-4 focus-visible:outline-offset-4 focus-visible:outline-[#fbbf24] motion-reduce:transition-none motion-reduce:hover:translate-y-0\"\n                          style={{\n                            rotate: `${TILT[i % TILT.length]}deg`,\n                            color: f.ink,\n                            background: `radial-gradient(140% 170% at 24% -20%,rgba(255,255,255,${f.raised ? 0.1 : 0.2}),rgba(255,255,255,0) 46%,rgba(0,0,0,0.26) 100%),${f.face}`,\n                            boxShadow: `inset 0 0 0 1px rgba(8,8,8,0.9), inset 0 2px 1px 1px rgba(255,255,255,${f.raised ? 0.22 : 0.45}), inset 0 -2.5px 2px 1px rgba(0,0,0,0.4), calc(var(--sx,0.2) * 2px) calc(var(--sy,0.4) * 2px) 2px rgba(0,0,0,0.55), calc(var(--sx,0.2) * 11px) calc(var(--sy,0.4) * 11px) 14px rgba(0,0,0,0.5)`,\n                          }}\n                        >\n                          {f.raised && <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 rounded-[7px] opacity-70 mix-blend-overlay\" style={{ backgroundImage: GRAIN, backgroundSize: \"110px 110px\" }} />}\n                          <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-[6px] rounded-[3px]\" style={{ border: `2px solid ${f.line}`, boxShadow: f.raised ? \"calc(var(--sx,0.2) * 1.4px) calc(var(--sy,0.4) * 1.4px) 0.5px rgba(0,0,0,0.7)\" : undefined }} />\n                          {/* the torch's hot spot on the glaze, exactly where the beam lands */}\n                          <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 rounded-[7px]\" style={{ background: `radial-gradient(circle 190px at var(--gx,30%) var(--gy,40%),rgba(255,250,236,${f.gloss}) 0,rgba(255,250,236,${f.gloss * 0.42}) 22%,rgba(255,250,236,0) 62%)`, mixBlendMode: f.raised ? \"screen\" : \"normal\" }} />\n                          <span className=\"relative flex min-h-[68px] flex-col justify-center px-9 py-2\">\n                            <span className={`block whitespace-nowrap font-extrabold uppercase leading-none ${f.raised ? \"text-[21px] sm:text-[17px] lg:text-[20px]\" : \"text-[25px] sm:text-[22px] lg:text-[27px]\"}`} style={{ fontFamily: f.font, letterSpacing: f.raised ? \"0.05em\" : \"0.045em\", textShadow: f.raised ? \"calc(var(--sx,0.2) * 1.6px) calc(var(--sy,0.4) * 1.6px) 0.6px rgba(0,0,0,0.85), calc(var(--sx,0.2) * -0.8px) calc(var(--sy,0.4) * -0.8px) 0 rgba(255,255,255,0.55)\" : \"0 0.6px 0 rgba(0,0,0,0.25)\" }}>\n                              {name} {kind}\n                            </span>\n                            <span aria-hidden=\"true\" className=\"mt-[7px] flex justify-between text-[9.5px] font-bold uppercase leading-none tracking-[0.2em]\" style={{ color: f.sub }}>\n                              <span>{q.title} quarter</span>\n                              <span>{q.title[0]}{row + 1}</span>\n                            </span>\n                          </span>\n                          {[[\"left-[13px]\", 28], [\"right-[13px]\", 118]].map(([side, turn]) => (\n                            <span key={side} aria-hidden=\"true\" className={`pointer-events-none absolute top-1/2 -mt-[5px] block h-[10px] w-[10px] rounded-full ${side}`} style={{ background: \"radial-gradient(circle at 36% 30%,#f2f2ee,#9a9c9c 45%,#3d3f41)\", boxShadow: \"0 0 0 1px rgba(0,0,0,0.55), calc(var(--sx,0.2) * 1.5px) calc(var(--sy,0.4) * 1.5px) 1px rgba(0,0,0,0.5)\" }}>\n                              <span className=\"absolute left-[1.5px] top-[4.2px] block h-[1.6px] w-[7px] bg-[#1d1e20]\" style={{ rotate: `${Number(turn) + i * 37}deg` }} />\n                            </span>\n                          ))}\n                        </a>\n                      </li>\n                    );\n                  })}\n                </ul>\n              </nav>\n            );\n          })}\n        </div>\n\n        <div className=\"relative z-20 mt-auto flex flex-wrap items-center justify-between gap-x-6 gap-y-1 pt-10 font-mono text-[11px] uppercase tracking-[0.2em] text-[#f1ead9]\" style={{ textShadow: \"0 1px 1px rgba(0,0,0,0.7)\" }}>\n          <p className=\"m-0 py-2\">© 2026 {BRAND}</p>\n          <ul className=\"m-0 flex list-none flex-wrap gap-x-5 p-0\">\n            {small.map((s) => (\n              <li key={s}>\n                <a href=\"#\" className=\"inline-flex min-h-[40px] items-center rounded underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#fbbf24]\">{s}</a>\n              </li>\n            ))}\n          </ul>\n        </div>\n      </div>\n\n      {/* night, and the pool of torchlight that pushes it back */}\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 z-10\" style={{ background: `radial-gradient(circle ${TORCH.reach * 1.9}px at var(--lx) var(--ly),rgba(9,7,14,0) 0,rgba(9,7,14,${TORCH.night * 0.45}) 38%,rgba(9,7,14,${TORCH.night}) 78%)` }} />\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 z-10 mix-blend-overlay\" style={{ background: `radial-gradient(circle ${TORCH.reach}px at var(--lx) var(--ly),rgba(${TORCH.warm},0.62) 0,rgba(${TORCH.warm},0.26) 42%,rgba(${TORCH.warm},0) 100%)` }} />\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 z-10 mix-blend-soft-light\" style={{ background: `radial-gradient(circle ${TORCH.reach * 0.42}px at var(--lx) var(--ly),rgba(255,244,214,0.5) 0,rgba(255,244,214,0) 100%)` }} />\n    </footer>\n  );\n}\n"}]}
