{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"dot-matrix-grid-with-a-travelling-band-of-light","type":"registry:component","title":"Dot Matrix with Travelling Light","description":"","dependencies":[],"files":[{"path":"components/we-inc/dot-matrix-grid-with-a-travelling-band-of-light.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\n// A pale dot grid where a soft band of colour travels across and lights only the dots.\n// Pure CSS: the decorative layer is aria-hidden and animates transform and opacity.\n// The effect pauses while the section is off screen and stays still for reduced motion.\n\nconst css = `\n.dmx-root{\n  /* Change these: */\n  --dmx-gap: 20px;               /* distance between dots */\n  --dmx-dot: 1.8px;              /* dot radius */\n  --dmx-lit: 41,82,150;          /* colour of the travelling light as r,g,b */\n  --dmx-speed: 9s;               /* time for the band to cross */\n}\n.dmx-root{position:relative;display:flex;align-items:center;min-height:600px;isolation:isolate;overflow:hidden;background:#f6f7f9;font-family:ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",sans-serif}\n.dmx-art{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}\n.dmx-dots{position:absolute;inset:0;background-image:radial-gradient(circle,#c3cad5 var(--dmx-dot),transparent calc(var(--dmx-dot) + .6px));background-size:var(--dmx-gap) var(--dmx-gap);background-position:center}\n.dmx-lit{position:absolute;inset:0;\n  -webkit-mask-image:radial-gradient(circle,#000 calc(var(--dmx-dot) + .7px),transparent calc(var(--dmx-dot) + 1.3px));mask-image:radial-gradient(circle,#000 calc(var(--dmx-dot) + .7px),transparent calc(var(--dmx-dot) + 1.3px));\n  -webkit-mask-size:var(--dmx-gap) var(--dmx-gap);mask-size:var(--dmx-gap) var(--dmx-gap);-webkit-mask-position:center;mask-position:center}\n.dmx-band{position:absolute;top:-40%;bottom:-40%;left:0;width:45%;will-change:transform;transform:translateX(-80%) rotate(14deg);\n  background:linear-gradient(90deg,transparent,rgba(var(--dmx-lit),.5) 25%,rgb(var(--dmx-lit)) 50%,rgba(var(--dmx-lit),.5) 75%,transparent);animation:dmx-pass var(--dmx-speed) cubic-bezier(.55,.1,.45,.9) infinite}\n.dmx-echo{position:absolute;top:-40%;bottom:-40%;left:0;width:26%;will-change:transform;transform:translateX(330%) rotate(-10deg);\n  background:linear-gradient(90deg,transparent,rgba(196,110,60,.9) 50%,transparent);animation:dmx-back calc(var(--dmx-speed) * 1.5) cubic-bezier(.55,.1,.45,.9) infinite}\n.dmx-calm{position:absolute;left:50%;top:50%;width:min(860px,120%);height:380px;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(closest-side,rgba(246,247,249,.97) 35%,rgba(246,247,249,.6) 65%,transparent 100%)}\n.dmx-edge{position:absolute;inset:0;background:linear-gradient(180deg,#f6f7f9,transparent 14%,transparent 86%,#f6f7f9)}\n@keyframes dmx-pass{0%{transform:translateX(-80%) rotate(14deg)}100%{transform:translateX(260%) rotate(14deg)}}\n@keyframes dmx-back{0%{transform:translateX(360%) rotate(-10deg)}100%{transform:translateX(-120%) rotate(-10deg)}}\n.dmx-hero{position:relative;z-index:1;box-sizing:border-box;width:100%;max-width:720px;margin:0 auto;padding:112px 20px;text-align:center}\n.dmx-hero > *{max-width:none}\n.dmx-eyebrow{margin:0 0 18px;font-size:13px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#2c4f8a}\n.dmx-title{margin:0;font-size:clamp(2.1rem,5.4vw,3.6rem);line-height:1.06;letter-spacing:-.025em;font-weight:650;color:#121a2b;text-wrap:balance}\n.dmx-copy{margin:20px auto 0;max-width:34em;font-size:clamp(1rem,1.6vw,1.125rem);line-height:1.6;color:#4a5568}\n.dmx-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;margin-top:32px;padding:0 24px;border-radius:8px;background:#1d3a6b;color:#ffffff;font-size:15px;font-weight:600;text-decoration:none;box-shadow:none;transition:transform .2s ease,background-color .2s ease}\n.dmx-btn:hover{transform:translateY(-1px);background:#264a85}\n.dmx-btn:focus-visible{outline:2px solid #2c4f8a;outline-offset:3px}\n@media (max-width:640px){.dmx-hero{padding:88px 20px}}\n.dmx-root[data-paused] *,.dmx-root[data-paused] *::before,.dmx-root[data-paused] *::after{animation-play-state:paused!important}\n@media (prefers-reduced-motion: reduce){\n.dmx-band{transform:translateX(10%) rotate(14deg)}.dmx-echo{transform:translateX(240%) rotate(-10deg)}\n.dmx-root *,.dmx-root *::before,.dmx-root *::after{animation:none!important;transition:none!important}\n}\n`;\n\nexport default function DotMatrixTravellingLight() {\n  const root = useRef<HTMLElement>(null);\n\n  useEffect(() => {\n    const el = root.current;\n    if (!el || typeof IntersectionObserver === \"undefined\") return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const io = new IntersectionObserver((entries) => {\n      for (const entry of entries) {\n        if (entry.isIntersecting) el.removeAttribute(\"data-paused\");\n        else el.setAttribute(\"data-paused\", \"\");\n      }\n    });\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section ref={root} className=\"dmx-root relative w-full overflow-hidden\">\n      <style>{css}</style>\n      <div className=\"dmx-art\" aria-hidden=\"true\">\n        <div className=\"dmx-dots\"></div>\n        <div className=\"dmx-lit\"><div className=\"dmx-band\"></div><div className=\"dmx-echo\"></div></div>\n        <div className=\"dmx-calm\"></div>\n        <div className=\"dmx-edge\"></div>\n      </div>\n      <div className=\"dmx-hero\">\n      <p className=\"dmx-eyebrow\">Bookkeeping for architects</p>\n      <h1 className=\"dmx-title\">Every invoice, filed before the coffee cools.</h1>\n      <p className=\"dmx-copy\">Receipts, fee stages and VAT returns kept in order by two accountants who read drawings as well as ledgers.</p>\n      <a className=\"dmx-btn\" href=\"#\">Book a 20 minute call</a>\n      </div>\n    </section>\n  );\n}\n"}]}
