{
  "id": "particle-wave-hero",
  "kind": "element",
  "title": "Particle wave hero",
  "summary": "A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.",
  "url": "https://enrichr.dev/elements/particle-wave-hero.html",
  "section": "hero",
  "techniques": [
    "webgl",
    "pointer-interaction",
    "scroll-driven"
  ],
  "stack": [
    "Vanilla JS",
    "WebGL"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "cinematic",
    "immersive"
  ],
  "intents": [
    "particle wave hero",
    "webgl particle terrain background",
    "animated particles landing page hero",
    "scroll dive hero section",
    "green particle field headline"
  ],
  "status": "tested",
  "params": [
    {
      "key": "title1",
      "label": "Headline, first line",
      "type": "text",
      "value": "The Library"
    },
    {
      "key": "title2",
      "label": "Headline, second line",
      "type": "text",
      "value": "in motion"
    },
    {
      "key": "caption",
      "label": "Caption",
      "type": "text",
      "value": "Backgrounds, heroes and text effects you can drop into a page. Each one is tuned, tested and ready to copy."
    },
    {
      "key": "next",
      "label": "Line revealed on scroll",
      "type": "text",
      "value": "Now start building"
    },
    {
      "key": "dive",
      "label": "Scroll dive depth (scene units)",
      "type": "range",
      "min": 0,
      "max": 200,
      "step": 5,
      "value": 60
    },
    {
      "key": "speed",
      "label": "Wave speed",
      "type": "range",
      "min": 0,
      "max": 3,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "deep",
      "label": "Valley particles",
      "type": "color",
      "value": "#003d28"
    },
    {
      "key": "mid",
      "label": "Slope particles",
      "type": "color",
      "value": "#1a7a4c"
    },
    {
      "key": "crest",
      "label": "Crest particles",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "accent",
      "label": "Accent (second line, mark, bar)",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    }
  ],
  "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 \"Particle wave hero\" element to this project.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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/particle-wave-hero.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 \"Particle wave hero\" 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 \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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 \"Particle wave hero\" element to this codebase.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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-particle-wave-hero.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Particle wave hero 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 \"Particle wave hero\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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- particle-wave-hero.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 \"./particle-wave-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ParticleWaveHero(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 \"Particle wave hero\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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- particle-wave-hero.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/ParticleWaveHero.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./particle-wave-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ParticleWaveHero(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 \"Particle wave hero\" element.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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), particle-wave-hero.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 \"Particle wave hero\" element. No packages, no server code.\n\nThis is the \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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 particle-wave-hero.js and then main.js), style.css (the CSS below), particle-wave-hero.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 \"Particle wave hero\" 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 \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.json\n\nWhat it does: About 32,000 particles are scattered on the ground at the original pen's density, packed towards a strip down the middle (the sideways position is a random number raised to the power 1.6). The vertex shader lifts each particle by four layered sines, two of them drifting with time, raises the valley walls towards the edges, adds a small per-particle bob, and swells the ground up by 7 units and aside by 2.5 near the point where the pointer's ray meets the ground. Points grow with nearness and fade right at the camera; their colour runs from valley green to slope green, and the brighter half of the high ones turn to the crest colour. They are blended additively. The camera bobs 0.6 units on a slow sine and eases 5% a frame towards the pointer, swaying and tilting. As the hero scrolls out of view, its scroll progress (from the root's getBoundingClientRect on a passive scroll listener) sets a dive target and the camera eases 6% a frame towards it. Each text block sits at a depth along the valley: as the camera passes, it grows, rises, fades and blurs with the speed, and the next line flies in. A lime bar and the corner label track the dive.\nAccessibility: The headline is a real h2 and the caption is real text; the corner labels and logo are decorative and hidden from screen readers. With prefers-reduced-motion one still frame is drawn, the text does not move or blur on scroll, and the pulsing scroll hint is hidden. Nothing flashes. Nothing needs keyboard input, and page scrolling works as normal on touch screens.\n\nTunable settings:\n- Headline, first line: text, default The Library\n- Headline, second line: text, default in motion\n- Caption: text, default Backgrounds, heroes and text effects you can drop into a page. Each one is tuned, tested and ready to copy.\n- Line revealed on scroll: text, default Now start building\n- Scroll dive depth (scene units): range 0 to 200, step 5, default 60\n- Wave speed: range 0 to 3, step 0.05, default 1\n- Valley particles: color, default #003d28\n- Slope particles: color, default #1a7a4c\n- Crest particles: color, default #e6ff55\n- Accent (second line, mark, bar): color, default #e6ff55\n- Background: color, default #0c1e18\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/particle-wave-hero.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 \"Particle wave hero\" 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 \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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 ParticleWaveHero.\n2. Paste the JavaScript below into a separate code file named particle-wave-hero.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 \"./particle-wave-hero\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ParticleWaveHero(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(ParticleWaveHero, {\n  title1: { type: ControlType.String, title: \"Headline, first line\", defaultValue: \"The Library\" },\n  title2: { type: ControlType.String, title: \"Headline, second line\", defaultValue: \"in motion\" },\n  caption: { type: ControlType.String, title: \"Caption\", defaultValue: \"Backgrounds, heroes and text effects you can drop into a page. Each one is tuned, tested and ready to copy.\" },\n  next: { type: ControlType.String, title: \"Line revealed on scroll\", defaultValue: \"Now start building\" },\n  dive: { type: ControlType.Number, title: \"Scroll dive depth\", min: 0, max: 200, step: 5, defaultValue: 60 },\n  speed: { type: ControlType.Number, title: \"Wave speed\", min: 0, max: 3, step: 0.05, defaultValue: 1 },\n  deep: { type: ControlType.Color, title: \"Valley particles\", defaultValue: \"#003d28\" },\n  mid: { type: ControlType.Color, title: \"Slope particles\", defaultValue: \"#1a7a4c\" },\n  crest: { type: ControlType.Color, title: \"Crest particles\", defaultValue: \"#e6ff55\" },\n  accent: { type: ControlType.Color, title: \"Accent (second line, mark, bar)\", defaultValue: \"#e6ff55\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\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 \"Particle wave hero\" 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 \"Particle wave hero\" element from the Enrichr Library: A big two-line headline over a dark valley of green particles that roll in slow waves, swell under the pointer and fly past as the hero scrolls away.\nPage: https://enrichr.dev/elements/particle-wave-hero.html\nMachine-readable spec: https://enrichr.dev/elements/particle-wave-hero.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-particle-wave-hero\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-particle-wave-hero\"), { ...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 h2 and the caption is real text; the corner labels and logo are decorative and hidden from screen readers. With prefers-reduced-motion one still frame is drawn, the text does not move or blur on scroll, and the pulsing scroll hint is hidden. Nothing flashes. Nothing needs keyboard input, and page scrolling works as normal on touch screens.",
  "performance": "One draw call of about 32,000 points; fully faded points are moved off screen so they cost no fill. The pixel ratio is capped at 1.8 as in the original, the loop pauses off screen and in hidden tabs, the scroll listener is passive and only reads one rectangle, and destroy() removes the listeners and frees the WebGL context. Without WebGL the CSS background and the text stay.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/ogZJMJp",
  "source": {
    "markup": "<div class=\"ef-pwave\"><canvas class=\"ef-pwave__c\" role=\"img\" aria-label=\"A field of green particles rolling in slow waves along a dark valley, with lime crests\"></canvas><div class=\"ef-pwave__stage\"><div class=\"ef-pwave__sec\"><h2 class=\"ef-pwave__title\"><span class=\"ef-pwave__line ef-pwave__t1\">The Library</span> <span class=\"ef-pwave__line ef-pwave__line--accent ef-pwave__t2\">in motion</span></h2><p class=\"ef-pwave__cap\">Backgrounds, heroes and text effects you can drop into a page. Each one is tuned, tested and ready to copy.</p></div><div class=\"ef-pwave__sec ef-pwave__sec--next\"><p class=\"ef-pwave__next\">Now start building</p></div></div><div class=\"ef-pwave__hud\" aria-hidden=\"true\"><span class=\"ef-pwave__tl\">Scroll to dive in</span><span class=\"ef-pwave__tc\"><svg class=\"ef-pwave__mark\" viewBox=\"0 0 50 50\" aria-hidden=\"true\" 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>Enrichr</span><span class=\"ef-pwave__tr\">Library</span><span class=\"ef-pwave__bl\">Elements</span><span class=\"ef-pwave__br\">enrichr.dev</span><span class=\"ef-pwave__bar\"><i class=\"ef-pwave__fill\"></i></span><span class=\"ef-pwave__hint\">&#9660;&nbsp;&nbsp;scroll&nbsp;&nbsp;&#9660;</span></div></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-pwave { --ef-pw-ink: #fbf8f1; --ef-pw-dim: rgba(251, 248, 241, 0.62); --ef-pw-acc: #e6ff55; position: relative; isolation: isolate; width: 100%; min-height: 28rem; overflow: hidden; border-radius: 1rem; background: radial-gradient(120% 70% at 50% 72%, rgba(26, 122, 76, 0.35), rgba(26, 122, 76, 0) 60%), var(--ef-pw-bg, #0c1e18); color: var(--ef-pw-ink); container-type: inline-size; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; -webkit-font-smoothing: antialiased; touch-action: pan-y; }\n.ef-pwave .ef-pwave__c { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }\n.ef-pwave .ef-pwave__stage { position: absolute; inset: 0; z-index: 1; pointer-events: none; perspective: 900px; }\n.ef-pwave .ef-pwave__sec { position: absolute; top: 50%; left: 50%; width: 100%; max-width: 87.5rem; transform: translate(-50%, -50%); text-align: center; will-change: transform, opacity, filter; }\n.ef-pwave .ef-pwave__sec--next { opacity: 0; }\n.ef-pwave .ef-pwave__title { margin: 0; padding: 0; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-weight: 500; font-size: clamp(2.6rem, 11cqw, 10.6rem); line-height: 0.94; letter-spacing: -0.035em; color: var(--ef-pw-ink); opacity: 1; text-transform: none; }\n.ef-pwave .ef-pwave__line { display: block; }\n.ef-pwave .ef-pwave__line--accent { margin-left: 18cqw; color: var(--ef-pw-acc); }\n.ef-pwave .ef-pwave__cap { margin: 2.125rem auto 0; padding: 0 1rem; max-width: 32.5rem; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: 0.625rem; font-weight: 400; line-height: 2; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ef-pw-dim); opacity: 1; }\n.ef-pwave .ef-pwave__next { margin: 0; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-weight: 500; font-size: clamp(2.2rem, 7cqw, 6.9rem); line-height: 0.94; letter-spacing: -0.035em; color: var(--ef-pw-ink); opacity: 1; }\n.ef-pwave .ef-pwave__hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; font-size: 0.625rem; line-height: 1.2; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ef-pw-dim); }\n.ef-pwave .ef-pwave__tl { position: absolute; top: 1.375rem; left: 1.625rem; transition: opacity 0.5s; }\n.ef-pwave .ef-pwave__tc { position: absolute; top: 1.15rem; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; color: var(--ef-pw-ink); }\n.ef-pwave .ef-pwave__mark { width: 1.35em; height: 1.35em; color: var(--ef-pw-acc); flex: none; }\n.ef-pwave .ef-pwave__tr { position: absolute; top: 1.375rem; right: 1.625rem; }\n.ef-pwave .ef-pwave__bl { position: absolute; bottom: 1.375rem; left: 1.625rem; }\n.ef-pwave .ef-pwave__br { position: absolute; bottom: 1.375rem; right: 1.625rem; }\n.ef-pwave .ef-pwave__bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: rgba(255, 255, 255, 0.06); }\n.ef-pwave .ef-pwave__fill { display: block; height: 100%; width: 0%; background: var(--ef-pw-acc); transition: width 0.1s linear; }\n.ef-pwave .ef-pwave__hint { position: absolute; bottom: 3.5rem; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 0.5625rem; letter-spacing: 0.3em; color: var(--ef-pw-dim); animation: ef-pwave-pulse 2.4s ease-in-out infinite; transition: opacity 0.6s; }\n.ef-pwave .ef-pwave__hint.is-gone { animation: none; opacity: 0; }\n@keyframes ef-pwave-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }\n@container (max-width: 34rem) { .ef-pwave .ef-pwave__tr, .ef-pwave .ef-pwave__bl { display: none; } }\n@container (max-width: 26rem) { .ef-pwave .ef-pwave__tl { display: none; } }\n@media (prefers-reduced-motion: reduce) { .ef-pwave .ef-pwave__hint { display: none; } .ef-pwave .ef-pwave__fill { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Particle wave hero: a big two-line headline over a valley of green particles that roll in slow waves. Raw WebGL1 points,\n// no libraries: about 32,000 particles (the original pen's density) are laid out on the ground, packed towards a winding\n// strip down the middle, and a vertex shader lifts each one by a few layered sine waves, raises the valley walls, adds a\n// little per-particle jitter and swells the ground up and aside near the pointer. Low particles are deep green, middle\n// ones green, and the brightest half of the high ones turn lime; they are blended additively and fade right at the camera.\n// The camera bobs gently (a 0.6-unit sine every 12.6 seconds), and eases after the pointer (5% a frame) to sway and tilt.\n// As the hero scrolls out of view the camera dives forward along the valley (eased 6% a frame, as in the original's\n// virtual scroll): the headline grows, rises, blurs with speed and fades, and a second line flies in from the distance.\n// A thin lime bar and the corner label track the dive.\n// Reduced motion draws one still frame, keeps the text still and hides the scroll hint. The loop pauses off screen and in\n// hidden tabs. Without WebGL the CSS background stays and the text still shows.\n// mount(root, { title1 (first line), title2 (second, offset line), caption, next (line revealed on scroll), dive (scroll\n//               dive depth, scene units), speed (wave speed), deep, mid, crest (particle colours), accent (lime details),\n//               background })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-pwave\");\n  var canvas = root.querySelector(\".ef-pwave__c\");\n  var secs = root.querySelectorAll(\".ef-pwave__sec\");\n  var t1 = root.querySelector(\".ef-pwave__t1\"), t2 = root.querySelector(\".ef-pwave__t2\");\n  var cap = root.querySelector(\".ef-pwave__cap\"), next = root.querySelector(\".ef-pwave__next\");\n  var label = root.querySelector(\".ef-pwave__tl\"), fill = root.querySelector(\".ef-pwave__fill\"), hint = root.querySelector(\".ef-pwave__hint\");\n  var opts = {}, raf = 0, visible = true, io = null, ro = null, destroyed = false, last = 0;\n  var gl = null, prog = null, vb = null, u = {}, ok = false, count = 0, pr = 1;\n  var time = 0, progress = 0, current = 0, vel = 0, lastLabel = \"\";\n  var mouse = { x: 0, y: 0, sx: 0, sy: 0 }, hit = [9999, 0, 9999];\n  var SEC_Z = [0, 60], SPAN_X = 260, DIVE_MAX = 200, SPAN_Z = 80 + 400 + DIVE_MAX;\n  var FOV = 62 * Math.PI / 180, NEAR = 0.1, FAR = 400, TANH = Math.tan(FOV / 2);\n  var LABELS = [[0, \"Scroll to dive in\"], [0.3, \"Keep going\"], [0.68, \"Almost there\"], [0.94, \"Welcome\"]];\n  var DEF = {\n    title1: \"The Library\", title2: \"in motion\",\n    caption: \"Backgrounds, heroes and text effects you can drop into a page. Each one is tuned, tested and ready to copy.\",\n    next: \"Now start building\", dive: 60, speed: 1,\n    deep: \"#003d28\", mid: \"#1a7a4c\", crest: \"#e6ff55\", accent: \"#e6ff55\", background: \"#0c1e18\"\n  };\n  var view = new Float32Array(16), proj = new Float32Array(16);\n\n  // the original pen's terrain shaders; reversed smoothsteps are written out so every GPU gives the same result\n  var VS = [\n    \"attribute vec2 aXZ;attribute float aRnd;attribute float aSeed;\",\n    \"uniform float uTime;uniform vec3 uMouse;uniform float uPx;uniform mat4 uView;uniform mat4 uProj;\",\n    \"varying float vH;varying float vR;varying float vFade;\",\n    \"float ss(float a,float b,float x){float t=clamp((x-a)/(b-a),0.0,1.0);return t*t*(3.0-2.0*t);}\",\n    \"float terra(vec2 p){float h=0.0;\",\n    \"h+=sin(p.x*0.045+sin(p.y*0.03)*1.7)*4.0;\",\n    \"h+=sin(p.y*0.05+sin(p.x*0.021)*2.3)*3.2;\",\n    \"h+=sin((p.x+p.y)*0.09+uTime*0.35)*1.1;\",\n    \"h+=sin(p.x*0.23+p.y*0.17+uTime*0.8)*0.35;\",\n    \"return h;}\",\n    \"void main(){vec3 p=vec3(aXZ.x,0.0,aXZ.y);\",\n    \"float valley=smoothstep(0.0,90.0,abs(p.x));\",\n    \"p.y=terra(p.xz)-10.0+valley*22.0;\",\n    \"p.y+=sin(uTime*1.4+aSeed)*0.35*aRnd;\",\n    \"float d=distance(p.xz,uMouse.xz);float push=ss(26.0,0.0,d);\",\n    \"p.y+=push*7.0;p.x+=push*sign(p.x-uMouse.x+0.001)*2.5;\",\n    \"vH=p.y;vR=aRnd;vec4 mv=uView*vec4(p,1.0);\",\n    \"vFade=ss(-6.0,-30.0,mv.z);\",\n    \"gl_Position=uProj*mv;\",\n    \"float size=(1.1+aRnd*2.2+push*2.0)*uPx;gl_PointSize=size*(140.0/-mv.z);\",\n    // fully faded points add nothing; move them off screen so they cost no fill\n    \"if(vFade<=0.0)gl_Position=vec4(2.0,2.0,2.0,1.0);}\"\n  ].join(\"\\n\");\n  var FS = [\n    \"precision mediump float;uniform vec3 uDeep;uniform vec3 uMid;uniform vec3 uCrest;\",\n    \"varying float vH;varying float vR;varying float vFade;\",\n    \"float ss(float a,float b,float x){float t=clamp((x-a)/(b-a),0.0,1.0);return t*t*(3.0-2.0*t);}\",\n    \"void main(){vec2 uv=gl_PointCoord-0.5;float a=ss(0.5,0.05,length(uv));\",\n    \"float t=clamp((vH+14.0)/30.0,0.0,1.0);\",\n    \"vec3 col=mix(uDeep,uMid,smoothstep(0.0,0.6,t));\",\n    \"col=mix(col,uCrest,smoothstep(0.55,1.0,t)*step(0.55,vR));\",\n    \"gl_FragColor=vec4(col,a*(0.4+0.6*vR)*vFade);}\"\n  ].join(\"\\n\");\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function rgb(h, d) { var m = /^#?([0-9a-f]{6})$/i.exec(h || \"\"); var v = parseInt(m ? m[1] : d, 16); return [(v >> 16) / 255, ((v >> 8) & 255) / 255, (v & 255) / 255]; }\n  function smooth(x, a, b) { if (x <= a) return 0; if (x >= b) return 1; x = (x - a) / (b - a); return x * x * (3 - 2 * x); }\n\n  function sh(type, src) { var s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return gl.getShaderParameter(s, gl.COMPILE_STATUS) ? s : null; }\n  function setup() {\n    var v = sh(gl.VERTEX_SHADER, VS), f = sh(gl.FRAGMENT_SHADER, FS);\n    if (!v || !f) return false;\n    prog = gl.createProgram(); gl.attachShader(prog, v); gl.attachShader(prog, f); gl.linkProgram(prog);\n    gl.deleteShader(v); gl.deleteShader(f);\n    if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) return false;\n    gl.useProgram(prog);\n    // same density as the original (48,000 over 1,020 units of depth, 22,000 with reduced motion), over the depth this\n    // hero can actually see\n    count = Math.round((reduce ? 22000 : 48000) * SPAN_Z / 1020);\n    var data = new Float32Array(count * 4);\n    for (var i = 0; i < count; i++) {\n      var x = Math.random() * 2 - 1;\n      data[i * 4] = (x < 0 ? -1 : x > 0 ? 1 : 0) * Math.pow(Math.abs(x), 1.6) * SPAN_X * 0.5; // packed towards the middle\n      data[i * 4 + 1] = -Math.random() * SPAN_Z + 80;\n      data[i * 4 + 2] = Math.random();\n      data[i * 4 + 3] = Math.random() * 6.283;\n    }\n    vb = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vb); gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n    var a1 = gl.getAttribLocation(prog, \"aXZ\"), a2 = gl.getAttribLocation(prog, \"aRnd\"), a3 = gl.getAttribLocation(prog, \"aSeed\");\n    gl.enableVertexAttribArray(a1); gl.vertexAttribPointer(a1, 2, gl.FLOAT, false, 16, 0);\n    gl.enableVertexAttribArray(a2); gl.vertexAttribPointer(a2, 1, gl.FLOAT, false, 16, 8);\n    gl.enableVertexAttribArray(a3); gl.vertexAttribPointer(a3, 1, gl.FLOAT, false, 16, 12);\n    [\"uTime\", \"uMouse\", \"uPx\", \"uView\", \"uProj\", \"uDeep\", \"uMid\", \"uCrest\"].forEach(function (k) { u[k] = gl.getUniformLocation(prog, k); });\n    gl.disable(gl.DEPTH_TEST);\n    gl.enable(gl.BLEND); gl.blendEquation(gl.FUNC_ADD); gl.blendFunc(gl.SRC_ALPHA, gl.ONE); // three.js AdditiveBlending\n    return true;\n  }\n  function size() {\n    pr = Math.min(window.devicePixelRatio || 1, 1.8);\n    var w = Math.max(1, Math.round(wrap.clientWidth * pr)), h = Math.max(1, Math.round(wrap.clientHeight * pr));\n    if (canvas.width !== w || canvas.height !== h) { canvas.width = w; canvas.height = h; gl.viewport(0, 0, w, h); }\n  }\n\n  // camera: position plus an XYZ Euler rotation, as three.js builds it\n  function rotation(rx, ry, rz) {\n    var a = Math.cos(rx), b = Math.sin(rx), c = Math.cos(ry), d = Math.sin(ry), e = Math.cos(rz), f = Math.sin(rz);\n    var ae = a * e, af = a * f, be = b * e, bf = b * f;\n    return [[c * e, -c * f, d], [af + be * d, ae - bf * d, -b * c], [bf - ae * d, be + af * d, a * c]]; // rows\n  }\n  function camera(t, aspect) {\n    var pos = [mouse.sx * 6, 3 + Math.sin(t * 0.5) * 0.6 - mouse.sy * 3, -current];\n    var R = rotation(-mouse.sy * 0.06, -mouse.sx * 0.1, mouse.sx * 0.02), i, j;\n    // view = transpose(R) and -transpose(R) * pos, written column-major\n    for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) view[j * 4 + i] = R[j][i];\n    for (i = 0; i < 3; i++) view[12 + i] = -(R[0][i] * pos[0] + R[1][i] * pos[1] + R[2][i] * pos[2]);\n    view[3] = view[7] = view[11] = 0; view[15] = 1;\n    var fy = 1 / TANH;\n    proj.fill(0); proj[0] = fy / aspect; proj[5] = fy; proj[10] = (FAR + NEAR) / (NEAR - FAR); proj[11] = -1; proj[14] = 2 * FAR * NEAR / (NEAR - FAR);\n    // the pointer ray (unsmoothed pointer, as in the original) meets the ground plane y = -6\n    var dc = [mouse.x * TANH * aspect, -mouse.y * TANH, -1];\n    var dw = [R[0][0] * dc[0] + R[0][1] * dc[1] + R[0][2] * dc[2], R[1][0] * dc[0] + R[1][1] * dc[1] + R[1][2] * dc[2], R[2][0] * dc[0] + R[2][1] * dc[1] + R[2][2] * dc[2]];\n    if (dw[1] !== 0) {\n      var k = (-6 - pos[1]) / dw[1];\n      if (k >= 0) { hit[0] = pos[0] + dw[0] * k; hit[1] = -6; hit[2] = pos[2] + dw[2] * k; }\n    }\n  }\n  function draw() {\n    if (!ok || destroyed || gl.isContextLost()) return;\n    size();\n    camera(time, canvas.width / canvas.height);\n    var bg = rgb(opts.background, \"0c1e18\");\n    gl.clearColor(bg[0], bg[1], bg[2], 1); gl.clear(gl.COLOR_BUFFER_BIT);\n    gl.uniform1f(u.uTime, time);\n    gl.uniform3f(u.uMouse, hit[0], hit[1], hit[2]);\n    gl.uniform1f(u.uPx, pr);\n    gl.uniformMatrix4fv(u.uView, false, view);\n    gl.uniformMatrix4fv(u.uProj, false, proj);\n    gl.uniform3fv(u.uDeep, rgb(opts.deep, \"003d28\"));\n    gl.uniform3fv(u.uMid, rgb(opts.mid, \"1a7a4c\"));\n    gl.uniform3fv(u.uCrest, rgb(opts.crest, \"e6ff55\"));\n    gl.drawArrays(gl.POINTS, 0, count);\n  }\n\n  // the text sections: each sits at a depth along the valley and is scaled, moved, faded and blurred by its distance\n  function sections() {\n    var blur = Math.min(Math.abs(vel) * 2.2, 14);\n    for (var i = 0; i < secs.length; i++) {\n      var el = secs[i], dz = SEC_Z[i] - current;\n      if (dz < -22 || dz > 90) { el.style.opacity = 0; continue; }\n      var scale = 36 / (36 + Math.max(dz, -20));\n      var op = dz >= 0 ? 1 - smooth(dz, 8, 70) : 1 - smooth(-dz, 2, 20);\n      var b = blur * (0.4 + Math.min(Math.abs(dz) / 40, 1));\n      el.style.opacity = op;\n      el.style.filter = b > 0.01 ? \"blur(\" + b.toFixed(2) + \"px)\" : \"none\";\n      el.style.transform = \"translate(-50%,-50%) translateY(\" + (dz >= 0 ? dz * 0.4 : dz * 2.4) + \"px) scale(\" + scale + \")\";\n    }\n    var prog = opts.dive > 0 ? Math.min(1, current / opts.dive) : 0;\n    fill.style.width = (prog * 100).toFixed(2) + \"%\";\n    var lbl = LABELS[0][1];\n    for (var k = 0; k < LABELS.length; k++) if (prog >= LABELS[k][0]) lbl = LABELS[k][1];\n    if (lbl !== lastLabel) { label.textContent = lbl; lastLabel = lbl; }\n    if (hint) hint.classList.toggle(\"is-gone\", prog > 0.02);\n  }\n\n  function loop(now) {\n    raf = requestAnimationFrame(loop);\n    var dt = Math.min(0.1, Math.max(0, (now - last) / 1000)); last = now;\n    if (!visible || document.hidden) return;\n    var k = dt * 60;\n    time += dt * opts.speed;\n    var prev = current, target = progress * opts.dive;\n    current += (target - current) * (1 - Math.pow(0.94, k));\n    vel = k > 0 ? (current - prev) / k : 0;\n    var e = 1 - Math.pow(0.95, k);\n    mouse.sx += (mouse.x - mouse.sx) * e; mouse.sy += (mouse.y - mouse.sy) * e;\n    sections();\n    draw();\n  }\n  function still() { time = 4; current = 0; vel = 0; mouse.sx = mouse.sy = mouse.x = mouse.y = 0; sections(); draw(); }\n\n  function onScroll() {\n    var r = wrap.getBoundingClientRect();\n    progress = r.height > 0 ? Math.max(0, Math.min(1, -r.top / r.height)) : 0;\n  }\n  function onMove(e) {\n    var r = wrap.getBoundingClientRect();\n    if (!r.width || !r.height) return;\n    mouse.x = (e.clientX - r.left) / r.width * 2 - 1;\n    mouse.y = (e.clientY - r.top) / r.height * 2 - 1;\n  }\n  function onLost(e) { e.preventDefault(); canvas.style.display = \"none\"; }\n\n  function update(partial) {\n    opts = Object.assign({}, DEF, opts, partial || {});\n    opts.dive = Math.max(0, Math.min(DIVE_MAX, num(opts.dive, DEF.dive)));\n    opts.speed = Math.max(0, num(opts.speed, DEF.speed));\n    t1.textContent = opts.title1; t2.textContent = opts.title2; cap.textContent = opts.caption; next.textContent = opts.next;\n    cap.style.display = opts.caption ? \"\" : \"none\";\n    wrap.style.setProperty(\"--ef-pw-bg\", opts.background);\n    wrap.style.setProperty(\"--ef-pw-acc\", opts.accent);\n    if (destroyed) return;\n    if (reduce) still(); else { sections(); draw(); }\n  }\n\n  try { gl = canvas.getContext(\"webgl\", { antialias: false, alpha: false, powerPreference: \"high-performance\" }); } catch (e) { gl = null; }\n  ok = !!gl && setup();\n  if (!ok) canvas.style.display = \"none\";\n  else canvas.addEventListener(\"webglcontextlost\", onLost);\n  if (reduce) { label.textContent = \"Welcome\"; lastLabel = \"Welcome\"; LABELS = [[0, \"Welcome\"]]; }\n  update(o);\n  if (!reduce) {\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    wrap.addEventListener(\"pointermove\", onMove);\n    onScroll();\n    if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(wrap); }\n    last = performance.now(); raf = requestAnimationFrame(loop);\n  }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (destroyed) return; if (!reduce) onScroll(); draw(); }); ro.observe(wrap); }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf);\n      window.removeEventListener(\"scroll\", onScroll);\n      wrap.removeEventListener(\"pointermove\", onMove);\n      canvas.removeEventListener(\"webglcontextlost\", onLost);\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n      if (gl) {\n        var ext = gl.getExtension(\"WEBGL_lose_context\");\n        if (vb) gl.deleteBuffer(vb); if (prog) gl.deleteProgram(prog);\n        if (ext) ext.loseContext();\n        gl = null;\n      }\n    }\n  };\n}"
  }
}