{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"hand-drawn-underline-drawing-under-one-word","type":"registry:component","title":"Hand-Drawn Underline Under One Word","description":"","dependencies":[],"files":[{"path":"components/we-inc/hand-drawn-underline-drawing-under-one-word.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\n\nconst BUSINESS = \"Pell & Daughter Tailors\";\nconst COPY = \"Hems, sleeves and waistbands adjusted in our Kirkgate shop, usually ready within the week. Bring the shoes you will wear with them.\";\n\nconst CSS = `\n/* Edit these first: colours, and how long one full cycle takes. */\n.ud-root {\n  --ud-bg: #f5eee2;\n  --ud-ink: #231c17;\n  --ud-muted: #5f5246;\n  --ud-accent: #c0562c;\n  --ud-speed: 6.5s;\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(--ud-bg);\n  color: var(--ud-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.ud-root *, .ud-root *::before, .ud-root *::after { box-sizing: border-box; }\n.ud-inner { position: relative; z-index: 1; width: 100%; max-width: 1040px; }\n.ud-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(--ud-muted); }\n.ud-h { margin: 0; font-size: clamp(40px, 7vw, 88px); font-weight: 800; line-height: 1.06; letter-spacing: -.03em; }\n.ud-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(--ud-muted); }\n.ud-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.ud-w { display: inline-block; white-space: nowrap; }\n.ud-l { display: inline-block; }\n/* Paused while scrolled out of view (the script sets data-paused). */\n.ud-root[data-paused=\"true\"] *, .ud-root[data-paused=\"true\"] *::before, .ud-root[data-paused=\"true\"] *::after { animation-play-state: paused !important; }\n@media (prefers-reduced-motion: reduce) {\n  .ud-root *, .ud-root *::before, .ud-root *::after { animation: none !important; }\n}\n\n.ud-h { max-width: 13em; }\n.ud-mark { position: relative; display: inline-block; white-space: nowrap; }\n.ud-svg { position: absolute; left: -.05em; bottom: -.2em; width: calc(100% + .1em); height: .34em; overflow: visible; pointer-events: none; }\n.ud-svg path {\n  fill: none;\n  stroke: var(--ud-accent);\n  stroke-width: 5;\n  stroke-linecap: round;\n  stroke-dasharray: 1;\n  stroke-dashoffset: 0;\n  animation: ud-draw var(--ud-speed) cubic-bezier(.6, 0, .25, 1) infinite;\n}\n.ud-svg path + path { stroke-width: 3.5; animation-name: ud-draw-2; }\n@keyframes ud-draw {\n  0%, 6% { stroke-dashoffset: 1; opacity: 0; }\n  7% { opacity: 1; }\n  26%, 84% { stroke-dashoffset: 0; }\n  95% { opacity: 1; }\n  96%, 100% { stroke-dashoffset: -1; opacity: 0; }\n}\n@keyframes ud-draw-2 {\n  0%, 22% { stroke-dashoffset: 1; opacity: 0; }\n  23% { opacity: 1; }\n  36%, 84% { stroke-dashoffset: 0; }\n  95% { opacity: 1; }\n  96%, 100% { stroke-dashoffset: -1; opacity: 0; }\n}\n`;\n\nexport default function HandDrawnUnderlineWord() {\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=\"ud-root w-full\">\n      <style>{CSS}</style>\n      <div className=\"ud-inner\">\n        <p className=\"ud-eyebrow\">{BUSINESS}</p>\n        <h2 className=\"ud-h\">\n          Alterations for the way you{\" \"}\n          <span className=\"ud-mark\">\n            actually\n            <svg className=\"ud-svg\" viewBox=\"0 0 300 26\" preserveAspectRatio=\"none\" aria-hidden=\"true\" focusable=\"false\">\n              <path pathLength={1} d=\"M6 15 C 70 6, 140 20, 210 11 S 282 8, 295 13\" />\n              <path pathLength={1} d=\"M28 22 C 100 15, 196 20, 280 14\" />\n            </svg>\n          </span>{\" \"}\n          move.\n        </h2>\n        <p className=\"ud-copy\">{COPY}</p>\n      </div>\n    </section>\n  );\n}\n"}]}
