{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"layered-diagonal-stripe-bands-moving-at-three-depths","type":"registry:component","title":"Layered Diagonal Stripe Bands","description":"","dependencies":[],"files":[{"path":"components/we-inc/layered-diagonal-stripe-bands-moving-at-three-depths.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\n// Three layers of diagonal bands slide at different speeds, so the nearest ones read as closer.\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.dsb-root{\n  /* Change these: */\n  --dsb-ground: #efe3cf;           /* background sand */\n  --dsb-band: 184,98,56;           /* band colour as r,g,b */\n  --dsb-speed: 18s;                /* time for the front layer to move one tile */\n  --dsb-near: 240px;               /* front band tile size; the far layers scale from it */\n}\n.dsb-root{position:relative;display:flex;align-items:center;min-height:620px;isolation:isolate;overflow:hidden;background:var(--dsb-ground);font-family:ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",sans-serif}\n.dsb-art{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}\n.dsb-layer{position:absolute;top:-10%;bottom:-10%;will-change:transform}\n.dsb-far{left:calc(var(--dsb-near) * -0.45);right:0;--t:calc(var(--dsb-near) * .45);background-size:var(--t) var(--t);\n  background-image:linear-gradient(45deg,rgba(var(--dsb-band),.07) 25%,transparent 25% 50%,rgba(var(--dsb-band),.07) 50% 75%,transparent 75%);animation:dsb-far calc(var(--dsb-speed) * 1.6) linear infinite}\n.dsb-mid{left:calc(var(--dsb-near) * -0.7);right:0;--t:calc(var(--dsb-near) * .7);background-size:var(--t) var(--t);\n  background-image:linear-gradient(45deg,rgba(var(--dsb-band),.11) 15%,transparent 15% 50%,rgba(var(--dsb-band),.11) 50% 65%,transparent 65%);animation:dsb-mid calc(var(--dsb-speed) * 1.2) linear infinite}\n.dsb-near{left:calc(var(--dsb-near) * -1);right:0;--t:var(--dsb-near);background-size:var(--t) var(--t);\n  background-image:linear-gradient(45deg,rgba(var(--dsb-band),.30) 0 1.2%,rgba(var(--dsb-band),.16) 1.2% 9%,rgba(255,250,240,.16) 9% 10.5%,transparent 10.5% 50%,rgba(var(--dsb-band),.30) 50% 51.2%,rgba(var(--dsb-band),.16) 51.2% 59%,rgba(255,250,240,.16) 59% 60.5%,transparent 60.5%);\n  animation:dsb-near var(--dsb-speed) linear infinite}\n.dsb-light{position:absolute;inset:0;background:radial-gradient(70% 60% at 30% 20%,rgba(255,248,236,.55),transparent 70%),radial-gradient(80% 70% at 100% 100%,rgba(120,60,30,.14),transparent 70%)}\n.dsb-calm{position:absolute;left:50%;top:50%;width:min(900px,110%);height:520px;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(closest-side,rgba(239,227,207,.92),rgba(239,227,207,.6) 55%,transparent 100%)}\n@keyframes dsb-far{to{transform:translateX(calc(var(--dsb-near) * .45))}}\n@keyframes dsb-mid{to{transform:translateX(calc(var(--dsb-near) * .7))}}\n@keyframes dsb-near{to{transform:translateX(var(--dsb-near))}}\n.dsb-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.dsb-hero > *{max-width:none}\n.dsb-eyebrow{margin:0 0 18px;font-size:13px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#8a3f1c}\n.dsb-title{margin:0;font-size:clamp(2.1rem,5.4vw,3.6rem);line-height:1.06;letter-spacing:-.025em;font-weight:650;color:#2b1a10;text-wrap:balance}\n.dsb-copy{margin:20px auto 0;max-width:34em;font-size:clamp(1rem,1.6vw,1.125rem);line-height:1.6;color:#5a4436}\n.dsb-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;margin-top:32px;padding:0 24px;border-radius:4px;background:#2b1a10;color:#f8efe2;font-size:15px;font-weight:600;text-decoration:none;box-shadow:none;transition:transform .2s ease,background-color .2s ease}\n.dsb-btn:hover{transform:translateY(-1px);background:#43291a}\n.dsb-btn:focus-visible{outline:2px solid #8a3f1c;outline-offset:3px}\n@media (max-width:640px){.dsb-hero{padding:88px 20px}}\n.dsb-root[data-paused] *,.dsb-root[data-paused] *::before,.dsb-root[data-paused] *::after{animation-play-state:paused!important}\n@media (prefers-reduced-motion: reduce){\n\n.dsb-root *,.dsb-root *::before,.dsb-root *::after{animation:none!important;transition:none!important}\n}\n`;\n\nexport default function LayeredDiagonalStripeBands() {\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=\"dsb-root relative w-full overflow-hidden\">\n      <style>{css}</style>\n      <div className=\"dsb-art\" aria-hidden=\"true\">\n        <div className=\"dsb-layer dsb-far\"></div>\n        <div className=\"dsb-layer dsb-mid\"></div>\n        <div className=\"dsb-layer dsb-near\"></div>\n        <div className=\"dsb-light\"></div>\n        <div className=\"dsb-calm\"></div>\n      </div>\n      <div className=\"dsb-hero\">\n      <p className=\"dsb-eyebrow\">Hand-loomed in small runs</p>\n      <h1 className=\"dsb-title\">Rugs woven at the pace of the river.</h1>\n      <p className=\"dsb-copy\">Flatweaves in undyed wool and madder red, each one finished by hand and numbered on the back.</p>\n      <a className=\"dsb-btn\" href=\"#\">See the spring weaves</a>\n      </div>\n    </section>\n  );\n}\n"}]}
