{
  "id": "plasma-field",
  "kind": "element",
  "title": "Plasma field",
  "summary": "A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.",
  "url": "https://enrichr.dev/elements/plasma-field.html",
  "section": "background",
  "techniques": [
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "Canvas 2D",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "fluid",
    "energetic",
    "playful"
  ],
  "intents": [
    "plasma background",
    "retro plasma effect",
    "sine wave colour field",
    "ripple on mouse move",
    "low resolution animated background"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "speed",
      "label": "Speed",
      "type": "range",
      "min": 0.1,
      "max": 3,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "scale",
      "label": "Pattern scale",
      "type": "range",
      "min": 0.5,
      "max": 3,
      "step": 0.1,
      "value": 1.2
    },
    {
      "key": "cell",
      "label": "Cell size (px)",
      "type": "range",
      "min": 3,
      "max": 14,
      "step": 1,
      "value": 8
    },
    {
      "key": "ripple",
      "label": "Pointer ripple",
      "type": "range",
      "min": 0,
      "max": 1,
      "step": 0.05,
      "value": 0.8
    },
    {
      "key": "pixelated",
      "label": "Rendering",
      "type": "select",
      "options": [
        [
          "off",
          "Smooth"
        ],
        [
          "on",
          "Hard pixels"
        ]
      ],
      "value": "off"
    }
  ],
  "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 \"Plasma field\" element to this project.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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/plasma-field.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 \"Plasma field\" 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 \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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 \"Plasma field\" element to this codebase.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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-plasma-field.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Plasma field 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 \"Plasma field\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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- plasma-field.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 \"./plasma-field\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function PlasmaField(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 \"Plasma field\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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- plasma-field.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/PlasmaField.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./plasma-field\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function PlasmaField(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 \"Plasma field\" element.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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), plasma-field.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 \"Plasma field\" element. No packages, no server code.\n\nThis is the \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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 plasma-field.js and then main.js), style.css (the CSS below), plasma-field.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 \"Plasma field\" 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 \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.json\n\nWhat it does: A canvas is sized to the box divided by the cell size, so it holds only a few thousand samples. Each frame, every sample sums four sine terms (horizontal, vertical, diagonal and radial, with time offsets) and any live ripples, then the result is normalised to 0 to 1 and looked up in a 256-entry palette running dark ink, greens, lime, accent and cream. CSS scales the canvas up with smooth interpolation, which gives the soft look, or with pixelated rendering for chunky cells. Each pointer move adds a ripple: a travelling sine wave under a Gaussian ring that decays with age.\nAccessibility: Decorative only: canvas and pieces are aria-hidden and not focusable. Reduced motion draws a single still frame and ignores pointer ripples; the pieces stop floating. The field is mid-green with bright lime peaks, so put text on a scrim or in a solid panel and check contrast.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Speed: range 0.1 to 3, step 0.1, default 1\n- Pattern scale: range 0.5 to 3, step 0.1, default 1.2\n- Cell size (px): range 3 to 14, step 1, default 8\n- Pointer ripple: range 0 to 1, step 0.05, default 0.8\n- Rendering: select (Smooth / Hard pixels), default off\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/plasma-field.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 \"Plasma field\" 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 \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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 PlasmaField.\n2. Paste the JavaScript below into a separate code file named plasma-field.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 \"./plasma-field\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function PlasmaField(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(PlasmaField, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  speed: { type: ControlType.Number, title: \"Speed\", min: 0.1, max: 3, step: 0.1, defaultValue: 1 },\n  scale: { type: ControlType.Number, title: \"Pattern scale\", min: 0.5, max: 3, step: 0.1, defaultValue: 1.2 },\n  cell: { type: ControlType.Number, title: \"Cell size\", min: 3, max: 14, step: 1, defaultValue: 8 },\n  ripple: { type: ControlType.Number, title: \"Pointer ripple\", min: 0, max: 1, step: 0.05, defaultValue: 0.8 },\n  pixelated: { type: ControlType.Enum, title: \"Rendering\", options: [\"off\",\"on\"], optionTitles: [\"Smooth\",\"Hard pixels\"], defaultValue: \"off\" },\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 \"Plasma field\" 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 \"Plasma field\" element from the Enrichr Library: A classic plasma colour field built from summed sine waves at low resolution and upscaled, in brand greens and lime, with pointer ripples and floating puzzle pieces.\nPage: https://enrichr.dev/elements/plasma-field.html\nMachine-readable spec: https://enrichr.dev/elements/plasma-field.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-plasma-field\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-plasma-field\"), { ...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": "Decorative only: canvas and pieces are aria-hidden and not focusable. Reduced motion draws a single still frame and ignores pointer ripples; the pieces stop floating. The field is mid-green with bright lime peaks, so put text on a scrim or in a solid panel and check contrast.",
  "performance": "Cost scales with the number of cells, not the box size, so a larger cell size is the main performance lever. Drawing pauses off-screen via IntersectionObserver and stops on destroy. Ripples are capped at eight and expire after a few seconds.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-pla\">\n  <div class=\"ef-pla-fb\"></div>\n  <canvas class=\"ef-pla-cv\" aria-hidden=\"true\"></canvas>\n  <svg width=\"0\" height=\"0\" style=\"position:absolute\" aria-hidden=\"true\" focusable=\"false\"><defs><symbol id=\"ef-pla-pz1\" viewBox=\"1513.7 1453.9 322.3 322.3\">\r <path fill=\"currentColor\" d=\"M1821 1761.2h-292.3v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5.1 7.8 8.6 19.7 13.6 32.7 11.9 16.8-2.3 30.1-16 32-32.7 2.5-22.6-15.1-41.6-37.1-41.6-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.4-14.5-14.4v-111.7h292.3v111.7c0 8-6.4 14.4-14.5 14.4-4.2 0-8.1-1.8-10.9-5-7.9-8.6-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.6 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5z\"/>\r </symbol>\r\r<symbol id=\"ef-pla-pz4\" viewBox=\"1423.36 860.8 503.07 322.3\">\r <path fill=\"currentColor\" d=\"M1821 875.8v111.6c0 8 6.5 14.5 14.5 14.5 4.2 0 8.1-1.9 10.9-5 6.8-7.5 16.7-12.3 27.7-12.3 22 0 39.6 19 37.1 41.6-1.9 16.7-15.2 30.5-32 32.7-13 1.7-24.8-3.3-32.7-11.9-2.8-3.2-6.8-5-11-5-8 0-14.5 6.4-14.5 14.4v111.7h-111.6c-8 0-14.5-6.5-14.5-14.5 0-4.2 1.9-8.2 5-11 8.7-7.9 13.7-19.7 12-32.7-2.3-16.8-16-30.1-32.8-32-22.5-2.5-41.5 15.1-41.5 37.1 0 11 4.7 20.9 12.3 27.7 3.1 2.8 4.9 6.7 4.9 10.8v0.1c0 8-6.4 14.5-14.5 14.5h-111.6v-111.7c0-8-6.4-14.4-14.5-14.4-4.1 0-8 1.8-10.8 4.9-6.9 7.6-16.7 12.3-27.7 12.3-22 0-39.6-19-37.1-41.6 1.9-16.7 15.2-30.4 32-32.7 13-1.7 24.8 3.3 32.7 11.9 2.8 3.2 6.7 5.1 10.9 5.1 8.1 0 14.5-6.5 14.5-14.5v-111.6z\"/>\r </symbol>\r\r<symbol id=\"ef-pla-pz8\" viewBox=\"1513.7 166.86 322.3 503.06\">\r <path fill=\"currentColor\" d=\"M1528.7 564.5v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5 7.8 8.7 19.7 13.7 32.7 11.9 16.8-2.2 30.1-15.9 32-32.7 2.5-22.5-15.1-41.5-37.1-41.5-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.5-14.5-14.5v-111.6h111.6c8.1 0 14.5-6.5 14.5-14.5 0-4.1-1.8-8.1-4.9-10.9-7.6-6.8-12.3-16.6-12.3-27.6 0-22 19-39.6 41.5-37.1 16.8 1.8 30.5 15.2 32.8 32 1.7 12.9-3.3 24.8-12 32.7-3.1 2.8-5 6.7-5 10.9 0 8 6.5 14.5 14.5 14.5h111.6v111.6c0 8-6.4 14.5-14.5 14.5-4.2 0-8.1-1.9-10.9-5-7.9-8.7-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.5 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5v111.6h-111.6c-8 0-14.5 6.5-14.5 14.5 0 4.2 1.9 8.1 5 10.9 7.5 6.8 12.3 16.7 12.3 27.7 0 22-19 39.5-41.6 37.1-16.8-1.9-30.5-15.3-32.7-32-1.7-13 3.3-24.9 11.9-32.7 3.1-2.9 5-6.8 5-11 0-8-6.4-14.5-14.5-14.5z\"/>\r </symbol></defs></svg>\n  <svg class=\"ef-pla-pz ef-pla-pz--a\" aria-hidden=\"true\"><use href=\"#ef-pla-pz1\"/></svg>\n  <svg class=\"ef-pla-pz ef-pla-pz--b\" aria-hidden=\"true\"><use href=\"#ef-pla-pz4\"/></svg>\n  <svg class=\"ef-pla-pz ef-pla-pz--c\" aria-hidden=\"true\"><use href=\"#ef-pla-pz8\"/></svg>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-pla { position: relative; width: 100%; height: 100%; min-height: 18rem; overflow: hidden; background: #0c1e18; isolation: isolate; }\n.ef-pla-fb { position: absolute; inset: 0; background: conic-gradient(from 200deg at 40% 60%, #005236, #0a6b46, #e6ff55, #2f7d5b, #005236); }\n.ef-pla-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }\n.ef-pla.is-pix .ef-pla-cv { image-rendering: pixelated; }\n.ef-pla.is-ready .ef-pla-fb { opacity: 0; }\n.ef-pla-pz { position: absolute; color: #0c1e18; opacity: 0.35; pointer-events: none; will-change: transform; }\n.ef-pla-pz--a { aspect-ratio: 1; width: 24%; right: 9%; bottom: 12%; transform: rotate(12deg); animation: ef-pla-fa 12s ease-in-out infinite; }\n.ef-pla-pz--b { aspect-ratio: 503 / 322; width: 38%; left: 7%; top: 10%; color: #fbf8f1; opacity: 0.22; transform: rotate(-8deg); animation: ef-pla-fb 15s ease-in-out infinite; }\n.ef-pla-pz--c { aspect-ratio: 322 / 503; width: 11%; left: 52%; top: 14%; color: #fbf8f1; opacity: 0.3; transform: rotate(18deg); animation: ef-pla-fc 9s ease-in-out infinite; }\n@keyframes ef-pla-fa { 50% { transform: translateY(-14px) rotate(6deg); } }\n@keyframes ef-pla-fb { 50% { transform: translateY(12px) rotate(-3deg); } }\n@keyframes ef-pla-fc { 50% { transform: translateY(-9px) rotate(26deg); } }\n@media (prefers-reduced-motion: reduce) { .ef-pla-pz { animation: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Plasma field: a classic sum-of-sines colour field computed at low resolution on a 2D canvas and upscaled by CSS, mapped through a brand-green palette.\n// The pointer drops ripples that spread and fade. Reduced motion draws one still frame.\n// Original rebuild from the general idea of a plasma effect; palette is the Enrichr brand greens, lime and cream only.\n// mount(root, { accent, speed (0.1-3), scale (0.5-3), cell (3-14 px per sample), ripple (0-1), pixelated (\"on\"|\"off\") })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-pla\");\n  var cv = root.querySelector(\".ef-pla-cv\");\n  var ctx = cv.getContext(\"2d\");\n  var opts = {}, raf = 0, vis = true, io = null, ro = null, offs = [];\n  var W = 2, H = 2, img = null, lut = null, tAcc = 0, last = performance.now();\n  var rip = []; // {x,y,t}\n\n  function hex(h) {\n    var m = /^#?([0-9a-f]{6})$/i.exec(h || \"\");\n    var n = parseInt(m ? m[1] : \"e6ff55\", 16);\n    return [n >> 16, (n >> 8) & 255, n & 255];\n  }\n  function buildLut() {\n    var a = hex(opts.accent);\n    var stops = [[0.0, [12, 30, 24]], [0.25, [0, 82, 54]], [0.5, [10, 107, 70]], [0.68, [47, 125, 91]], [0.84, [198, 242, 107]], [0.94, a], [1.0, [251, 248, 241]]];\n    lut = new Uint8ClampedArray(256 * 3);\n    for (var i = 0; i < 256; i++) {\n      var v = i / 255, k = 0;\n      while (k < stops.length - 2 && v > stops[k + 1][0]) k++;\n      var s0 = stops[k], s1 = stops[k + 1], f = Math.max(0, Math.min(1, (v - s0[0]) / (s1[0] - s0[0])));\n      f = f * f * (3 - 2 * f);\n      for (var c = 0; c < 3; c++) lut[i * 3 + c] = s0[1][c] + (s1[1][c] - s0[1][c]) * f;\n    }\n  }\n  function size() {\n    var r = box.getBoundingClientRect();\n    W = Math.max(8, Math.round(r.width / opts.cell)); H = Math.max(8, Math.round(r.height / opts.cell));\n    if (cv.width !== W || cv.height !== H) { cv.width = W; cv.height = H; img = ctx.createImageData(W, H); }\n    if (!img) img = ctx.createImageData(W, H);\n  }\n  function draw() {\n    if (!img || !lut) return;\n    var d = img.data, t = tAcc, s = opts.scale * 6 / Math.max(W, H);\n    var i, x, y, v, p = 0;\n    // live ripples in canvas space\n    var rs = [];\n    for (i = 0; i < rip.length; i++) { var age = t - rip[i].t; rs.push(rip[i].x * W, rip[i].y * H, age); }\n    for (y = 0; y < H; y++) {\n      var fy = y * s;\n      for (x = 0; x < W; x++) {\n        var fx = x * s;\n        v = Math.sin(fx * 1.3 + t) + Math.sin(fy * 1.7 - t * 1.2) + Math.sin((fx + fy) * 0.9 + t * 0.7);\n        var cx = fx + 2 * Math.sin(t * 0.4), cy = fy + 2 * Math.cos(t * 0.33);\n        v += Math.sin(Math.sqrt(cx * cx + cy * cy) * 1.4 - t * 1.1);\n        for (i = 0; i < rs.length; i += 3) {\n          var dx = x - rs[i], dy = y - rs[i + 1], dist = Math.sqrt(dx * dx + dy * dy), age2 = rs[i + 2];\n          var wave = dist - age2 * 14;\n          v += opts.ripple * 2.2 * Math.sin(wave * 0.7) * Math.exp(-wave * wave * 0.02) * Math.exp(-age2 * 0.9);\n        }\n        var q = (v / 4 + 1) * 0.5;\n        var idx = (q < 0 ? 0 : q > 1 ? 255 : (q * 255) | 0) * 3;\n        d[p] = lut[idx]; d[p + 1] = lut[idx + 1]; d[p + 2] = lut[idx + 2]; d[p + 3] = 255;\n        p += 4;\n      }\n    }\n    ctx.putImageData(img, 0, 0);\n    box.classList.add(\"is-ready\");\n  }\n  function frame(now) {\n    raf = 0;\n    var dt = Math.min(0.05, (now - last) / 1000); last = now;\n    tAcc += dt * opts.speed;\n    rip = rip.filter(function (r) { return tAcc - r.t < 4; });\n    draw();\n    if (vis && !reduce) raf = requestAnimationFrame(frame);\n  }\n  function kick() {\n    if (reduce) { size(); tAcc = 3.2; draw(); return; }\n    if (!raf && vis) { last = performance.now(); raf = requestAnimationFrame(frame); }\n  }\n  function on(el, ev, fn) { el.addEventListener(ev, fn); offs.push(function () { el.removeEventListener(ev, fn); }); }\n  var lastDrop = 0;\n  function drop(e) {\n    if (reduce) return;\n    var n = performance.now();\n    if (e.type === \"pointermove\" && n - lastDrop < 140) return;\n    lastDrop = n;\n    var r = box.getBoundingClientRect();\n    rip.push({ x: (e.clientX - r.left) / r.width, y: (e.clientY - r.top) / r.height, t: tAcc });\n    if (rip.length > 8) rip.shift();\n  }\n  on(box, \"pointermove\", drop);\n  on(box, \"pointerdown\", drop);\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { size(); if (reduce) draw(); }); ro.observe(box); }\n  else on(window, \"resize\", size);\n  if (\"IntersectionObserver\" in window) {\n    io = new IntersectionObserver(function (en) { vis = en[0].isIntersecting; if (vis) kick(); else if (raf) { cancelAnimationFrame(raf); raf = 0; } });\n    io.observe(box);\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ accent: \"#e6ff55\", speed: 1, scale: 1.2, cell: 8, ripple: 0.8, pixelated: \"off\" }, opts, next || {});\n    opts.cell = Math.max(3, Math.min(14, opts.cell));\n    box.classList.toggle(\"is-pix\", opts.pixelated === \"on\" || opts.pixelated === true);\n    if (prev.accent !== opts.accent || !lut) buildLut();\n    if (prev.cell !== opts.cell || !img) size();\n    kick();\n    if (!raf) draw();\n  }\n  function destroy() {\n    if (raf) cancelAnimationFrame(raf); raf = 0; vis = false;\n    if (io) io.disconnect(); if (ro) ro.disconnect();\n    offs.forEach(function (f) { f(); }); offs = [];\n  }\n  update(o);\n  return { update: update, destroy: destroy };\n}"
  }
}