{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"arrow-button-where-a-twin-arrow-slides-in","type":"registry:block","title":"Arrow Button Where a Twin Arrow Slides In","description":"","dependencies":[],"files":[{"path":"components/we-inc/arrow-button-where-a-twin-arrow-slides-in.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\nfunction Arrow({ className }: { className: string }) {\n  return (\n    <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" className={className} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n      <path d=\"M4 10h12M11 5l5 5-5 5\" />\n    </svg>\n  );\n}\n\nexport default function ArrowButtonWhereATwinArrowSlidesIn() {\n  const root = useRef<HTMLElement>(null);\n\n  // pauses the idle loop while the section is off screen\n  useEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    const io = new IntersectionObserver(([en]) => { el.toggleAttribute(\"data-paused\", !en.isIntersecting); });\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section ref={root} className=\"w3arr bg-[#0f1d33] px-5 py-16 text-[#e8edf5] sm:py-24\">\n      <style>{`\n        .w3arr-box { position: relative; overflow: hidden; display: inline-flex; flex-shrink: 0; }\n        .w3arr-a, .w3arr-b { transition: transform .45s cubic-bezier(.65,0,.35,1); }\n        .w3arr-b { position: absolute; inset: 0; margin: auto; transform: translateX(-160%); }\n        .w3arr-btn:focus-visible .w3arr-a { transform: translateX(160%); }\n        .w3arr-btn:focus-visible .w3arr-b { transform: none; }\n        .w3arr-btn:focus-visible { outline: 2px solid #e8edf5; outline-offset: 4px; }\n        @media (hover: hover) and (pointer: fine) {\n          .w3arr-btn:hover .w3arr-a { transform: translateX(160%); }\n          .w3arr-btn:hover .w3arr-b { transform: none; }\n        }\n        /* idle demo on the first button: swap, then reset while both arrows look identical */\n        @keyframes w3arr-out { 0%, 45% { transform: none; } 62% { transform: translateX(160%); } 62.1%, 100% { transform: none; } }\n        @keyframes w3arr-in { 0%, 45% { transform: translateX(-160%); } 62% { transform: none; } 62.1%, 100% { transform: translateX(-160%); } }\n        .w3arr-demo .w3arr-a { animation: w3arr-out 2.8s cubic-bezier(.65,0,.35,1) infinite; }\n        .w3arr-demo .w3arr-b { animation: w3arr-in 2.8s cubic-bezier(.65,0,.35,1) infinite; }\n        .w3arr:hover .w3arr-demo .w3arr-a, .w3arr:hover .w3arr-demo .w3arr-b,\n        .w3arr:focus-within .w3arr-demo .w3arr-a, .w3arr:focus-within .w3arr-demo .w3arr-b { animation: none; }\n        .w3arr[data-paused] .w3arr-a, .w3arr[data-paused] .w3arr-b { animation-play-state: paused; }\n        @media (prefers-reduced-motion: reduce) {\n          .w3arr-demo .w3arr-a, .w3arr-demo .w3arr-b { animation: none; }\n          .w3arr-a, .w3arr-b { transition: none; }\n        }\n      `}</style>\n      <div className=\"mx-auto max-w-3xl\">\n        <p className=\"text-xs font-semibold uppercase tracking-[0.25em] text-[#9fb3d1]\">Harbour Tide Sailing School</p>\n        <h2 className=\"mt-4 text-3xl font-semibold leading-tight tracking-tight sm:text-5xl\">Learn to sail a dinghy in four Saturday mornings.</h2>\n        <p className=\"mt-5 max-w-xl text-base leading-relaxed text-[#b9c6da]\">Small boats, two learners per instructor, and a warm clubhouse to dry off in. Lifejackets and wetsuits are on us.</p>\n        <div className=\"mt-10 flex flex-wrap items-center gap-x-8 gap-y-5\">\n          <a href=\"#\" className=\"w3arr-btn w3arr-demo inline-flex h-14 items-center gap-4 rounded-full bg-[#e8edf5] pl-7 pr-2 text-base font-semibold text-[#0f1d33]\">\n            Choose a start date\n            <span className=\"w3arr-box h-10 w-10 items-center justify-center rounded-full bg-[#0f1d33] text-[#e8edf5]\">\n              <Arrow className=\"w3arr-a h-5 w-5\" />\n              <Arrow className=\"w3arr-b h-5 w-5\" />\n            </span>\n          </a>\n          <a href=\"#\" className=\"w3arr-btn inline-flex h-12 items-center gap-2 text-base font-semibold text-[#e8edf5]\">\n            See what a lesson covers\n            <span className=\"w3arr-box h-5 w-5\">\n              <Arrow className=\"w3arr-a h-5 w-5\" />\n              <Arrow className=\"w3arr-b h-5 w-5\" />\n            </span>\n          </a>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
