{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"logo-strip-marquee-with-soft-edge-fade","type":"registry:block","title":"Logo Strip Marquee With Soft Edge Fade","description":"","dependencies":[],"files":[{"path":"components/we-inc/logo-strip-marquee-with-soft-edge-fade.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\n\n// Invented client wordmarks. Each has a small drawn mark and a name set in its own type style.\nconst clients = [\n  { name: \"Northwell Joinery\", mark: \"square\", font: \"font-serif tracking-tight\" },\n  { name: \"Kettle Point\", mark: \"circle\", font: \"font-sans font-semibold tracking-tight\" },\n  { name: \"ASHBY & ROWE\", mark: \"bars\", font: \"font-sans font-bold tracking-[0.18em] text-[15px]\" },\n  { name: \"Lumen Dental\", mark: \"ring\", font: \"font-sans font-medium\" },\n  { name: \"Fernhill Co-op\", mark: \"leaf\", font: \"font-serif italic\" },\n  { name: \"CALDER FREIGHT\", mark: \"tri\", font: \"font-mono font-semibold tracking-wider text-[15px]\" },\n  { name: \"Oak and Ember\", mark: \"circle\", font: \"font-serif font-semibold\" },\n  { name: \"Marlow Clinic\", mark: \"square\", font: \"font-sans font-semibold tracking-tight\" },\n];\nconst SPEED = 36; // seconds for one full loop of the row\n\nfunction Mark({ kind }: { kind: string }) {\n  const c = \"fill-current\";\n  return (\n    <svg viewBox=\"0 0 24 24\" width=\"22\" height=\"22\" aria-hidden=\"true\" className=\"shrink-0\">\n      {kind === \"square\" && <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"4\" className={c} />}\n      {kind === \"circle\" && <circle cx=\"12\" cy=\"12\" r=\"9\" className={c} />}\n      {kind === \"ring\" && <circle cx=\"12\" cy=\"12\" r=\"7.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" />}\n      {kind === \"tri\" && <path d=\"M12 3l9.5 17h-19z\" className={c} />}\n      {kind === \"bars\" && <path d=\"M4 4h4v16H4zM10 8h4v12h-4zM16 12h4v8h-4z\" className={c} />}\n      {kind === \"leaf\" && <path d=\"M5 19C5 10 11 4 20 4c0 9-6 15-15 15z\" className={c} />}\n    </svg>\n  );\n}\n\nfunction Group({ dup }: { dup?: boolean }) {\n  return (\n    <ul className=\"w3lgo-group\" aria-hidden={dup ? \"true\" : undefined}>\n      {clients.map((c) => (\n        <li key={c.name} className=\"flex h-16 items-center gap-2.5 whitespace-nowrap text-slate-600\">\n          <Mark kind={c.mark} />\n          <span className={`text-lg text-slate-700 ${c.font}`}>{c.name}</span>\n        </li>\n      ))}\n    </ul>\n  );\n}\n\nexport default function LogoStripMarqueeWithSoftEdgeFade() {\n  const root = useRef<HTMLElement>(null);\n  const [paused, setPaused] = useState(false);\n  const [off, setOff] = useState(false);\n\n  useEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    // stop the loop while the strip is out of view\n    const io = new IntersectionObserver(([e]) => setOff(!e.isIntersecting));\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section\n      ref={root}\n      data-paused={paused ? \"\" : undefined}\n      data-off={off ? \"\" : undefined}\n      className=\"w3lgo bg-white px-5 py-20 sm:py-24\"\n      style={{ [\"--w3lgo-speed\" as string]: `${SPEED}s` }}\n    >\n      <style>{`\n        .w3lgo-view { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }\n        .w3lgo-track { display: flex; width: max-content; animation: w3lgo-run var(--w3lgo-speed) linear infinite; }\n        .w3lgo-group { display: flex; gap: 56px; padding: 0 56px 0 0; margin: 0; list-style: none; }\n        .w3lgo[data-paused] .w3lgo-track, .w3lgo[data-off] .w3lgo-track, .w3lgo-view:hover .w3lgo-track, .w3lgo-view:focus-within .w3lgo-track { animation-play-state: paused; }\n        @keyframes w3lgo-run { to { transform: translateX(-50%); } }\n        @media (prefers-reduced-motion: reduce) {\n          .w3lgo-view { -webkit-mask-image: none; mask-image: none; }\n          .w3lgo-track { animation: none; width: auto; justify-content: center; }\n          .w3lgo-group { flex-wrap: wrap; justify-content: center; column-gap: 40px; row-gap: 4px; padding: 0; }\n          .w3lgo-group[aria-hidden] { display: none; }\n          .w3lgo-toggle { display: none; }\n        }\n      `}</style>\n      <div className=\"mx-auto max-w-5xl\">\n        <div className=\"flex flex-col items-center gap-3 text-center\">\n          <p className=\"text-xs font-semibold uppercase tracking-[0.25em] text-slate-500\">Harbourline Accounts</p>\n          <h2 className=\"max-w-2xl text-2xl font-semibold tracking-tight text-slate-900 sm:text-3xl\">\n            The books behind workshops, clinics and family firms along the coast\n          </h2>\n        </div>\n        <div className=\"w3lgo-view mt-12\">\n          <div className=\"w3lgo-track\">\n            <Group />\n            <Group dup />\n          </div>\n        </div>\n        <div className=\"mt-10 flex justify-center\">\n          <button\n            type=\"button\"\n            aria-pressed={paused}\n            onClick={() => setPaused((p) => !p)}\n            className=\"w3lgo-toggle inline-flex h-10 items-center gap-2 rounded-full border border-slate-300 px-4 text-sm font-medium text-slate-700 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:ring-offset-2\"\n          >\n            <svg viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\" className=\"fill-current\">\n              {paused ? <path d=\"M4 2.5v11l9-5.5z\" /> : <path d=\"M4 2.5h3v11H4zM9 2.5h3v11H9z\" />}\n            </svg>\n            {paused ? \"Play logos\" : \"Pause logos\"}\n          </button>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
