{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"marker-highlight-wiping-behind-a-phrase","type":"registry:component","title":"Marker Highlight Wiping Behind a Phrase","description":"","dependencies":[],"files":[{"path":"components/we-inc/marker-highlight-wiping-behind-a-phrase.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\nconst BUSINESS = \"Corner Locksmiths of Ashby\";\nconst COPY = \"Walk-in key cutting, lock changes and lockouts across the north side. Open eight until six, and until two on Saturdays.\";\n\nconst CSS = `\n/* Edit these first: colours, and how long one full cycle takes. */\n.mh-root {\n  --mh-bg: #ffffff;\n  --mh-ink: #18212d;\n  --mh-muted: #4a5565;\n  --mh-accent: #ffd95a;\n  --mh-speed: 7s;\n  position: relative;\n  overflow: hidden;\n  box-sizing: border-box;\n  min-height: 480px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 72px 20px;\n  background: var(--mh-bg);\n  color: var(--mh-ink);\n  font-family: \"Inter Tight\", Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif;\n  -webkit-font-smoothing: antialiased;\n}\n.mh-root *, .mh-root *::before, .mh-root *::after { box-sizing: border-box; }\n.mh-inner { position: relative; z-index: 1; width: 100%; max-width: 1040px; }\n.mh-eyebrow { margin: 0 0 22px; font-family: \"Inter Tight\", Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mh-muted); }\n.mh-h { margin: 0; font-size: clamp(36px, 6.2vw, 80px); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; }\n.mh-copy { margin: 28px 0 0; max-width: 34em; font-family: \"Inter Tight\", Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; color: var(--mh-muted); }\n.mh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.mh-w { display: inline-block; white-space: nowrap; }\n.mh-l { display: inline-block; }\n/* Paused while scrolled out of view (the script sets data-paused). */\n.mh-root[data-paused=\"true\"] *, .mh-root[data-paused=\"true\"] *::before, .mh-root[data-paused=\"true\"] *::after { animation-play-state: paused !important; }\n@media (prefers-reduced-motion: reduce) {\n  .mh-root *, .mh-root *::before, .mh-root *::after { animation: none !important; }\n}\n\n.mh-h { max-width: 15em; }\n.mh-mark {\n  padding: 0 .06em;\n  margin: 0 -.06em;\n  background-image: linear-gradient(100deg, rgba(255, 217, 90, .75), var(--mh-accent) 6%, var(--mh-accent) 94%, rgba(255, 217, 90, .75));\n  background-repeat: no-repeat;\n  background-size: 100% 62%;\n  background-position: 0 85%;\n  animation: mh-wipe var(--mh-speed) cubic-bezier(.65, 0, .25, 1) infinite;\n}\n/* The default box-decoration-break (slice) makes the wipe run line by line when the phrase wraps. */\n@keyframes mh-wipe {\n  0%, 6% { background-size: 0% 62%; background-position: 0 85%; }\n  34% { background-size: 100% 62%; background-position: 0 85%; }\n  84% { background-size: 100% 62%; background-position: 100% 85%; }\n  97%, 100% { background-size: 0% 62%; background-position: 100% 85%; }\n}\n`;\n\nexport default function MarkerHighlightWipe() {\n  const rootRef = useRef<HTMLElement>(null);\n\n  // Pause the CSS animation while the section is off screen.\n  useEffect(() => {\n    const el = rootRef.current;\n    if (!el || typeof IntersectionObserver === \"undefined\") return;\n    const io = new IntersectionObserver(([entry]) => {\n      el.dataset.paused = entry.isIntersecting ? \"false\" : \"true\";\n    });\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section ref={rootRef} data-paused=\"false\" className=\"mh-root w-full\">\n      <style>{CSS}</style>\n      <div className=\"mh-inner\">\n        <p className=\"mh-eyebrow\">{BUSINESS}</p>\n        <h2 className=\"mh-h\">\n          Same-day key cutting, and <span className=\"mh-mark\">a real person answers the phone.</span>\n        </h2>\n        <p className=\"mh-copy\">{COPY}</p>\n      </div>\n    </section>\n  );\n}\n"}]}
