{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"geometric-block-mark-slides-together-in-hero-corner","type":"registry:component","title":"Geometric Block Mark Sliding Together","description":"","dependencies":[],"files":[{"path":"components/we-inc/geometric-block-mark-slides-together-in-hero-corner.tsx","type":"registry:component","content":"import { useEffect, useLayoutEffect, useRef } from \"react\";\n\n// Edit these first: the colours at the top of .m1blk and the slide distance in --m1blk-far.\nconst CSS = `\n.m1blk { --m1blk-bg: #eceeef; --m1blk-ink: #1f2a33; --m1blk-quiet: #4f5d68; --m1blk-line: #c5ccd1; --m1blk-focus: #b2552f; --m1blk-a: #1f2a33; --m1blk-b: #b2552f; --m1blk-c: #d8c4a1; --m1blk-d: #5d6e7a; --m1blk-far: 46px; }\n.m1blk { 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.m1blk *, .m1blk *::before, .m1blk *::after { box-sizing: border-box; }\n.m1blk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n.m1blk-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(--m1blk-line); border-radius: 999px; background: transparent; color: var(--m1blk-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }\n.m1blk-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.m1blk-replay:hover { color: var(--m1blk-ink); }\n.m1blk-replay:focus-visible { outline: 2px solid var(--m1blk-focus); outline-offset: 2px; }\n/* Reduced motion: no movement at all, the finished logo shows straight away. */\n@media (prefers-reduced-motion: reduce) {\n  .m1blk *, .m1blk *::before, .m1blk *::after { animation: none !important; transition: none !important; }\n  .m1blk-replay { display: none; }\n}\n\n.m1blk { min-height: 520px; padding: 24px clamp(20px, 5vw, 64px) 72px; background: var(--m1blk-bg); color: var(--m1blk-ink); }\n.m1blk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--m1blk-line); }\n.m1blk-word { font-weight: 700; font-size: 15px; letter-spacing: .01em; }\n.m1blk-nav { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.m1blk-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; color: var(--m1blk-quiet); font-size: 14px; text-decoration: none; border-radius: 4px; }\n.m1blk-nav a:hover { color: var(--m1blk-ink); }\n.m1blk a:focus-visible { outline: 2px solid var(--m1blk-focus); outline-offset: 2px; }\n.m1blk-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; max-width: 1100px; margin: 0 auto; padding-top: 56px; }\n.m1blk-eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--m1blk-quiet); }\n.m1blk-h { margin: 0; max-width: 13em; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.025em; font-weight: 700; }\n.m1blk-p { margin: 18px 0 26px; max-width: 30em; font-size: 16px; line-height: 1.6; color: var(--m1blk-quiet); }\n.m1blk-btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; background: var(--m1blk-ink); color: #f4f5f6; border-radius: 3px; font-weight: 600; font-size: 15px; text-decoration: none; }\n.m1blk-corner { justify-self: end; width: min(100%, 300px); aspect-ratio: 1; display: grid; place-items: center; }\n.m1blk-mark { width: 100%; height: auto; overflow: visible; }\n.m1blk-mark > * { transform-box: fill-box; transform-origin: center; }\n.m1blk-p1 { fill: var(--m1blk-a); }\n.m1blk-p2 { fill: var(--m1blk-b); }\n.m1blk-p3 { fill: var(--m1blk-c); }\n.m1blk-p4 { fill: var(--m1blk-d); }\n.m1blk-p5 { fill: var(--m1blk-bg); }\n@media (max-width: 720px) {\n  .m1blk-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }\n  .m1blk-corner { order: -1; justify-self: start; width: 120px; }\n}\n@media (prefers-reduced-motion: no-preference) {\n  .m1blk.is-js:not([data-run]) .m1blk-mark > * { opacity: 0; }\n}\n.m1blk[data-run] .m1blk-p1 { animation: m1blk-in1 .8s cubic-bezier(.2, .8, .2, 1) .05s both; }\n.m1blk[data-run] .m1blk-p2 { animation: m1blk-in2 .8s cubic-bezier(.2, .8, .2, 1) .17s both; }\n.m1blk[data-run] .m1blk-p3 { animation: m1blk-in3 .8s cubic-bezier(.2, .8, .2, 1) .29s both; }\n.m1blk[data-run] .m1blk-p4 { animation: m1blk-in4 .8s cubic-bezier(.2, .8, .2, 1) .41s both; }\n.m1blk[data-run] .m1blk-p5 { animation: m1blk-pop .5s cubic-bezier(.2, .8, .2, 1) .95s both; }\n@keyframes m1blk-in1 { from { opacity: 0; transform: translate(calc(var(--m1blk-far) * -1), 0); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }\n@keyframes m1blk-in2 { from { opacity: 0; transform: translate(0, calc(var(--m1blk-far) * -1)); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }\n@keyframes m1blk-in3 { from { opacity: 0; transform: translate(0, var(--m1blk-far)); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }\n@keyframes m1blk-in4 { from { opacity: 0; transform: translate(var(--m1blk-far), 0); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }\n@keyframes m1blk-pop { from { opacity: 0; transform: scale(.2); } 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 GeometricBlockMarkSlidesTogetherIn() {\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(\".m1blk-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=\"m1blk\">\n      <style>{CSS}</style>\n<header className=\"m1blk-top\">\n  <span className=\"m1blk-word\">Pellow Stoneworks</span>\n  <nav aria-label=\"Main\"><ul className=\"m1blk-nav\"><li><a href=\"#\">Work</a></li><li><a href=\"#\">Yard</a></li><li><a href=\"#\">Contact</a></li></ul></nav>\n</header>\n<div className=\"m1blk-hero\">\n  <div className=\"m1blk-copy\">\n    <p className=\"m1blk-eyebrow\">Masonry workshop, Penryn</p>\n    <h2 className=\"m1blk-h\">Steps, sills and hearths cut to your drawings.</h2>\n    <p className=\"m1blk-p\">Bring a sketch or a set of plans. We template on site, cut in the yard and fit it ourselves.</p>\n    <a className=\"m1blk-btn\" href=\"#\">Book a site visit</a>\n  </div>\n  <div className=\"m1blk-corner\">\n    <svg className=\"m1blk-mark\" viewBox=\"0 0 100 100\" role=\"img\" aria-label=\"Pellow Stoneworks mark\" focusable=\"false\">\n      <rect className=\"m1blk-p1\" x=\"4\" y=\"4\" width=\"44\" height=\"44\" rx=\"2\"/>\n      <path className=\"m1blk-p2\" d=\"M52 48V4A44 44 0 0 1 96 48Z\"/>\n      <path className=\"m1blk-p3\" d=\"M48 52V96A44 44 0 0 1 4 52Z\"/>\n      <rect className=\"m1blk-p4\" x=\"52\" y=\"52\" width=\"44\" height=\"44\" rx=\"2\"/>\n      <rect className=\"m1blk-p5\" x=\"64\" y=\"64\" width=\"20\" height=\"20\" rx=\"1\"/>\n    </svg>\n  </div>\n</div>\n<button type=\"button\" className=\"m1blk-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"}]}
