{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"footer-sign-off-logo-that-draws-on-entry","type":"registry:component","title":"Footer Sign-Off Logo That Draws on Entry","description":"","dependencies":[],"files":[{"path":"components/we-inc/footer-sign-off-logo-that-draws-on-entry.tsx","type":"registry:component","content":"import { useEffect, useLayoutEffect, useRef } from \"react\";\n\n// Edit these first: the colours at the top of .m1ftr, and the three drawn paths of the mark.\nconst CSS = `\n.m1ftr { --m1ftr-bg: #1b1e1c; --m1ftr-ink: #ece7dc; --m1ftr-quiet: #a9ada6; --m1ftr-line: #343a36; --m1ftr-focus: #c9b37e; --m1ftr-stroke: #c9b37e; }\n.m1ftr { position: relative; box-sizing: border-box; overflow: hidden; font-family: \"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif; -webkit-font-smoothing: antialiased; }\n.m1ftr *, .m1ftr *::before, .m1ftr *::after { box-sizing: border-box; }\n.m1ftr-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n.m1ftr-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m1ftr-line); border-radius: 999px; background: transparent; color: var(--m1ftr-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }\n.m1ftr-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.m1ftr-replay:hover { color: var(--m1ftr-ink); }\n.m1ftr-replay:focus-visible { outline: 2px solid var(--m1ftr-focus); outline-offset: 2px; }\n/* Reduced motion: no movement at all, the finished logo shows straight away. */\n@media (prefers-reduced-motion: reduce) {\n  .m1ftr *, .m1ftr *::before, .m1ftr *::after { animation: none !important; transition: none !important; }\n  .m1ftr-replay { display: none; }\n}\n\n.m1ftr { background: var(--m1ftr-bg); color: var(--m1ftr-ink); padding: 56px clamp(20px, 5vw, 64px) 72px; }\n.m1ftr-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px 56px; }\n.m1ftr-sign { display: flex; align-items: center; gap: 18px; align-self: start; }\n.m1ftr-mark { flex: none; width: 72px; height: 72px; overflow: visible; }\n.m1ftr-mark .m1ftr-s { fill: none; stroke: var(--m1ftr-stroke); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }\n.m1ftr-w { margin: 0; font-family: Georgia, \"Times New Roman\", serif; font-size: 22px; line-height: 1.15; }\n.m1ftr-tag { margin: 4px 0 0; font-size: 13.5px; color: var(--m1ftr-quiet); }\n.m1ftr-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }\n.m1ftr-cols h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m1ftr-quiet); }\n.m1ftr-cols ul { margin: 0; padding: 0; list-style: none; }\n.m1ftr-cols a { display: inline-flex; align-items: center; min-height: 40px; color: var(--m1ftr-ink); font-size: 15px; text-decoration: none; }\n.m1ftr-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }\n.m1ftr-cols a:focus-visible { outline: 2px solid var(--m1ftr-focus); outline-offset: 2px; }\n.m1ftr-legal { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--m1ftr-line); font-size: 13.5px; color: var(--m1ftr-quiet); }\n.m1ftr-legal address { font-style: normal; }\n@media (max-width: 720px) {\n  .m1ftr-in { grid-template-columns: 1fr; }\n  .m1ftr-cols { grid-template-columns: repeat(2, 1fr); }\n}\n@media (prefers-reduced-motion: no-preference) {\n  .m1ftr.is-js:not([data-run]) .m1ftr-mark .m1ftr-s { stroke-dashoffset: 1; }\n  .m1ftr.is-js:not([data-run]) .m1ftr-name { opacity: 0; }\n}\n.m1ftr[data-run] .m1ftr-mark .m1ftr-s { animation: m1ftr-draw .8s cubic-bezier(.6, 0, .3, 1) both; }\n.m1ftr[data-run] .m1ftr-mark .m1ftr-s2 { animation-duration: .7s; animation-delay: .35s; }\n.m1ftr[data-run] .m1ftr-mark .m1ftr-s3 { animation-duration: .55s; animation-delay: .75s; }\n.m1ftr[data-run] .m1ftr-name { animation: m1ftr-slide .7s cubic-bezier(.2, .7, .2, 1) .45s both; }\n@keyframes m1ftr-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }\n@keyframes m1ftr-slide { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }\n`;\n\n// Runs before paint in the browser so the logo never flashes before its reveal.\nconst useBrowserLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nexport default function FooterSignOffLogoThatDraws() {\n  const rootRef = useRef<HTMLElement>(null);\n\n  // Plays once when the piece scrolls into view (works inside a scrolling box too), then stops.\n  // With prefers-reduced-motion the CSS shows the finished logo and hides the Replay button.\n  useBrowserLayoutEffect(() => {\n    const root = rootRef.current;\n    if (!root) return;\n    root.classList.add(\"is-js\");\n    const play = () => {\n      root.removeAttribute(\"data-run\");\n      void root.offsetWidth; // restart the keyframes\n      root.setAttribute(\"data-run\", \"\");\n    };\n    const btn = root.querySelector(\".m1ftr-replay\");\n    btn?.addEventListener(\"click\", play);\n    if (typeof IntersectionObserver === \"undefined\") {\n      play();\n      return () => btn?.removeEventListener(\"click\", play);\n    }\n    const io = new IntersectionObserver((entries) => {\n      if (entries[0].isIntersecting) {\n        play();\n        io.disconnect();\n      }\n    }, { threshold: 0.3 });\n    io.observe(root);\n    return () => {\n      io.disconnect();\n      btn?.removeEventListener(\"click\", play);\n    };\n  }, []);\n\n  return (\n    <section ref={rootRef} className=\"m1ftr\">\n      <style>{CSS}</style>\n<footer className=\"m1ftr-in\">\n  <div className=\"m1ftr-sign\">\n    <svg className=\"m1ftr-mark\" viewBox=\"0 0 64 64\" role=\"img\" aria-label=\"Larchmere Outfitters\" focusable=\"false\">\n      <circle className=\"m1ftr-s m1ftr-s1\" cx=\"32\" cy=\"32\" r=\"28\" pathLength=\"1\" transform=\"rotate(-90 32 32)\"/>\n      <path className=\"m1ftr-s m1ftr-s2\" d=\"M13 42L25 25L32 34L38.5 27L51 42\" pathLength=\"1\"/>\n      <path className=\"m1ftr-s m1ftr-s3\" d=\"M17 48.5C22 45.5 27 51 32 48.5S42 46 47 48\" pathLength=\"1\"/>\n    </svg>\n    <div className=\"m1ftr-name\">\n      <p className=\"m1ftr-w\">Larchmere Outfitters</p>\n      <p className=\"m1ftr-tag\">Walking boots, waxed jackets and repairs</p>\n    </div>\n  </div>\n  <nav className=\"m1ftr-cols\" aria-label=\"Footer\">\n    <div><h3>Shop</h3><ul><li><a href=\"#\">Boots</a></li><li><a href=\"#\">Outerwear</a></li><li><a href=\"#\">Maps</a></li></ul></div>\n    <div><h3>Visit</h3><ul><li><a href=\"#\">Opening times</a></li><li><a href=\"#\">Boot fitting</a></li></ul></div>\n    <div><h3>Help</h3><ul><li><a href=\"#\">Repairs</a></li><li><a href=\"#\">Contact</a></li></ul></div>\n  </nav>\n  <div className=\"m1ftr-legal\">\n    <address>2 Bridge End, Ambleside, Cumbria</address>\n    <span>Larchmere Outfitters Ltd</span>\n  </div>\n</footer>\n<button type=\"button\" className=\"m1ftr-replay\" aria-label=\"Replay logo animation\"><svg viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4.5 11a5.5 5.5 0 1 0 1.8-4.6\"/><path d=\"M5 3.2v3.6h3.6\"/></svg>Replay</button>\n    </section>\n  );\n}\n"}]}
