{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"paragraph-lines-sliding-up-from-a-mask","type":"registry:component","title":"Paragraph Lines Sliding Up from a Mask","description":"","dependencies":[],"files":[{"path":"components/we-inc/paragraph-lines-sliding-up-from-a-mask.tsx","type":"registry:component","content":"import { useEffect, useRef } from \"react\";\nimport type { CSSProperties } from \"react\";\n\nconst BUSINESS = \"Arden Vale Architects\";\nconst LINES = [\n  \"We design small buildings\",\n  \"for steep sites, tight budgets\",\n  \"and clients who mean\",\n  \"to stay for decades.\"\n];\nconst COPY = \"A four-person practice in the Calder valley. Houses, studios, a boathouse and one very good village hall.\";\n\nconst CSS = `\n/* Edit these first: colours, and how long one full cycle takes. */\n.ml-root {\n  --ml-bg: #ebe6dd;\n  --ml-ink: #24211d;\n  --ml-muted: #5b5248;\n  --ml-accent: #7a5a3a;\n  --ml-speed: 9s;\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(--ml-bg);\n  color: var(--ml-ink);\n  font-family: \"Iowan Old Style\", \"Palatino Linotype\", Palatino, Georgia, \"Times New Roman\", serif;\n  -webkit-font-smoothing: antialiased;\n}\n.ml-root *, .ml-root *::before, .ml-root *::after { box-sizing: border-box; }\n.ml-inner { position: relative; z-index: 1; width: 100%; max-width: 980px; }\n.ml-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(--ml-muted); }\n.ml-h { margin: 0; font-size: clamp(26px, 4.8vw, 62px); font-weight: 400; line-height: 1.14; letter-spacing: -.015em; }\n.ml-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(--ml-muted); }\n.ml-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.ml-w { display: inline-block; white-space: nowrap; }\n.ml-l { display: inline-block; }\n/* Paused while scrolled out of view (the script sets data-paused). */\n.ml-root[data-paused=\"true\"] *, .ml-root[data-paused=\"true\"] *::before, .ml-root[data-paused=\"true\"] *::after { animation-play-state: paused !important; }\n@media (prefers-reduced-motion: reduce) {\n  .ml-root *, .ml-root *::before, .ml-root *::after { animation: none !important; }\n}\n\n.ml-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }\n.ml-line:last-child { font-style: italic; color: var(--ml-accent); }\n.ml-in {\n  display: block;\n  animation: ml-up var(--ml-speed) cubic-bezier(.2, .8, .2, 1) infinite both;\n  animation-delay: calc(var(--i) * 140ms); /* gap between lines */\n}\n.ml-copy { border-top: 1px solid rgba(36, 33, 29, .18); padding-top: 22px; }\n@keyframes ml-up {\n  0% { transform: translateY(110%); }\n  12% { transform: translateY(0); }\n  86% { transform: translateY(0); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }\n  97%, 100% { transform: translateY(-110%); }\n}\n`;\n\nexport default function MaskedLineSlideUp() {\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=\"ml-root w-full\">\n      <style>{CSS}</style>\n      <div className=\"ml-inner\">\n        <p className=\"ml-eyebrow\">{BUSINESS}</p>\n        <h2 className=\"ml-h\">\n          <span className=\"ml-sr\">{LINES.join(\" \")}</span>\n          <span aria-hidden=\"true\">\n            {LINES.map((line, i) => (\n              <span key={line} className=\"ml-line\">\n                <span className=\"ml-in\" style={{ \"--i\": i } as CSSProperties}>\n                  {line}\n                </span>\n              </span>\n            ))}\n          </span>\n        </h2>\n        <p className=\"ml-copy\">{COPY}</p>\n      </div>\n    </section>\n  );\n}\n"}]}
