{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"letterpress-footer-closing-line-leans-toward-pointer","type":"registry:block","title":"Letterpress Footer With Leaning Closing Line","description":"","dependencies":[],"files":[{"path":"components/we-inc/letterpress-footer-closing-line-leans-toward-pointer.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\nimport type { CSSProperties } from \"react\";\n\nconst LEAN = 20; // how far each letter tips, in degrees\nconst SHIFT = 7; // how far each letter slides, in px\nconst EASE = 0.1; // smoothing: lower is lazier\n\n// Same markup, styles and script as the plain HTML version.\nconst STYLES = `\n/* Change these: background, text, muted text, rule colour, accent (links' focus ring and highlights). */\n  .w4len { --w4len-bg: #14161a; --w4len-ink: #ece6dc; --w4len-muted: #aaa398; --w4len-line: #2c2f35; --w4len-accent: #e2b47c; }\n  .w4len { position: relative; overflow: hidden; background: var(--w4len-bg); color: var(--w4len-ink); font-family: ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif; padding: 72px clamp(20px, 4vw, 56px) 24px; }\n  .w4len *, .w4len *::before, .w4len *::after { box-sizing: border-box; }\n  .w4len-in { max-width: 1240px; margin: 0 auto; }\n  .w4len-top { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px 40px; }\n  .w4len-brand { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }\n  .w4len-blurb { margin: 12px 0 0; max-width: 32ch; font-size: 15px; line-height: 1.6; color: var(--w4len-muted); }\n  .w4len-addr { margin: 16px 0 0; font-style: normal; font-size: 14px; line-height: 1.65; color: var(--w4len-muted); }\n  .w4len-col h2 { margin: 0 0 6px; font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--w4len-muted); }\n  .w4len-col ul, .w4len-legal ul { list-style: none; margin: 0; padding: 0; }\n  .w4len-col a, .w4len-legal a { display: inline-flex; align-items: center; min-height: 40px; color: inherit; text-decoration: none; font-size: 15px; border-radius: 3px; }\n  .w4len-col a:hover, .w4len-legal a:hover { text-decoration: underline; text-underline-offset: 4px; }\n  .w4len a:focus-visible { outline: 2px solid var(--w4len-accent); outline-offset: 3px; }\n  .w4len-big { container-type: inline-size; margin: 56px 0 0; }\n  .w4len-legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 24px; margin-top: 24px; padding-top: 6px; border-top: 1px solid var(--w4len-line); font-size: 13px; color: var(--w4len-muted); }\n  .w4len-legal p { margin: 10px 0; }\n  .w4len-legal ul { display: flex; flex-wrap: wrap; gap: 0 20px; }\n  .w4len-legal a { font-size: 13px; }\n  .w4len-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n  @media (max-width: 760px) {\n    .w4len { padding-top: 56px; }\n    .w4len-top { grid-template-columns: 1fr 1fr; gap: 24px 20px; }\n    .w4len-lead { grid-column: 1 / -1; }\n  }\n  /* Change this: size of the closing line (cqi of the footer width). */\n  .w4len { --w4len-size: 22.5cqi; }\n  .w4len-big { margin-top: 0; margin-bottom: 48px; }\n  .w4len-kicker { margin: 0 0 4px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--w4len-accent); }\n  .w4len-head { margin: 0; font-weight: 400; }\n  .w4len-line { position: relative; display: block; white-space: nowrap; overflow: hidden; font-family: \"Iowan Old Style\", \"Palatino Linotype\", Palatino, \"Book Antiqua\", Georgia, serif; font-style: italic; font-size: var(--w4len-size); line-height: 1.12; letter-spacing: -.035em; padding: 0 .06em; }\n  .w4len-l { display: inline-block; transform-origin: 50% 88%; will-change: transform; }\n  .w4len-mail { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--w4len-ink); font-size: clamp(17px, 2.2vw, 22px); text-decoration: underline; text-decoration-color: var(--w4len-accent); text-underline-offset: 6px; border-radius: 3px; }\n  .w4len-mail:hover { color: var(--w4len-accent); }\n  @media (prefers-reduced-motion: reduce) { .w4len-l { transform: none !important; will-change: auto; } }\n`;\n\nexport default function LetterpressFooterClosingLineLeans() {\n  const ref = useRef<HTMLElement>(null);\n  useEffect(() => {\n    const root: any = ref.current;\n    if (!root) return;\n    if (matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    var line = root.querySelector(\".w4len-line\");\n    var ls = [].slice.call(root.querySelectorAll(\".w4len-l\"));\n    var cur = ls.map(function () { return 0; });\n    var px = 0, live = false, frame = 0;\n    function tick(t) {\n      var w = line.offsetWidth;\n      /* idle demo: an imaginary pointer drifts along the line until a real mouse arrives */\n      var x = live ? px : w * (0.5 + 0.42 * Math.sin(t / 2300));\n      for (var i = 0; i < ls.length; i++) {\n        var el = ls[i], d = (x - el.offsetLeft - el.offsetWidth / 2) / w;\n        var s = Math.max(-1, Math.min(1, d * 4)) * Math.exp(-d * d * 7);\n        cur[i] += (s - cur[i]) * EASE;\n        el.style.transform = \"translateX(\" + (cur[i] * SHIFT).toFixed(2) + \"px) skewX(\" + (-cur[i] * LEAN).toFixed(2) + \"deg)\";\n      }\n      frame = requestAnimationFrame(tick);\n    }\n    function move(e) {\n      if (e.pointerType !== \"mouse\") return;\n      live = true;\n      px = e.clientX - line.getBoundingClientRect().left;\n    }\n    function leave() { live = false; }\n    var io = new IntersectionObserver(function (en) {\n      cancelAnimationFrame(frame); frame = 0;\n      if (en[0].isIntersecting) frame = requestAnimationFrame(tick);\n    });\n    io.observe(root);\n    root.addEventListener(\"pointermove\", move);\n    root.addEventListener(\"pointerleave\", leave);\n    return function () {\n      cancelAnimationFrame(frame); io.disconnect();\n      root.removeEventListener(\"pointermove\", move);\n      root.removeEventListener(\"pointerleave\", leave);\n    };\n  }, []);\n\n  return (\n    <footer className=\"w4len\" ref={ref}>\n      <style>{STYLES}</style>\n      <div className=\"w4len-in\">\n        <div className=\"w4len-big\">\n          <p className=\"w4len-kicker\">Have something to print?</p>\n          <h2 className=\"w4len-head\">\n            <span className=\"w4len-sr\">Write to us</span>\n            <span className=\"w4len-line\" aria-hidden=\"true\">\n              {\"write to us\".split(\"\").map((c, i) => (\n                <span key={i} className=\"w4len-l\" style={{ \"--i\": i } as CSSProperties}>{c === \" \" ? \"\\u00a0\" : c}</span>\n              ))}\n            </span>\n          </h2>\n          <a className=\"w4len-mail\" href=\"#\">press@quillandhollis.studio</a>\n        </div>\n        <div className=\"w4len-top\">\n          <div className=\"w4len-lead\">\n            <p className=\"w4len-brand\">Quill &amp; Hollis</p>\n            <p className=\"w4len-blurb\">\n              A two-press letterpress studio printing wedding suites, book covers and the odd stubborn poster.\n            </p>\n            <address className=\"w4len-addr\">\n              Unit 3, Ropewalk Yard, Leith\n              <br />\n              Studio visits by appointment\n              <br />\n              0131 496 0582\n            </address>\n          </div>\n          <div className=\"w4len-col\">\n            <h2>Print</h2>\n            <ul>\n              <li>\n                <a href=\"#\">Wedding stationery</a>\n              </li>\n              <li>\n                <a href=\"#\">Business cards</a>\n              </li>\n              <li>\n                <a href=\"#\">Book jackets</a>\n              </li>\n              <li>\n                <a href=\"#\">Posters</a>\n              </li>\n            </ul>\n          </div>\n          <div className=\"w4len-col\">\n            <h2>Studio</h2>\n            <ul>\n              <li>\n                <a href=\"#\">Our presses</a>\n              </li>\n              <li>\n                <a href=\"#\">Paper library</a>\n              </li>\n              <li>\n                <a href=\"#\">Workshops</a>\n              </li>\n            </ul>\n          </div>\n          <div className=\"w4len-col\">\n            <h2>Elsewhere</h2>\n            <ul>\n              <li>\n                <a href=\"#\">Newsletter</a>\n              </li>\n              <li>\n                <a href=\"#\">Instagram</a>\n              </li>\n              <li>\n                <a href=\"#\">Print fairs</a>\n              </li>\n            </ul>\n          </div>\n        </div>\n        <div className=\"w4len-legal\">\n          <p>© 2026 Quill &amp; Hollis Letterpress. Printed on cotton stock.</p>\n          <ul>\n            <li>\n              <a href=\"#\">Privacy</a>\n            </li>\n            <li>\n              <a href=\"#\">Terms</a>\n            </li>\n            <li>\n              <a href=\"#\">Accessibility</a>\n            </li>\n          </ul>\n        </div>\n      </div>\n    </footer>\n  );\n}\n"}]}
