{
  "id": "logo-intro-reveal",
  "kind": "element",
  "title": "Logo intro reveal",
  "summary": "A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.",
  "url": "https://enrichr.dev/elements/logo-intro-reveal.html",
  "section": "hero",
  "techniques": [
    "reveal",
    "stagger",
    "webgl",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "WebGL"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "kinetic"
  ],
  "intents": [
    "logo loader intro animation",
    "preloader counter 100 to 0",
    "curtain lift page loader",
    "fluid mouse reveal hero",
    "webgl ink mask image reveal"
  ],
  "status": "tested",
  "params": [
    {
      "key": "word",
      "label": "Headline word",
      "type": "text",
      "value": "Enrichr"
    },
    {
      "key": "photo",
      "label": "Photo under the page",
      "type": "select",
      "options": [
        [
          "corgi-1",
          "Corgi puppy, orange wall"
        ],
        [
          "corgi-2",
          "Corgi in flowers"
        ],
        [
          "corgi-3",
          "Corgi on a rock, autumn"
        ],
        [
          "corgi-4",
          "Two dogs on a dirt road"
        ],
        [
          "corgi-5",
          "Corgi lying on white"
        ],
        [
          "corgi-6",
          "Corgi standing on white"
        ]
      ],
      "value": "corgi-1"
    },
    {
      "key": "speed",
      "label": "Intro speed",
      "type": "range",
      "min": 0.5,
      "max": 2,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "autoReplay",
      "label": "Auto replay (s after the reveal, 0 = off)",
      "type": "range",
      "min": 0,
      "max": 20,
      "step": 1,
      "value": 0
    },
    {
      "key": "reveal",
      "label": "Reveal strength",
      "type": "range",
      "min": 1,
      "max": 8,
      "step": 0.1,
      "value": 3.9
    },
    {
      "key": "trail",
      "label": "Ink trail (fade per frame)",
      "type": "range",
      "min": 0.95,
      "max": 0.998,
      "step": 0.001,
      "value": 0.988
    },
    {
      "key": "brush",
      "label": "Brush size",
      "type": "range",
      "min": 2,
      "max": 20,
      "step": 0.5,
      "value": 6
    },
    {
      "key": "background",
      "label": "Page",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "ink",
      "label": "Headline",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "loaderBackground",
      "label": "Loader background",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "loaderText",
      "label": "Loader text",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "accent",
      "label": "Loader shapes",
      "type": "color",
      "value": "#e6ff55"
    }
  ],
  "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 \"Logo intro reveal\" element to this project.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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/logo-intro-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 \"Logo intro reveal\" 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 \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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 \"Logo intro reveal\" element to this codebase.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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-logo-intro-reveal.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Logo intro reveal 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 \"Logo intro reveal\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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- logo-intro-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 \"./logo-intro-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LogoIntroReveal(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 \"Logo intro reveal\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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- logo-intro-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/LogoIntroReveal.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./logo-intro-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LogoIntroReveal(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 \"Logo intro reveal\" element.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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), logo-intro-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 \"Logo intro reveal\" element. No packages, no server code.\n\nThis is the \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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 logo-intro-reveal.js and then main.js), style.css (the CSS below), logo-intro-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 \"Logo intro reveal\" 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 \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-reveal.json\n\nWhat it does: One clock plays the original GSAP timeline, written as start times and eases. The E rises out of a clip and the puzzle piece scales up (1 s, power4.inOut). From 0.25 s a window beside them widens from 1 to 16 rem (1.1 s). From 0.55 s eight shapes flick in one after another, each popping from 55% to full size with back.out(1.4) and a random tilt, while the counter eases from 100 to 000 over 2.4 s (power2.inOut). Then the shape shrinks, the window closes and the counter fades, and 0.2 s later the cover slides up over 1.5 s. The hero letters rise in a shuffled order 0.07 s apart (1.6 s each) and the puzzle piece pops in at 1.35 s like an apostrophe. When they land, the page and headline are baked into a texture and a small stable-fluids simulation takes over: pointer moves push velocity and ink into 256 and 512 pixel buffers, the flow carries the ink and it slowly fades, and wherever it is dense enough the page turns transparent so the photo underneath shows through.\nAccessibility: The headline is a real heading with the word as its label, and it stays in the accessibility tree after the canvas takes over. The loader is decorative and hidden from screen readers. Replay intro is a real button, the menu button reports whether it is open, and both have focus rings. With prefers-reduced-motion the loader and the fluid are skipped and the finished hero is shown still. Nothing flashes.\n\nTunable settings:\n- Headline word: text, default Enrichr\n- Photo under the page: select (Corgi puppy, orange wall / Corgi in flowers / Corgi on a rock, autumn / Two dogs on a dirt road / Corgi lying on white / Corgi standing on white), default corgi-1\n- Intro speed: range 0.5 to 2, step 0.05, default 1\n- Auto replay (s after the reveal, 0 = off): range 0 to 20, step 1, default 0\n- Reveal strength: range 1 to 8, step 0.1, default 3.9\n- Ink trail (fade per frame): range 0.95 to 0.998, step 0.001, default 0.988\n- Brush size: range 2 to 20, step 0.5, default 6\n- Page: color, default #fbf8f1\n- Headline: color, default #0c1e18\n- Loader background: color, default #0c1e18\n- Loader text: color, default #fbf8f1\n- Loader shapes: color, default #e6ff55\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/logo-intro-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 \"Logo intro reveal\" 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 \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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 LogoIntroReveal.\n2. Paste the JavaScript below into a separate code file named logo-intro-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 \"./logo-intro-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LogoIntroReveal(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(LogoIntroReveal, {\n  word: { type: ControlType.String, title: \"Headline word\", defaultValue: \"Enrichr\" },\n  photo: { type: ControlType.Enum, title: \"Photo under the page\", options: [\"corgi-1\",\"corgi-2\",\"corgi-3\",\"corgi-4\",\"corgi-5\",\"corgi-6\"], optionTitles: [\"Corgi puppy, orange wall\",\"Corgi in flowers\",\"Corgi on a rock, autumn\",\"Two dogs on a dirt road\",\"Corgi lying on white\",\"Corgi standing on white\"], defaultValue: \"corgi-1\" },\n  speed: { type: ControlType.Number, title: \"Intro speed\", min: 0.5, max: 2, step: 0.05, defaultValue: 1 },\n  autoReplay: { type: ControlType.Number, title: \"Auto replay\", min: 0, max: 20, step: 1, defaultValue: 0 },\n  reveal: { type: ControlType.Number, title: \"Reveal strength\", min: 1, max: 8, step: 0.1, defaultValue: 3.9 },\n  trail: { type: ControlType.Number, title: \"Ink trail\", min: 0.95, max: 0.998, step: 0.001, defaultValue: 0.988 },\n  brush: { type: ControlType.Number, title: \"Brush size\", min: 2, max: 20, step: 0.5, defaultValue: 6 },\n  background: { type: ControlType.Color, title: \"Page\", defaultValue: \"#fbf8f1\" },\n  ink: { type: ControlType.Color, title: \"Headline\", defaultValue: \"#0c1e18\" },\n  loaderBackground: { type: ControlType.Color, title: \"Loader background\", defaultValue: \"#0c1e18\" },\n  loaderText: { type: ControlType.Color, title: \"Loader text\", defaultValue: \"#fbf8f1\" },\n  accent: { type: ControlType.Color, title: \"Loader shapes\", defaultValue: \"#e6ff55\" },\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 \"Logo intro reveal\" 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 \"Logo intro reveal\" element from the Enrichr Library: A loader builds the Enrichr mark beside a window of flicking shapes and a 100 to 000 counter, lifts like a curtain, then the pointer stirs ink that reveals a photo through the page.\nPage: https://enrichr.dev/elements/logo-intro-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/logo-intro-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-logo-intro-reveal\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-logo-intro-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 headline is a real heading with the word as its label, and it stays in the accessibility tree after the canvas takes over. The loader is decorative and hidden from screen readers. Replay intro is a real button, the menu button reports whether it is open, and both have focus rings. With prefers-reduced-motion the loader and the fluid are skipped and the finished hero is shown still. Nothing flashes.",
  "performance": "The intro only changes transforms, opacity and one height on a few elements. The fluid runs about 25 small shader passes a frame on 256 and 512 pixel buffers, only after the intro and only while on screen, and it rests once the ink has had ten seconds to fade. It needs half-float render targets; without them the hero stays still. Pixel ratio is capped at 2 and destroy() loses the WebGL context.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/qErLyLP",
  "source": {
    "markup": "<div class=\"ef-lir\">\n  <div class=\"ef-lir__hero\">\n    <img class=\"ef-lir__photo\" src=\"/img/library/corgi-1.jpg\" alt=\"\" decoding=\"async\">\n    <canvas class=\"ef-lir__fluid\" aria-hidden=\"true\"></canvas>\n    <div class=\"ef-lir__home\">\n      <h2 class=\"ef-lir__title\" aria-label=\"Enrichr\"></h2>\n    </div>\n    <div class=\"ef-lir__bottom\">\n      <span class=\"ef-lir__b ef-lir__hint\">Move to reveal<span class=\"ef-lir__dot\"></span></span>\n      <span class=\"ef-lir__b ef-lir__hide-sm\">enrichr.dev</span>\n      <button class=\"ef-lir__b ef-lir__replay\" type=\"button\">Replay intro &#8635;</button>\n    </div>\n  </div>\n  <nav class=\"ef-lir__nav\" aria-label=\"Example navigation\">\n    <div class=\"ef-lir__menu\">\n      <div class=\"ef-lir__links\">\n        <a class=\"ef-lir__a\" href=\"#\"><span class=\"ef-lir__s\">work</span></a>\n        <a class=\"ef-lir__a\" href=\"#\"><span class=\"ef-lir__s\">library</span></a>\n        <a class=\"ef-lir__a\" href=\"#\"><span class=\"ef-lir__s\">contact</span></a>\n      </div>\n      <button class=\"ef-lir__btn\" type=\"button\" aria-label=\"Menu\" aria-expanded=\"false\"><i class=\"ef-lir__bar\"></i><i class=\"ef-lir__bar\"></i></button>\n    </div>\n  </nav>\n  <div class=\"ef-lir__loader\" aria-hidden=\"true\">\n    <div class=\"ef-lir__row\">\n      <div class=\"ef-lir__mark\"><span class=\"ef-lir__mn\">E</span><span class=\"ef-lir__ma\"><svg class=\"ef-lir__svg\" viewBox=\"0 0 50 50\" focusable=\"false\"><path fill=\"currentColor\" d=\"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\"/></svg></span></div>\n      <div class=\"ef-lir__box\"><div class=\"ef-lir__shape\"></div></div>\n    </div>\n    <div class=\"ef-lir__nbr\">100</div>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-lir { --ef-lir-bg: #fbf8f1; --ef-lir-ink: #0c1e18; --ef-lir-lbg: #0c1e18; --ef-lir-ltx: #fbf8f1; --ef-lir-acc: #e6ff55; --ef-lir-k: 1; --ef-lir-fs: 10rem; --ef-lir-nf: 6rem; position: relative; box-sizing: border-box; width: 100%; height: 100%; min-height: 26rem; overflow: hidden; border-radius: 1rem; background: var(--ef-lir-bg); color: var(--ef-lir-ink); font-family: 'Parkinsans', 'Space Grotesk', sans-serif; touch-action: pan-y; isolation: isolate; }\n.ef-lir .ef-lir__hero { position: absolute; inset: 0; overflow: hidden; }\n.ef-lir .ef-lir__photo { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; object-position: 50% 35%; }\n.ef-lir .ef-lir__fluid { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; pointer-events: none; }\n.ef-lir .ef-lir__home { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--ef-lir-bg); }\n.ef-lir.is-fluid .ef-lir__home { background: transparent; }\n.ef-lir .ef-lir__title { margin: 0; padding: 0 0.02em; overflow: hidden; font-family: 'Bebas Neue', 'Parkinsans', sans-serif; font-weight: 400; font-size: var(--ef-lir-fs); line-height: 1; letter-spacing: 0; white-space: nowrap; text-align: center; text-transform: uppercase; color: var(--ef-lir-ink); opacity: 1; user-select: none; }\n.ef-lir.is-fluid .ef-lir__title { opacity: 0; }\n.ef-lir .ef-lir__ht { display: inline-block; }\n.ef-lir .ef-lir__ht--mark { width: 0.38em; height: 0.38em; margin: 0.1em 0 0 0.05em; vertical-align: top; transform-origin: 50% 50%; }\n.ef-lir .ef-lir__ht--mark svg, .ef-lir .ef-lir__ma svg, .ef-lir .ef-lir__shape svg { display: block; width: 100%; height: 100%; }\n.ef-lir .ef-lir__probe { display: inline-block; width: 0; height: 0; overflow: hidden; }\n/* the corner chrome uses difference blending, so white reads dark on the cream page and inverts over the photo */\n.ef-lir .ef-lir__bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; mix-blend-mode: difference; color: #fff; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; pointer-events: none; }\n.ef-lir .ef-lir__b { opacity: 0; pointer-events: auto; }\n.ef-lir .ef-lir__dot { display: inline-block; width: 0.45em; height: 0.45em; margin-left: 0.5em; border-radius: 50%; background: currentColor; vertical-align: middle; }\n.ef-lir .ef-lir__replay { position: relative; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }\n.ef-lir .ef-lir__replay::after { content: \"\"; position: absolute; left: 0; bottom: -3px; width: 100%; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1); }\n.ef-lir .ef-lir__replay:hover::after, .ef-lir .ef-lir__replay:focus-visible::after { transform: scaleX(1); transform-origin: left; }\n.ef-lir .ef-lir__replay:focus-visible, .ef-lir .ef-lir__btn:focus-visible, .ef-lir .ef-lir__a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }\n.ef-lir.is-static .ef-lir__replay, .ef-lir.is-static .ef-lir__hint, .ef-lir.is-nogl .ef-lir__hint { visibility: hidden; }\n.ef-lir .ef-lir__nav { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; justify-content: flex-end; align-items: center; padding: 1.1rem 1.5rem; mix-blend-mode: difference; color: #fff; pointer-events: none; }\n.ef-lir .ef-lir__menu { display: flex; align-items: center; gap: 1.4rem; pointer-events: auto; }\n.ef-lir .ef-lir__links { display: flex; gap: 1.4rem; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }\n.ef-lir .ef-lir__a { display: block; overflow: hidden; color: inherit; text-decoration: none; }\n.ef-lir .ef-lir__s { display: block; transform: translateY(110%); }\n.ef-lir .ef-lir__btn { position: relative; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }\n.ef-lir .ef-lir__bar { position: absolute; display: block; width: 1.15rem; height: 2px; background: currentColor; }\n.ef-lir .ef-lir__bar + .ef-lir__bar { transform: rotate(90deg); }\n.ef-lir .ef-lir__loader { position: absolute; top: 0; left: 0; z-index: 10; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; background: var(--ef-lir-lbg); color: var(--ef-lir-ltx); }\n.ef-lir.is-done .ef-lir__loader { display: none; }\n.ef-lir .ef-lir__row { display: flex; align-items: center; }\n.ef-lir .ef-lir__mark { display: flex; overflow: hidden; font-family: 'Bebas Neue', 'Parkinsans', sans-serif; font-size: calc(3.4rem * var(--ef-lir-k)); line-height: 1; }\n.ef-lir .ef-lir__mn { display: block; transform: translateY(120%); }\n.ef-lir .ef-lir__ma { display: block; align-self: flex-start; width: 0.4em; height: 0.4em; margin: 0.1em 0 0 0.06em; transform: scale(0); transform-origin: center; }\n.ef-lir .ef-lir__box { display: grid; place-items: center; width: calc(1rem * var(--ef-lir-k)); height: calc(11rem * var(--ef-lir-k)); margin-left: calc(1.4rem * var(--ef-lir-k)); overflow: hidden; }\n.ef-lir .ef-lir__shape { flex: none; width: calc(6rem * var(--ef-lir-k)); height: calc(6rem * var(--ef-lir-k)); color: var(--ef-lir-acc); opacity: 0; }\n.ef-lir .ef-lir__nbr { position: absolute; right: 1.5rem; bottom: 1rem; font-family: 'Bebas Neue', 'Parkinsans', sans-serif; font-size: var(--ef-lir-nf); line-height: 1; font-variant-numeric: tabular-nums; }\n.ef-lir.is-narrow .ef-lir__links, .ef-lir.is-narrow .ef-lir__hide-sm { display: none; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Logo intro reveal: a loader builds the Enrichr mark, then lifts like a curtain off a big one-word hero. The \"E\" rises\n// into a clip while the puzzle piece scales up, a window beside it opens and flicks through eight shapes as a counter\n// runs from 100 to 000, then the shape shrinks, the window closes and the dark cover slides up. The hero letters rise in\n// a shuffled order, the puzzle piece pops in like an apostrophe, the corner labels fade in, and from then on the pointer\n// stirs a small fluid simulation (raw WebGL stable fluids) whose ink cuts holes in the cream page so a corgi photo shows\n// through the trail. Timings and eases are the original GSAP timeline, rebuilt as plain maths (power4.inOut, back.out).\n// Replay with the button, with replay(), or set autoReplay. Reduced motion skips the loader and the fluid and shows the\n// still hero. The loop pauses off screen and in hidden tabs; the fluid also rests once the ink has faded.\n// mount(root, { word, photo (corgi-1 to corgi-6), speed (intro), autoReplay (seconds, 0 = off), reveal (ink to hole gain),\n//               trail (ink fade per frame), brush (size), background, ink, loaderBackground, loaderText, accent })\n//   -> { update, replay, destroy }\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-lir\");\n  var photo = box.querySelector(\".ef-lir__photo\"), fcan = box.querySelector(\".ef-lir__fluid\");\n  var title = box.querySelector(\".ef-lir__title\");\n  var bottom = [].slice.call(box.querySelectorAll(\".ef-lir__b\")), replayBtn = box.querySelector(\".ef-lir__replay\");\n  var loader = box.querySelector(\".ef-lir__loader\"), mn = box.querySelector(\".ef-lir__mn\"), ma = box.querySelector(\".ef-lir__ma\");\n  var lbox = box.querySelector(\".ef-lir__box\"), shapeEl = box.querySelector(\".ef-lir__shape\"), nbr = box.querySelector(\".ef-lir__nbr\");\n  var menu = box.querySelector(\".ef-lir__menu\"), menuBtn = box.querySelector(\".ef-lir__btn\"), menuSpans = [].slice.call(box.querySelectorAll(\".ef-lir__s\"));\n  var MARK = \"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\";\n  // the eight loader glyphs of the original (six-point star, dot, half disc, plus, triangle, face, asterisk, half-filled\n  // circle) as SVG so they look the same everywhere; the face became the Enrichr puzzle piece\n  var SHAPES = [\n    '<svg viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M50 13L58 36.14L82.04 31.5L66 50L82.04 68.5L58 63.86L50 87L42 63.86L17.96 68.5L34 50L17.96 31.5L42 36.14Z\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><circle fill=\"currentColor\" cx=\"50\" cy=\"50\" r=\"25\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M38 20A30 30 0 0 1 38 80Z\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M41 14H59V41H86V59H59V86H41V59H14V41H41Z\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M50 17L85 80H15Z\"/></svg>',\n    '<svg viewBox=\"-8 -8 66 66\"><path fill=\"currentColor\" d=\"' + MARK + '\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><path fill=\"none\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" d=\"M50 3V97M3 50H97M16.8 16.8L83.2 83.2M83.2 16.8L16.8 83.2\"/></svg>',\n    '<svg viewBox=\"0 0 100 100\"><circle fill=\"none\" stroke=\"currentColor\" stroke-width=\"6\" cx=\"50\" cy=\"50\" r=\"39\"/><path fill=\"currentColor\" d=\"M11 50A39 39 0 0 0 89 50Z\"/></svg>'\n  ];\n  var ALT = { \"corgi-1\": \"A corgi puppy against an orange wall\", \"corgi-2\": \"A corgi smiling in a field of flowers\", \"corgi-3\": \"A corgi sitting on a rock among autumn leaves\", \"corgi-4\": \"Two corgis on a dirt road\", \"corgi-5\": \"A corgi lying on a white background\", \"corgi-6\": \"A corgi standing on a white background\" };\n  var FLUID = { SIM_RES: 256, DYE_RES: 512, VEL_DISS: 0.962, PRESSURE_ITERS: 20, SPLAT_FORCE: 5900, EDGE_SOFT: 0.5, EDGE_WIDTH: 0.01 };\n\n  var opts = {}, raf = 0, last = 0, visible = true, started = false, destroyed = false, io = null, ro = null, rt = 0;\n  var art = 0, W = 1, H = 1, tl = null, letters = [], markEl = null, probe = null, fluidOn = false, swapFrames = 0, idle = 0;\n  var pointer = { x: 0.5, y: 0.5, px: 0.5, py: 0.5, moved: false, primed: false };\n  var menuT = 0, menuDir = 0, menuDur = 0.55 + 0.07 * (menuSpans.length - 1), menuHover = window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches;\n\n  // ---------- eases (GSAP: power1 = quad, power2 = cubic, power3 = quart, power4 = quint) ----------\n  function inOut(n) { return function (p) { return p < 0.5 ? Math.pow(p * 2, n) / 2 : 1 - Math.pow((1 - p) * 2, n) / 2; }; }\n  function out(n) { return function (p) { return 1 - Math.pow(1 - p, n); }; }\n  function backOut(s) { return function (p) { var q = 1 - p; return 1 - q * q * ((s + 1) * q - s); }; }\n  var P4IO = inOut(5), P2IO = inOut(3), P1O = out(2), P3O = out(4), P4O = out(5);\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function rnd(a, b) { return a + Math.random() * (b - a); }\n\n  // ---------- a tiny timeline: tweens with absolute start times, played by one clock ----------\n  function tween(at, dur, ease, fn) { tl.list.push({ at: at, dur: dur, ease: ease, fn: fn, state: 0 }); }\n  function call(at, fn) { tl.list.push({ at: at, dur: 0, fn: fn, call: true, state: 0 }); }\n  function advance(dt) {\n    var cur = tl, done = true;\n    if (!cur) return;\n    cur.t += dt;\n    for (var i = 0; i < cur.list.length; i++) {\n      var it = cur.list[i];\n      if (it.state === 2) continue;\n      if (cur.t < it.at) { done = false; continue; }\n      if (it.call) { it.state = 2; it.fn(); if (tl !== cur) return; continue; }\n      var p = Math.min(1, (cur.t - it.at) / it.dur);\n      it.fn(it.ease(p), it.state === 0);\n      it.state = p >= 1 ? 2 : 1;\n      if (it.state !== 2) done = false;\n    }\n    if (done && tl === cur) tl = null;\n  }\n\n  function boxW(rem) { lbox.style.width = \"calc(\" + rem.toFixed(3) + \"rem * var(--ef-lir-k))\"; }\n  function pad(n) { n = String(Math.round(n)); while (n.length < 3) n = \"0\" + n; return n; }\n  function setRise(el, pct) { el.style.transform = \"translateY(\" + pct.toFixed(2) + \"%)\"; }\n\n  function buildTitle() {\n    var word = String(opts.word || \"Enrichr\").trim().slice(0, 14) || \"Enrichr\";\n    title.textContent = \"\"; letters = [];\n    title.setAttribute(\"aria-label\", word);\n    word.toUpperCase().split(\"\").forEach(function (ch) {\n      var s = document.createElement(\"span\"); s.className = \"ef-lir__ht\"; s.setAttribute(\"aria-hidden\", \"true\");\n      s.textContent = ch === \" \" ? \" \" : ch; title.appendChild(s); letters.push(s);\n    });\n    markEl = document.createElement(\"span\"); markEl.className = \"ef-lir__ht ef-lir__ht--mark\"; markEl.setAttribute(\"aria-hidden\", \"true\");\n    markEl.innerHTML = '<svg viewBox=\"0 0 50 50\" focusable=\"false\"><path fill=\"currentColor\" d=\"' + MARK + '\"/></svg>';\n    title.appendChild(markEl);\n    probe = document.createElement(\"span\"); probe.className = \"ef-lir__probe\"; title.appendChild(probe);\n    mn.textContent = word.charAt(0).toUpperCase();\n  }\n\n  // ---------- the intro: loader (0 - 4.8 s), then the hero ----------\n  function restState() {\n    letters.forEach(function (l) { setRise(l, 0); });\n    markEl.style.transform = \"scale(1)\";\n  }\n  function hideState() {\n    box.classList.remove(\"is-done\", \"is-fluid\");\n    loader.style.height = \"100%\";\n    setRise(mn, 120); ma.style.transform = \"scale(0)\"; boxW(1);\n    shapeEl.style.opacity = \"0\"; shapeEl.style.transform = \"scale(0.55)\"; shapeEl.innerHTML = SHAPES[0];\n    nbr.textContent = \"100\"; nbr.style.opacity = \"1\"; nbr.style.visibility = \"visible\";\n    letters.forEach(function (l) { setRise(l, 120); });\n    markEl.style.transform = \"scale(0)\";\n    bottom.forEach(function (b) { b.style.opacity = \"0\"; });\n  }\n  function build() {\n    tl = { t: 0, list: [] };\n    hideState();\n    tween(0, 1, P4IO, function (e) { setRise(mn, 120 * (1 - e)); });\n    tween(0, 1, P4IO, function (e) { ma.style.transform = \"scale(\" + e.toFixed(4) + \")\"; });\n    tween(0.25, 1.1, P4IO, function (e) { boxW(1 + 15 * e); });\n    tween(0.55, 2.4, P2IO, function (e) { nbr.textContent = pad(100 - 100 * e); });\n    var rot = 0;\n    SHAPES.forEach(function (svg, i) {\n      tween(0.55 + i * (2.25 / SHAPES.length), 0.3, backOut(1.4), function (e, first) {\n        if (first) { shapeEl.innerHTML = svg; shapeEl.style.opacity = \"1\"; rot = rnd(-16, 16); }\n        shapeEl.style.transform = \"rotate(\" + rot.toFixed(2) + \"deg) scale(\" + (0.55 + 0.45 * e).toFixed(4) + \")\";\n      });\n    });\n    // '+=.15' after the counter ends (0.55 + 2.4), then the rest start together ('<'), the curtain 0.2 s later\n    var out1 = 0.55 + 2.4 + 0.15;\n    tween(out1, 0.5, P4IO, function (e) { shapeEl.style.transform = \"rotate(\" + rot.toFixed(2) + \"deg) scale(\" + (1 - e).toFixed(4) + \")\"; });\n    tween(out1, 0.7, P4IO, function (e) { boxW(16 - 15 * e); });\n    tween(out1, 0.4, P1O, function (e) { nbr.style.opacity = String(1 - e); if (e >= 1) nbr.style.visibility = \"hidden\"; });\n    tween(out1 + 0.2, 1.5, P4IO, function (e) { loader.style.height = (100 * (1 - e)).toFixed(3) + \"%\"; });\n    var h0 = out1 + 0.2 + 1.5;\n    call(h0, function () { box.classList.add(\"is-done\"); });\n    // hero: letters rise in a shuffled order (stagger 0.07 s, 1.6 s each), the mark pops in at 1.35 s\n    var order = letters.slice();\n    for (var i = order.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)), t = order[i]; order[i] = order[j]; order[j] = t; }\n    order.forEach(function (l, k) { tween(h0 + 0.07 * k, 1.6, P4IO, function (e) { setRise(l, 120 * (1 - e)); }); });\n    tween(h0 + 1.35, 0.6, backOut(0.9), function (e) { markEl.style.transform = \"scale(\" + e.toFixed(4) + \")\"; });\n    var fin = h0 + 0.07 * (order.length - 1) + 1.6;\n    call(fin, function () { restState(); startFluid(); });\n    [0.9, 1.05, 1.2].forEach(function (d, k) { if (bottom[k]) tween(fin + d, 1, P3O, function (e) { bottom[k].style.opacity = e.toFixed(4); }); });\n    if (opts.autoReplay > 0) call(fin + 2.2 + opts.autoReplay, function () { replay(); });\n  }\n  function showStatic() {\n    tl = null; stopFluid();\n    box.classList.add(\"is-done\", \"is-static\");\n    restState();\n    bottom.forEach(function (b) { b.style.opacity = \"1\"; });\n  }\n  function replay() {\n    if (destroyed) return;\n    clearTimeout(art);\n    if (reduce) { showStatic(); return; }\n    stopFluid();\n    build();\n    started = true;\n    if (!raf) { last = performance.now(); raf = requestAnimationFrame(loop); }\n  }\n\n  // ---------- fluid mask: Jos Stam stable fluids in raw WebGL, the same passes and constants as the original ----------\n  var gl = null, prog = {}, quad = null, fb = {}, texType = 0, filter = 0, baseTex = null, baseCanvas = null, baseCtx = null, dead = false;\n  var VERT = \"precision highp float;attribute vec2 aPosition;varying vec2 vUv,vL,vR,vT,vB;uniform vec2 texelSize;\" +\n    \"void main(){vUv=aPosition*.5+.5;vL=vUv-vec2(texelSize.x,0.);vR=vUv+vec2(texelSize.x,0.);vT=vUv+vec2(0.,texelSize.y);vB=vUv-vec2(0.,texelSize.y);gl_Position=vec4(aPosition,0.,1.);}\";\n  var FRAG = {\n    advection: \"precision highp float;varying vec2 vUv;uniform sampler2D uVelocity,uSource;uniform vec2 uTexel;uniform float uDissipation;\" +\n      \"void main(){vec2 coord=vUv-texture2D(uVelocity,vUv).xy*uTexel;gl_FragColor=uDissipation*texture2D(uSource,coord);}\",\n    splat: \"precision highp float;varying vec2 vUv;uniform sampler2D uTarget;uniform float uAspect,uRadius;uniform vec2 uPoint;uniform vec3 uColor;\" +\n      \"void main(){vec2 p=vUv-uPoint;p.x*=uAspect;vec3 s=exp(-dot(p,p)/uRadius)*uColor;gl_FragColor=vec4(texture2D(uTarget,vUv).xyz+s,1.);}\",\n    divergence: \"precision highp float;varying vec2 vUv,vL,vR,vT,vB;uniform sampler2D uVelocity;\" +\n      \"void main(){float L=texture2D(uVelocity,vL).x;float R=texture2D(uVelocity,vR).x;float T=texture2D(uVelocity,vT).y;float B=texture2D(uVelocity,vB).y;gl_FragColor=vec4(.5*(R-L+T-B),0.,0.,1.);}\",\n    pressure: \"precision highp float;varying vec2 vUv,vL,vR,vT,vB;uniform sampler2D uPressure,uDivergence;\" +\n      \"void main(){float L=texture2D(uPressure,vL).x;float R=texture2D(uPressure,vR).x;float T=texture2D(uPressure,vT).x;float B=texture2D(uPressure,vB).x;float div=texture2D(uDivergence,vUv).x;gl_FragColor=vec4((L+R+B+T-div)*.25,0.,0.,1.);}\",\n    gradient: \"precision highp float;varying vec2 vUv,vL,vR,vT,vB;uniform sampler2D uPressure,uVelocity;\" +\n      \"void main(){float L=texture2D(uPressure,vL).x;float R=texture2D(uPressure,vR).x;float T=texture2D(uPressure,vT).x;float B=texture2D(uPressure,vB).x;vec2 vel=texture2D(uVelocity,vUv).xy-.5*vec2(R-L,T-B);gl_FragColor=vec4(vel,0.,1.);}\",\n    display: \"precision highp float;varying vec2 vUv;uniform sampler2D uDye,uBase;uniform float uRevealSize,uEdgeSoft,uEdgeWidth;\" +\n      \"void main(){float dye=texture2D(uDye,vUv).r;vec4 base=texture2D(uBase,vUv);float m=clamp(smoothstep(uEdgeSoft,uEdgeSoft+uEdgeWidth,dye*uRevealSize),0.,1.);gl_FragColor=mix(base,vec4(0.),m);}\"\n  };\n  function renderable(type) {\n    var t = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, t);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4, 4, 0, gl.RGBA, type, null);\n    var f = gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, f);\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, t, 0);\n    var ok = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null); gl.deleteFramebuffer(f); gl.deleteTexture(t);\n    return ok;\n  }\n  function program(src) {\n    function mk(t, s) { var sh = gl.createShader(t); gl.shaderSource(sh, s); gl.compileShader(sh); return gl.getShaderParameter(sh, gl.COMPILE_STATUS) ? sh : null; }\n    var v = mk(gl.VERTEX_SHADER, VERT), f = mk(gl.FRAGMENT_SHADER, src);\n    if (!v || !f) return null;\n    var p = gl.createProgram(); gl.attachShader(p, v); gl.attachShader(p, f); gl.bindAttribLocation(p, 0, \"aPosition\"); gl.linkProgram(p);\n    gl.deleteShader(v); gl.deleteShader(f);\n    if (!gl.getProgramParameter(p, gl.LINK_STATUS)) return null;\n    var u = {}, n = gl.getProgramParameter(p, gl.ACTIVE_UNIFORMS);\n    for (var i = 0; i < n; i++) { var nm = gl.getActiveUniform(p, i).name; u[nm] = gl.getUniformLocation(p, nm); }\n    return { p: p, u: u };\n  }\n  function fbo(size) {\n    var t = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, t);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filter); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, texType, null);\n    var f = gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, f);\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, t, 0);\n    gl.viewport(0, 0, size, size); gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT);\n    return { tex: t, fbo: f, size: size };\n  }\n  function dbl(size) { var a = fbo(size), b = fbo(size); return { read: a, write: b, swap: function () { var t = this.read; this.read = this.write; this.write = t; } }; }\n  function initGL() {\n    var attrs = { alpha: true, depth: false, stencil: false, antialias: false, premultipliedAlpha: false, preserveDrawingBuffer: false };\n    gl = fcan.getContext(\"webgl\", attrs) || fcan.getContext(\"experimental-webgl\", attrs);\n    if (!gl) return false;\n    // half-float buffers keep negative velocities; plain bytes would clamp them, so without float targets there is no fluid\n    var hf = gl.getExtension(\"OES_texture_half_float\"), hfl = gl.getExtension(\"OES_texture_half_float_linear\");\n    if (hf && renderable(hf.HALF_FLOAT_OES)) { texType = hf.HALF_FLOAT_OES; filter = hfl ? gl.LINEAR : gl.NEAREST; }\n    else {\n      var ft = gl.getExtension(\"OES_texture_float\"), ftl = gl.getExtension(\"OES_texture_float_linear\");\n      if (ft && renderable(gl.FLOAT)) { texType = gl.FLOAT; filter = ftl ? gl.LINEAR : gl.NEAREST; } else return false;\n    }\n    for (var k in FRAG) { prog[k] = program(FRAG[k]); if (!prog[k]) return false; }\n    quad = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, quad);\n    gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n    gl.enableVertexAttribArray(0); gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n    gl.disable(gl.BLEND); gl.disable(gl.DEPTH_TEST);\n    fb.velocity = dbl(FLUID.SIM_RES); fb.pressure = dbl(FLUID.SIM_RES); fb.divergence = fbo(FLUID.SIM_RES); fb.dye = dbl(FLUID.DYE_RES);\n    baseTex = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, baseTex);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    baseCanvas = document.createElement(\"canvas\"); baseCtx = baseCanvas.getContext(\"2d\");\n    return true;\n  }\n  function blit(target) {\n    if (target) { gl.bindFramebuffer(gl.FRAMEBUFFER, target.fbo); gl.viewport(0, 0, target.size, target.size); }\n    else { gl.bindFramebuffer(gl.FRAMEBUFFER, null); gl.viewport(0, 0, fcan.width, fcan.height); }\n    gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n  }\n  function bind(tex, unit) { gl.activeTexture(gl.TEXTURE0 + unit); gl.bindTexture(gl.TEXTURE_2D, tex); return unit; }\n  function sizeCanvas() {\n    var dpr = Math.min(window.devicePixelRatio || 1, 2);\n    fcan.width = Math.max(1, Math.round(W * dpr)); fcan.height = Math.max(1, Math.round(H * dpr));\n  }\n  // bake the cream page and the headline into a texture, letter by letter at the DOM positions, on the DOM baseline\n  function bake() {\n    if (!gl) return;\n    var rect = box.getBoundingClientRect(), dpr = Math.min(window.devicePixelRatio || 1, 2);\n    baseCanvas.width = Math.max(1, Math.round(rect.width * dpr)); baseCanvas.height = Math.max(1, Math.round(rect.height * dpr));\n    var ctx = baseCtx; ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    ctx.fillStyle = opts.background; ctx.fillRect(0, 0, rect.width, rect.height);\n    var cs = getComputedStyle(title);\n    ctx.fillStyle = opts.ink; ctx.font = cs.fontWeight + \" \" + cs.fontSize + \" \" + cs.fontFamily;\n    ctx.textAlign = \"left\"; ctx.textBaseline = \"alphabetic\";\n    var baseline = probe.getBoundingClientRect().top - rect.top;\n    letters.forEach(function (sp) { var r = sp.getBoundingClientRect(); ctx.fillText(sp.textContent, r.left - rect.left, baseline); });\n    var mr = markEl.getBoundingClientRect();\n    if (window.Path2D && mr.width > 0) {\n      ctx.save(); ctx.translate(mr.left - rect.left, mr.top - rect.top); ctx.scale(mr.width / 50, mr.height / 50);\n      ctx.fill(new Path2D(MARK)); ctx.restore();\n    }\n    gl.bindTexture(gl.TEXTURE_2D, baseTex);\n    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, baseCanvas);\n    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n  }\n  function splat(x, y, dx, dy, strength) {\n    var P = prog.splat; gl.useProgram(P.p);\n    gl.uniform1f(P.u.uAspect, fcan.width / fcan.height); gl.uniform1f(P.u.uRadius, opts.brush * 1e-5); gl.uniform2f(P.u.uPoint, x, y);\n    gl.uniform2f(P.u.texelSize, 1 / FLUID.SIM_RES, 1 / FLUID.SIM_RES);\n    gl.uniform1i(P.u.uTarget, bind(fb.velocity.read.tex, 0)); gl.uniform3f(P.u.uColor, dx, dy, 0);\n    blit(fb.velocity.write); fb.velocity.swap();\n    gl.uniform2f(P.u.texelSize, 1 / FLUID.DYE_RES, 1 / FLUID.DYE_RES);\n    gl.uniform1i(P.u.uTarget, bind(fb.dye.read.tex, 0)); gl.uniform3f(P.u.uColor, strength, strength, strength);\n    blit(fb.dye.write); fb.dye.swap();\n  }\n  function step(fadeSq) {\n    var s = 1 / FLUID.SIM_RES, d = 1 / FLUID.DYE_RES, P = prog.advection;\n    gl.useProgram(P.p);\n    gl.uniform2f(P.u.texelSize, s, s); gl.uniform2f(P.u.uTexel, s, s);\n    gl.uniform1i(P.u.uVelocity, bind(fb.velocity.read.tex, 0)); gl.uniform1i(P.u.uSource, bind(fb.velocity.read.tex, 0));\n    gl.uniform1f(P.u.uDissipation, FLUID.VEL_DISS);\n    blit(fb.velocity.write); fb.velocity.swap();\n    gl.uniform2f(P.u.texelSize, d, d); gl.uniform2f(P.u.uTexel, d, d);\n    gl.uniform1i(P.u.uVelocity, bind(fb.velocity.read.tex, 0)); gl.uniform1i(P.u.uSource, bind(fb.dye.read.tex, 1));\n    gl.uniform1f(P.u.uDissipation, opts.trail + (0.97 - opts.trail) * fadeSq);\n    blit(fb.dye.write); fb.dye.swap();\n    P = prog.divergence; gl.useProgram(P.p);\n    gl.uniform2f(P.u.texelSize, s, s); gl.uniform1i(P.u.uVelocity, bind(fb.velocity.read.tex, 0));\n    blit(fb.divergence);\n    gl.bindFramebuffer(gl.FRAMEBUFFER, fb.pressure.read.fbo); gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT);\n    P = prog.pressure; gl.useProgram(P.p);\n    gl.uniform2f(P.u.texelSize, s, s); gl.uniform1i(P.u.uDivergence, bind(fb.divergence.tex, 0));\n    for (var i = 0; i < FLUID.PRESSURE_ITERS; i++) { gl.uniform1i(P.u.uPressure, bind(fb.pressure.read.tex, 1)); blit(fb.pressure.write); fb.pressure.swap(); }\n    P = prog.gradient; gl.useProgram(P.p);\n    gl.uniform2f(P.u.texelSize, s, s);\n    gl.uniform1i(P.u.uPressure, bind(fb.pressure.read.tex, 0)); gl.uniform1i(P.u.uVelocity, bind(fb.velocity.read.tex, 1));\n    blit(fb.velocity.write); fb.velocity.swap();\n  }\n  function display() {\n    var P = prog.display; gl.useProgram(P.p);\n    gl.uniform2f(P.u.texelSize, 1 / FLUID.DYE_RES, 1 / FLUID.DYE_RES);\n    gl.uniform1i(P.u.uDye, bind(fb.dye.read.tex, 0)); gl.uniform1i(P.u.uBase, bind(baseTex, 1));\n    gl.uniform1f(P.u.uRevealSize, opts.reveal); gl.uniform1f(P.u.uEdgeSoft, FLUID.EDGE_SOFT); gl.uniform1f(P.u.uEdgeWidth, FLUID.EDGE_WIDTH);\n    blit(null);\n  }\n  function clearSim() {\n    if (!gl) return;\n    [fb.dye.read, fb.dye.write, fb.velocity.read, fb.velocity.write, fb.pressure.read, fb.pressure.write].forEach(function (f) {\n      gl.bindFramebuffer(gl.FRAMEBUFFER, f.fbo); gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT);\n    });\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n  }\n  function startFluid() {\n    if (reduce || destroyed) return;\n    if (!gl && !dead) { if (!initGL()) { dead = true; gl = null; fcan.style.display = \"none\"; box.classList.add(\"is-nogl\"); } }\n    if (dead) return;\n    sizeCanvas(); bake(); clearSim(); display();\n    fluidOn = true; idle = 0; pointer.moved = false; pointer.primed = false;\n    swapFrames = 2; // like the original: let the canvas draw twice before the DOM headline steps aside\n  }\n  function stopFluid() {\n    fluidOn = false; swapFrames = 0;\n    box.classList.remove(\"is-fluid\");\n    if (gl) { clearSim(); }\n  }\n  function fluidFrame() {\n    var r = box.getBoundingClientRect();\n    var fade = Math.max(0, Math.min(1, -r.top / Math.max(1, r.height))), fadeSq = fade * fade, power = 1 - fadeSq;\n    if (pointer.moved) {\n      var dx = pointer.x - pointer.px, dy = pointer.y - pointer.py;\n      if ((dx || dy) && power > 0.001) { splat(pointer.x, pointer.y, dx * FLUID.SPLAT_FORCE * power, dy * FLUID.SPLAT_FORCE * power, power); idle = 0; }\n      pointer.px = pointer.x; pointer.py = pointer.y; pointer.moved = false;\n    }\n    // once the ink has had ten seconds to fade there is nothing left to simulate: rest until the pointer moves again\n    if (idle++ > 600) return;\n    step(fadeSq);\n    display();\n  }\n  function move(e) {\n    if (!fluidOn) return;\n    var r = fcan.getBoundingClientRect();\n    var x = (e.clientX - r.left) / Math.max(1, r.width), y = 1 - (e.clientY - r.top) / Math.max(1, r.height);\n    if (!pointer.primed) { pointer.px = x; pointer.py = y; pointer.primed = true; }\n    pointer.x = x; pointer.y = y; pointer.moved = true;\n  }\n\n  // ---------- menu: links slide up (0.55 s power4.out, 0.07 s apart) and the plus turns 45deg (0.45 s); reverses on leave ----------\n  function menuApply() {\n    menuBtn.style.transform = \"rotate(\" + (45 * P4O(Math.min(1, menuT / 0.45))).toFixed(2) + \"deg)\";\n    menuSpans.forEach(function (s, i) { var p = Math.max(0, Math.min(1, (menuT - 0.07 * i) / 0.55)); setRise(s, 110 * (1 - P4O(p))); });\n  }\n  function menuPlay(dir) { menuDir = dir; menuBtn.setAttribute(\"aria-expanded\", dir > 0 ? \"true\" : \"false\"); if (!raf) { last = performance.now(); raf = requestAnimationFrame(loop); } }\n  function onEnter() { if (menuHover) menuPlay(1); }\n  function onLeave() { if (menuHover) menuPlay(-1); }\n  function onMenuClick() { menuPlay(menuT > 0 && menuDir >= 0 ? -1 : 1); }\n\n  // ---------- one loop for the intro, the menu and the fluid ----------\n  function loop(now) {\n    raf = 0;\n    var dt = Math.min(0.05, (now - last) / 1000 || 0); last = now;\n    var busy = false;\n    if (menuDir) {\n      menuT = Math.max(0, Math.min(menuDur, menuT + dt * menuDir)); menuApply();\n      if (menuT <= 0 || menuT >= menuDur) menuDir = 0; else busy = true;\n    }\n    if (visible && !document.hidden) {\n      if (tl && started) { advance(dt * opts.speed); }\n      if (fluidOn) {\n        fluidFrame();\n        if (swapFrames > 0 && --swapFrames === 0) box.classList.add(\"is-fluid\");\n      }\n    }\n    if (((tl || fluidOn) && visible) || busy) raf = requestAnimationFrame(loop);\n  }\n\n  function layout() {\n    W = Math.max(1, box.clientWidth); H = Math.max(1, box.clientHeight);\n    box.style.setProperty(\"--ef-lir-fs\", Math.min(0.205 * W, 0.44 * H).toFixed(1) + \"px\");\n    box.style.setProperty(\"--ef-lir-k\", Math.max(0.55, Math.min(1, W / 760, H / 460)).toFixed(3));\n    box.style.setProperty(\"--ef-lir-nf\", Math.min(136, Math.max(64 * Math.max(0.55, Math.min(1, W / 760)), W * 0.1)).toFixed(1) + \"px\");\n    box.classList.toggle(\"is-narrow\", W < 560);\n  }\n  function onResize() {\n    layout();\n    if (fluidOn && gl) { clearTimeout(rt); rt = setTimeout(function () { if (!destroyed && fluidOn) { sizeCanvas(); bake(); display(); } }, 120); }\n  }\n\n  function update(partial) {\n    var prev = opts;\n    opts = Object.assign({ word: \"Enrichr\", photo: \"corgi-1\", speed: 1, autoReplay: 0, reveal: 3.9, trail: 0.988, brush: 6, background: \"#fbf8f1\", ink: \"#0c1e18\", loaderBackground: \"#0c1e18\", loaderText: \"#fbf8f1\", accent: \"#e6ff55\" }, opts, partial || {});\n    opts.speed = Math.max(0.1, num(opts.speed, 1)); opts.autoReplay = Math.max(0, num(opts.autoReplay, 0));\n    opts.reveal = Math.max(0.1, num(opts.reveal, 3.9)); opts.trail = Math.min(0.999, Math.max(0.9, num(opts.trail, 0.988))); opts.brush = Math.max(0.5, num(opts.brush, 6));\n    var ph = /^corgi-[1-6]$/.test(opts.photo) ? opts.photo : \"corgi-1\";\n    if (prev.photo !== ph) { photo.src = \"/img/library/\" + ph + \".jpg\"; photo.alt = ALT[ph]; }\n    box.style.setProperty(\"--ef-lir-bg\", opts.background); box.style.setProperty(\"--ef-lir-ink\", opts.ink);\n    box.style.setProperty(\"--ef-lir-lbg\", opts.loaderBackground); box.style.setProperty(\"--ef-lir-ltx\", opts.loaderText);\n    box.style.setProperty(\"--ef-lir-acc\", opts.accent);\n    if (prev.word !== opts.word) {\n      buildTitle();\n      if (reduce) showStatic();\n      else if (!started) hideState();\n      else if (tl) { replay(); return; } // a new word mid-intro restarts the intro with it\n      else restState();\n    }\n    if (destroyed) return;\n    if (fluidOn && gl && (prev.word !== opts.word || prev.background !== opts.background || prev.ink !== opts.ink)) {\n      // let the new letters settle in the layout, then bake them again\n      requestAnimationFrame(function () { if (fluidOn) { restState(); bake(); display(); } });\n    }\n    // a new auto replay value after the intro has finished starts counting from now\n    if (prev.autoReplay !== undefined && prev.autoReplay !== opts.autoReplay && started && !tl && !reduce) {\n      clearTimeout(art);\n      if (opts.autoReplay > 0) art = setTimeout(replay, opts.autoReplay * 1000);\n    }\n  }\n\n  update(o);\n  layout();\n  box.addEventListener(\"pointermove\", move);\n  replayBtn.addEventListener(\"click\", replay);\n  menu.addEventListener(\"mouseenter\", onEnter); menu.addEventListener(\"mouseleave\", onLeave); menuBtn.addEventListener(\"click\", onMenuClick);\n  if (reduce) showStatic();\n  else {\n    hideState();\n    // start the intro the first time the element is on screen, so a tile further down the page still shows it\n    if (\"IntersectionObserver\" in window) {\n      io = new IntersectionObserver(function (e) {\n        visible = e[0].isIntersecting;\n        if (visible && !started) replay();\n        else if (visible && !raf && (tl || fluidOn)) { last = performance.now(); raf = requestAnimationFrame(loop); }\n      }, { threshold: 0.15 });\n      io.observe(box);\n    } else replay();\n  }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) onResize(); }); ro.observe(box); }\n  if (document.fonts && document.fonts.ready) document.fonts.ready.then(function () { if (!destroyed) { layout(); if (fluidOn && gl) { bake(); display(); } } });\n\n  return {\n    update: update,\n    replay: replay,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf); raf = 0; clearTimeout(rt); clearTimeout(art); tl = null; fluidOn = false;\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n      box.removeEventListener(\"pointermove\", move);\n      replayBtn.removeEventListener(\"click\", replay);\n      menu.removeEventListener(\"mouseenter\", onEnter); menu.removeEventListener(\"mouseleave\", onLeave); menuBtn.removeEventListener(\"click\", onMenuClick);\n      if (gl) { var lose = gl.getExtension(\"WEBGL_lose_context\"); if (lose) lose.loseContext(); gl = null; }\n    }\n  };\n}"
  }
}