{
  "id": "scroll-mask-title-reveal",
  "kind": "element",
  "title": "Scroll mask reveal with moving title",
  "summary": "Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.",
  "url": "https://enrichr.dev/elements/scroll-mask-title-reveal.html",
  "section": "page",
  "techniques": [
    "scroll-driven",
    "reveal"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "editorial",
    "cinematic",
    "polished"
  ],
  "intents": [
    "scroll reveal image through growing mask",
    "svg displacement filter mask reveal",
    "on scroll title flip layout",
    "rough edge circle reveal on scroll",
    "scroll linked text and image reveal"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "shape",
      "label": "Mask shape",
      "type": "select",
      "options": [
        [
          "circle",
          "Circle"
        ],
        [
          "square",
          "Rectangle"
        ]
      ],
      "value": "circle"
    },
    {
      "key": "roughness",
      "label": "Edge roughness",
      "type": "range",
      "min": 0,
      "max": 80,
      "step": 2,
      "value": 50
    },
    {
      "key": "noise",
      "label": "Noise detail",
      "type": "range",
      "min": 0.005,
      "max": 0.12,
      "step": 0.005,
      "value": 0.03
    },
    {
      "key": "brighten",
      "label": "Brighten",
      "type": "range",
      "min": 0,
      "max": 1,
      "step": 0.05,
      "value": 0.6
    }
  ],
  "license": "Free to use in personal and client projects during the preview. Final licence terms will be published here before any paid tier starts; ask before reselling the code as a collection.",
  "contract": "function mount(root, opts) -> { update(partialOpts), destroy() }; root must contain the element markup",
  "exports": {
    "claude": "Add the \"Scroll mask reveal with moving title\" element to this project.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSteps:\n1. Look at the project first to see its framework and where components, styles and static files live. Follow its conventions.\n2. Fetch https://enrichr.dev/elements/scroll-mask-title-reveal.json if you can read URLs (fields: source.markup, source.css, source.js, params); otherwise use the source at the end of this message.\n3. Add the files, mount it where I tell you (default: the top of the home page), and pass the settings below as the opts.\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n5. Run the dev server and check it. with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "chatgpt": "I want the \"Scroll mask reveal with moving title\" element on my website. Below is its complete source. Please:\n1. Build one self-contained index.html that I can open locally to see it working (put the CSS in a <style> tag and the JavaScript in a <script> tag, with the markup in the body).\n2. Then explain, step by step, which parts go where in my own site, and how to mount it. My stack is: [tell me yours, or say \"plain HTML\"].\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "cursor": "Add the \"Scroll mask reveal with moving title\" element to this codebase.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nUse Composer / agent mode. First search the repo for how components, styles and scripts are organised, then add the files in the matching places, mount it on the page I name, and run the app to confirm it works. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nOptional: save this as .cursor/rules/enrichr-scroll-mask-title-reveal.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Scroll mask reveal with moving title element\nalwaysApply: false\n---\nmount(root, opts) expects the element markup inside root and returns { update, destroy }. Always call destroy() on unmount and never edit the ef- class names.",
    "v0": "Create a Next.js (App Router) client component for the \"Scroll mask reveal with moving title\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- scroll-mask-title-reveal.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nUse this component as the wrapper (adjust the import paths):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./scroll-mask-title-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollMaskTitleReveal(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRender it on the home page so I can see it. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "lovable": "Add the \"Scroll mask reveal with moving title\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- scroll-mask-title-reveal.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nWrapper component (src/components/ScrollMaskTitleReveal.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./scroll-mask-title-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollMaskTitleReveal(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRemove the \"use client\" line if it is not needed. Show it on the home page. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "bolt": "Create a small Vite project (vanilla JavaScript, no framework unless I already have one) that shows the \"Scroll mask reveal with moving title\" element.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, then a script tag), style.css (the CSS below), scroll-mask-title-reveal.js (the JavaScript below) and main.js that sets the container's innerHTML to the markup and calls mount(container, opts) with the settings below. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "replit": "Create a new HTML, CSS and JavaScript Repl that shows the \"Scroll mask reveal with moving title\" element. No packages, no server code.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, link style.css, load scroll-mask-title-reveal.js and then main.js), style.css (the CSS below), scroll-mask-title-reveal.js (the JavaScript below), main.js (sets the container's innerHTML to the markup, then calls mount(container, opts) with the settings below). Press Run to preview. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "figma": "Designer handoff notes for the \"Scroll mask reveal with moving title\" element (Enrichr Library). Figma cannot run this JavaScript inside a design file, so use it as a motion reference and hand the code to a developer.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nWhat it does: A vanilla port, no GSAP, Flip or ScrollTrigger. Each section is tall with a sticky stage, and the section's scroll progress from 0 to 1 is read from the element's own scrollTop and smoothed with a lerp. The title is laid out in its final spread-out position; the script measures where a centred line would sit and replays the difference as a transform that shrinks to zero with progress, which is a hand-made FLIP. The artwork sits inside an SVG mask whose circle or rectangle grows with progress, and an feTurbulence plus feDisplacementMap filter on the mask shape roughens its edge. The art also zooms slightly and a cream overlay brightens it.\nAccessibility: The scroller is focusable and scrolls with the usual keys, since it is a native overflow container. The titles are real headings and captions stay in the DOM. The artwork is decorative and hidden from assistive tech. Reduced motion removes smoothing and sets the edge roughness to zero, so the mask grows with a clean edge only while the user scrolls.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Mask shape: select (Circle / Rectangle), default circle\n- Edge roughness: range 0 to 80, step 2, default 50\n- Noise detail: range 0.005 to 0.12, step 0.005, default 0.03\n- Brighten: range 0 to 1, step 0.05, default 0.6\n\nCurrent settings:\n{{SETTINGS}}\n\nFor the developer: Element contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nIn Figma:\n- Draw the resting state as a frame and the end state as a second frame; link them with Smart Animate to show the motion in a prototype.\n- Put the settings above in the frame's notes or Dev Mode annotations so the developer matches them.\n- Link https://enrichr.dev/elements/scroll-mask-title-reveal.html in the handoff: the live demo and the copy-ready code are there. Developers can paste the prompts for Claude, Cursor or v0 from the Export menu.\nNothing is copied from another designer's file; this is original code from Enrichr.",
    "framer": "Add the \"Scroll mask reveal with moving title\" element to Framer as a code component. Framer code components are React, so wrap the vanilla code like this. Check it in the Framer editor, as Framer's component API can change.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. In Framer: Assets > Code > New component. Name it ScrollMaskTitleReveal.\n2. Paste the JavaScript below into a separate code file named scroll-mask-title-reveal.js in the same project, with  export { mount };  and  export const markup = \"<the markup string>\";  added. Put the CSS into the component as a <style> tag.\n3. Component:\n```tsx\nimport { addPropertyControls, ControlType } from \"framer\"\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./scroll-mask-title-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollMaskTitleReveal(props: any) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n\naddPropertyControls(ScrollMaskTitleReveal, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  shape: { type: ControlType.Enum, title: \"Mask shape\", options: [\"circle\",\"square\"], optionTitles: [\"Circle\",\"Rectangle\"], defaultValue: \"circle\" },\n  roughness: { type: ControlType.Number, title: \"Edge roughness\", min: 0, max: 80, step: 2, defaultValue: 50 },\n  noise: { type: ControlType.Number, title: \"Noise detail\", min: 0.005, max: 0.12, step: 0.005, defaultValue: 0.03 },\n  brighten: { type: ControlType.Number, title: \"Brighten\", min: 0, max: 1, step: 0.05, defaultValue: 0.6 },\n})\n```\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "webflow": "Add the \"Scroll mask reveal with moving title\" element to a Webflow site with an Embed element. Test it on the published or preview site: scripts in embeds may not run inside the Designer canvas.\n\nThis is the \"Scroll mask reveal with moving title\" element from the Enrichr Library: Scrolling a section glides a two-word title into its layout position while an SVG mask with a rough noise-displaced edge grows and reveals the artwork.\nPage: https://enrichr.dev/elements/scroll-mask-title-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-mask-title-reveal.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. Add an Embed element where it should appear. Paste a <style> block with the CSS, one container <div id=\"enrichr-scroll-mask-title-reveal\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-scroll-mask-title-reveal\"), { ...your settings... });\n   (set the container's innerHTML to the markup first, as in the contract).\n2. Embed elements have a size limit (check Webflow's current number). If the code is longer, host the JS and CSS as files and link them from Custom code in the page settings, then keep only the container and the mount call in the Embed.\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}"
  },
  "exportTools": [
    "claude",
    "chatgpt",
    "cursor",
    "v0",
    "lovable",
    "bolt",
    "replit",
    "figma",
    "framer",
    "webflow"
  ],
  "accessibility": "The scroller is focusable and scrolls with the usual keys, since it is a native overflow container. The titles are real headings and captions stay in the DOM. The artwork is decorative and hidden from assistive tech. Reduced motion removes smoothing and sets the edge roughness to zero, so the mask grows with a clean edge only while the user scrolls.",
  "performance": "Per frame there are a few attribute writes per section and the SVG filter runs on the small mask shape only. Roughness and noise detail cost more at large sizes; lower noise octaves or roughness if you scale the artwork to full screen.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/VYpqBod",
  "source": {
    "markup": "<div class=\"ef-smt\">\n  <svg class=\"ef-smt__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\">\n    <defs>\n      <symbol id=\"ef-smt-p1\" viewBox=\"1513.7 1453.9 322.3 322.3\"><path fill=\"currentColor\" d=\"M1821 1761.2h-292.3v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5.1 7.8 8.6 19.7 13.6 32.7 11.9 16.8-2.3 30.1-16 32-32.7 2.5-22.6-15.1-41.6-37.1-41.6-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.4-14.5-14.4v-111.7h292.3v111.7c0 8-6.4 14.4-14.5 14.4-4.2 0-8.1-1.8-10.9-5-7.9-8.6-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.6 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5z\"/></symbol>\n      <symbol id=\"ef-smt-p4\" viewBox=\"1423.36 860.8 503.07 322.3\"><path fill=\"currentColor\" d=\"M1821 875.8v111.6c0 8 6.5 14.5 14.5 14.5 4.2 0 8.1-1.9 10.9-5 6.8-7.5 16.7-12.3 27.7-12.3 22 0 39.6 19 37.1 41.6-1.9 16.7-15.2 30.5-32 32.7-13 1.7-24.8-3.3-32.7-11.9-2.8-3.2-6.8-5-11-5-8 0-14.5 6.4-14.5 14.4v111.7h-111.6c-8 0-14.5-6.5-14.5-14.5 0-4.2 1.9-8.2 5-11 8.7-7.9 13.7-19.7 12-32.7-2.3-16.8-16-30.1-32.8-32-22.5-2.5-41.5 15.1-41.5 37.1 0 11 4.7 20.9 12.3 27.7 3.1 2.8 4.9 6.7 4.9 10.8v0.1c0 8-6.4 14.5-14.5 14.5h-111.6v-111.7c0-8-6.4-14.4-14.5-14.4-4.1 0-8 1.8-10.8 4.9-6.9 7.6-16.7 12.3-27.7 12.3-22 0-39.6-19-37.1-41.6 1.9-16.7 15.2-30.4 32-32.7 13-1.7 24.8 3.3 32.7 11.9 2.8 3.2 6.7 5.1 10.9 5.1 8.1 0 14.5-6.5 14.5-14.5v-111.6z\"/></symbol>\n      <symbol id=\"ef-smt-p8\" viewBox=\"1513.7 166.86 322.3 503.06\"><path fill=\"currentColor\" d=\"M1528.7 564.5v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5 7.8 8.7 19.7 13.7 32.7 11.9 16.8-2.2 30.1-15.9 32-32.7 2.5-22.5-15.1-41.5-37.1-41.5-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.5-14.5-14.5v-111.6h111.6c8.1 0 14.5-6.5 14.5-14.5 0-4.1-1.8-8.1-4.9-10.9-7.6-6.8-12.3-16.6-12.3-27.6 0-22 19-39.6 41.5-37.1 16.8 1.8 30.5 15.2 32.8 32 1.7 12.9-3.3 24.8-12 32.7-3.1 2.8-5 6.7-5 10.9 0 8 6.5 14.5 14.5 14.5h111.6v111.6c0 8-6.4 14.5-14.5 14.5-4.2 0-8.1-1.9-10.9-5-7.9-8.7-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.5 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5v111.6h-111.6c-8 0-14.5 6.5-14.5 14.5 0 4.2 1.9 8.1 5 10.9 7.5 6.8 12.3 16.7 12.3 27.7 0 22-19 39.5-41.6 37.1-16.8-1.9-30.5-15.3-32.7-32-1.7-13 3.3-24.9 11.9-32.7 3.1-2.9 5-6.8 5-11 0-8-6.4-14.5-14.5-14.5z\"/></symbol>\n    </defs>\n  </svg>\n  <div class=\"ef-smt__view\" tabindex=\"0\" role=\"region\" aria-label=\"Scroll to reveal each image through a rough circular mask\"></div>\n  <div class=\"ef-smt__hint\" aria-hidden=\"true\"><span></span>Scroll</div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/OnScrollFilter (MIT) — Copyright (c) 2009 - 2022 [Codrops](https://tympanus.net/codrops) */\n.ef-smt { position: relative; width: 100%; height: 100%; min-height: 18rem; overflow: hidden; container-type: inline-size; background: #0c1e18; color: #fbf8f1; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n.ef-smt__defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.ef-smt__view { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; outline: none; }\n.ef-smt__view::-webkit-scrollbar { display: none; }\n.ef-smt__view:focus-visible { box-shadow: inset 0 0 0 3px var(--ef-acc, #e6ff55); }\n.ef-smt__sec { position: relative; height: calc(var(--ef-h, 400px) * 2.3); }\n.ef-smt__sec + .ef-smt__sec { margin-top: 0; }\n.ef-smt__stage { position: sticky; top: 0; height: var(--ef-h, 400px); box-sizing: border-box; padding: 6% 7% 5%; display: flex; flex-direction: column; gap: 3%; overflow: hidden; }\n.ef-smt__title { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-size: clamp(1.8rem, 10cqi, 4.2rem); line-height: 0.95; font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; }\n.ef-smt__title span { display: inline-block; will-change: transform; }\n.ef-smt__title span:last-child { color: var(--ef-acc, #e6ff55); }\n.ef-smt__art-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }\n.ef-smt__art { display: block; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 0.7rem; background: rgba(251, 248, 241, 0.05); box-shadow: inset 0 0 0 1px rgba(251, 248, 241, 0.14); }\n.ef-smt__cap { margin: 0; font-size: 0.82rem; line-height: 1.35; max-width: 34ch; opacity: 0.85; align-self: center; text-align: center; }\n.ef-smt__hint { position: absolute; left: 50%; bottom: 0.7rem; transform: translateX(-50%); display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem; border-radius: 99px; background: rgba(12, 30, 24, 0.82); color: #fbf8f1; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; pointer-events: none; transition: opacity 400ms; }\n.ef-smt__hint span { width: 6px; height: 6px; border-radius: 50%; background: var(--ef-acc, #e6ff55); }\n.ef-smt__hint.is-gone { opacity: 0; }\n@media (prefers-reduced-motion: reduce) {\n  .ef-smt__title span { will-change: auto; }\n  .ef-smt__hint { transition: none; }\n}",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/OnScrollFilter (MIT) — Copyright (c) 2009 - 2022 [Codrops](https://tympanus.net/codrops)\n// Scroll mask title reveal: as you scroll a section, a two-word title glides from a centred line to its spread-out layout position\n// (a hand-made FLIP, measured then replayed with transforms) while an SVG mask grows from nothing and reveals the artwork through a rough,\n// noise-displaced edge. Own scroll container, scroll-linked and smoothed with a lerp, no libraries. Reduced motion: no smoothing, no roughness.\n// mount(root, { accent, shape (\"circle\" | \"square\"), roughness (0-80), noise (0.005-0.12), brighten (0-1) })\nfunction mount(root, o) {\n  mount.n = (mount.n || 0) + 1;\n  var uid = \"ef-smt-\" + mount.n;\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var view = root.querySelector(\".ef-smt__view\");\n  var hint = root.querySelector(\".ef-smt__hint\");\n  var NS = \"http://www.w3.org/2000/svg\";\n  var opts = {}, secs = [], cur = 0, tgt = 0, raf = 0, last = 0, H = 400, ro = null, destroyed = false, offs = [];\n  var DATA = [\n    [\"Green\", \"House\", \"Light pours through a quiet room of leaves, one pane at a time.\"],\n    [\"Slow\", \"Burn\", \"A single ember keeps the whole evening warm and unhurried.\"],\n    [\"Deep\", \"Field\", \"Open ground, long grass, and a horizon that never quite arrives.\"]\n  ];\n\n  function el(name, attrs, parent) {\n    var n = document.createElementNS(NS, name);\n    for (var k in attrs) n.setAttribute(k, attrs[k]);\n    if (parent) parent.appendChild(n);\n    return n;\n  }\n  function clamp(v, a, b) { return v < a ? a : v > b ? b : v; }\n  function art(i) {\n    var P = [\"p4\", \"p1\", \"p8\"][i], a = opts.accent;\n    var cols = [[\"#005236\", \"#0c1e18\", a], [\"#c6f26b\", \"#2f7d5b\", \"#0c1e18\"], [\"#fbf8f1\", \"#c6f26b\", \"#0a6b46\"]][i];\n    var svg = el(\"svg\", { \"class\": \"ef-smt__art\", viewBox: \"0 0 400 300\", \"aria-hidden\": \"true\", focusable: \"false\" });\n    var defs = el(\"defs\", {}, svg);\n    var gr = el(\"linearGradient\", { id: uid + \"-g\" + i, x1: \"0\", y1: \"0\", x2: \"1\", y2: \"1\" }, defs);\n    el(\"stop\", { offset: \"0\", \"stop-color\": cols[0] }, gr); el(\"stop\", { offset: \"1\", \"stop-color\": cols[1] }, gr);\n    var f = el(\"filter\", { id: uid + \"-f\" + i, filterUnits: \"userSpaceOnUse\", x: \"-120\", y: \"-120\", width: \"640\", height: \"540\" }, defs);\n    var turb = el(\"feTurbulence\", { type: \"fractalNoise\", baseFrequency: \"0.03\", numOctaves: \"3\", result: \"n\" }, f);\n    var disp = el(\"feDisplacementMap\", { \"in\": \"SourceGraphic\", in2: \"n\", scale: \"50\", xChannelSelector: \"R\", yChannelSelector: \"G\" }, f);\n    var mk = el(\"mask\", { id: uid + \"-m\" + i, maskUnits: \"userSpaceOnUse\", x: \"-120\", y: \"-120\", width: \"640\", height: \"540\" }, defs);\n    var shape = el(\"g\", { filter: \"url(#\" + uid + \"-f\" + i + \")\" }, mk);\n    var circ = el(\"circle\", { cx: \"200\", cy: \"150\", r: \"0\", fill: \"#fff\" }, shape);\n    var sq = el(\"rect\", { x: \"200\", y: \"150\", width: \"0\", height: \"0\", fill: \"#fff\" }, shape);\n    var g = el(\"g\", { mask: \"url(#\" + uid + \"-m\" + i + \")\" }, svg);\n    var zoom = el(\"g\", {}, g);\n    el(\"rect\", { x: \"0\", y: \"0\", width: \"400\", height: \"300\", fill: \"url(#\" + uid + \"-g\" + i + \")\" }, zoom);\n    var u = el(\"use\", { href: \"#ef-smt-\" + P, x: \"70\", y: \"20\", width: \"260\", height: \"260\", style: \"color:\" + cols[2] }, zoom);\n    if (P === \"p4\") { u.setAttribute(\"x\", \"50\"); u.setAttribute(\"y\", \"75\"); u.setAttribute(\"width\", \"300\"); u.setAttribute(\"height\", \"150\"); }\n    if (P === \"p8\") { u.setAttribute(\"x\", \"125\"); u.setAttribute(\"y\", \"10\"); u.setAttribute(\"width\", \"150\"); u.setAttribute(\"height\", \"280\"); }\n    var br = el(\"rect\", { x: \"0\", y: \"0\", width: \"400\", height: \"300\", fill: \"#fbf8f1\", opacity: \"0\" }, g);\n    return { svg: svg, turb: turb, disp: disp, circ: circ, sq: sq, zoom: zoom, br: br };\n  }\n  function build() {\n    view.textContent = \"\"; secs = [];\n    for (var i = 0; i < DATA.length; i++) {\n      var d = DATA[i];\n      var sec = document.createElement(\"section\"); sec.className = \"ef-smt__sec\";\n      var st = document.createElement(\"div\"); st.className = \"ef-smt__stage\";\n      var h = document.createElement(\"h2\"); h.className = \"ef-smt__title\";\n      var a = document.createElement(\"span\"); a.textContent = d[0];\n      var b = document.createElement(\"span\"); b.textContent = d[1];\n      h.appendChild(a); h.appendChild(b);\n      var wrap = document.createElement(\"div\"); wrap.className = \"ef-smt__art-wrap\";\n      var ar = art(i); wrap.appendChild(ar.svg);\n      var cap = document.createElement(\"p\"); cap.className = \"ef-smt__cap\"; cap.textContent = d[2];\n      st.appendChild(h); st.appendChild(wrap); st.appendChild(cap); sec.appendChild(st); view.appendChild(sec);\n      secs.push({ sec: sec, stage: st, a: a, b: b, cap: cap, ar: ar, ax: 0, ay: 0, bx: 0, by: 0 });\n    }\n    applyFx();\n    measure();\n  }\n  function applyFx() {\n    var rough = reduce ? 0 : opts.roughness;\n    secs.forEach(function (s) {\n      s.ar.turb.setAttribute(\"baseFrequency\", String(opts.noise));\n      s.ar.disp.setAttribute(\"scale\", String(rough));\n      s.ar.br.setAttribute(\"fill\", \"#fbf8f1\");\n      s.ar.circ.style.display = opts.shape === \"square\" ? \"none\" : \"\";\n      s.ar.sq.style.display = opts.shape === \"square\" ? \"\" : \"none\";\n    });\n  }\n  function measure() {\n    var h = view.clientHeight;\n    if (h < 40) return;\n    H = h; view.style.setProperty(\"--ef-h\", H + \"px\");\n    secs.forEach(function (s) {\n      s.a.style.transform = \"none\"; s.b.style.transform = \"none\";\n      var sr = s.stage.getBoundingClientRect(), ra = s.a.getBoundingClientRect(), rb = s.b.getBoundingClientRect();\n      var gap = parseFloat(getComputedStyle(s.a).fontSize) * 0.3;\n      var total = ra.width + gap + rb.width;\n      var x0 = (sr.width - total) / 2, y0 = (sr.height - ra.height) / 2;\n      s.ax = sr.left + x0 - ra.left; s.ay = sr.top + y0 - ra.top;\n      s.bx = sr.left + x0 + ra.width + gap - rb.left; s.by = sr.top + y0 - rb.top;\n    });\n    render();\n  }\n  function render() {\n    var top = cur;\n    var sh = opts.shape === \"square\";\n    secs.forEach(function (s) {\n      var range = s.sec.offsetHeight - H;\n      var p = range > 0 ? clamp((top - s.sec.offsetTop) / range, 0, 1) : 0;\n      var q = 1 - p;\n      s.a.style.transform = \"translate3d(\" + (s.ax * q).toFixed(2) + \"px,\" + (s.ay * q).toFixed(2) + \"px,0)\";\n      s.b.style.transform = \"translate3d(\" + (s.bx * q).toFixed(2) + \"px,\" + (s.by * q).toFixed(2) + \"px,0)\";\n      var e = p;\n      var r = e * 265;\n      if (sh) { var w = e * 460, hh = e * 345; s.ar.sq.setAttribute(\"x\", (200 - w / 2).toFixed(1)); s.ar.sq.setAttribute(\"y\", (150 - hh / 2).toFixed(1)); s.ar.sq.setAttribute(\"width\", w.toFixed(1)); s.ar.sq.setAttribute(\"height\", hh.toFixed(1)); }\n      else s.ar.circ.setAttribute(\"r\", r.toFixed(1));\n      var z = 1 + 0.15 * e;\n      s.ar.zoom.setAttribute(\"transform\", \"translate(200 150) scale(\" + z.toFixed(4) + \") translate(-200 -150)\");\n      s.ar.br.setAttribute(\"opacity\", (opts.brighten * 0.35 * e).toFixed(3));\n      s.cap.style.opacity = (0.15 + 0.85 * clamp(p * 1.6 - 0.2, 0, 1)).toFixed(3);\n    });\n  }\n  function kick() { if (!raf && !destroyed) { last = 0; raf = requestAnimationFrame(tick); } }\n  function tick(now) {\n    raf = 0;\n    var dt = last ? Math.min(48, now - last) : 16.7; last = now;\n    var diff = tgt - cur;\n    if (reduce || Math.abs(diff) < 0.2) cur = tgt;\n    else cur += diff * (1 - Math.pow(0.88, dt / 16.7));\n    render();\n    if (cur !== tgt) raf = requestAnimationFrame(tick);\n  }\n  function onScroll() { tgt = view.scrollTop; if (tgt > 4) hint.classList.add(\"is-gone\"); kick(); }\n  view.addEventListener(\"scroll\", onScroll, { passive: true });\n  if (window.ResizeObserver) { ro = new ResizeObserver(function () { measure(); tgt = view.scrollTop; cur = tgt; render(); }); ro.observe(view); }\n  else { var rs = function () { measure(); }; window.addEventListener(\"resize\", rs); offs.push(function () { window.removeEventListener(\"resize\", rs); }); }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ accent: \"#e6ff55\", shape: \"circle\", roughness: 50, noise: 0.03, brighten: 0.6 }, opts, next || {});\n    opts.roughness = clamp(Number(opts.roughness), 0, 80);\n    opts.noise = clamp(Number(opts.noise), 0.005, 0.12);\n    opts.brighten = clamp(Number(opts.brighten), 0, 1);\n    root.style.setProperty(\"--ef-acc\", opts.accent);\n    if (!secs.length || prev.accent !== opts.accent) { var st = view.scrollTop; build(); view.scrollTop = st; tgt = cur = view.scrollTop; }\n    applyFx();\n    render();\n  }\n  update(o);\n  measure();\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true;\n      if (raf) cancelAnimationFrame(raf); raf = 0;\n      view.removeEventListener(\"scroll\", onScroll);\n      if (ro) ro.disconnect();\n      offs.forEach(function (f) { f(); }); offs = [];\n    }\n  };\n}"
  }
}