{
  "id": "rain-water-drops",
  "kind": "element",
  "title": "Rain water drops on glass",
  "summary": "Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.",
  "url": "https://enrichr.dev/elements/rain-water-drops.html",
  "section": "background",
  "techniques": [
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "Canvas 2D"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "immersive",
    "calm",
    "cinematic"
  ],
  "intents": [
    "rain on window effect",
    "water drops on glass canvas",
    "raindrop refraction background",
    "click to add water drop",
    "blurred glass pane with running drops"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "rain",
      "label": "Rain (drops per second)",
      "type": "range",
      "min": 0,
      "max": 8,
      "step": 0.2,
      "value": 1.6
    },
    {
      "key": "size",
      "label": "Drop size",
      "type": "range",
      "min": 0.6,
      "max": 1.6,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "refraction",
      "label": "Refraction",
      "type": "range",
      "min": 0,
      "max": 1,
      "step": 0.05,
      "value": 0.6
    },
    {
      "key": "blur",
      "label": "Glass blur",
      "type": "range",
      "min": 4,
      "max": 16,
      "step": 1,
      "value": 8
    }
  ],
  "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 \"Rain water drops on glass\" element to this project.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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/rain-water-drops.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 \"Rain water drops on glass\" 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 \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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 \"Rain water drops on glass\" element to this codebase.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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-rain-water-drops.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Rain water drops on glass 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 \"Rain water drops on glass\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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- rain-water-drops.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 \"./rain-water-drops\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RainWaterDrops(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 \"Rain water drops on glass\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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- rain-water-drops.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/RainWaterDrops.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./rain-water-drops\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RainWaterDrops(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 \"Rain water drops on glass\" element.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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), rain-water-drops.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 \"Rain water drops on glass\" element. No packages, no server code.\n\nThis is the \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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 rain-water-drops.js and then main.js), style.css (the CSS below), rain-water-drops.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 \"Rain water drops on glass\" 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 \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.json\n\nWhat it does: The scene is painted once to a sharp canvas: a green gradient, soft colour blobs and several puzzle pieces. A blurred copy is made by shrinking it to a small canvas and drawing it back up, and that copy is the pane you see. Drops are then drawn on top. Small ones are just a dark rim and a highlight. Bigger ones also clip to the drop shape and draw the sharp canvas inside it, rotated 180 degrees and covering a wider area than the drop, which is how a real drop looks like a tiny inverted lens. Running drops speed up and stall at random, wiggle a little, leave a fading trail and shed small droplets behind them, and they swallow any small droplet they touch and grow. A click or tap spawns a larger running drop at that point.\nAccessibility: Decorative: the canvas is hidden from assistive tech and carries no information. Click spawning is a bonus, nothing depends on it. With prefers-reduced-motion the rain is pre-run for a few seconds and drawn as one still frame, and a click only adds a still drop.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Rain (drops per second): range 0 to 8, step 0.2, default 1.6\n- Drop size: range 0.6 to 1.6, step 0.1, default 1\n- Refraction: range 0 to 1, step 0.05, default 0.6\n- Glass blur: range 4 to 16, step 1, default 8\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/rain-water-drops.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 \"Rain water drops on glass\" 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 \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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 RainWaterDrops.\n2. Paste the JavaScript below into a separate code file named rain-water-drops.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 \"./rain-water-drops\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RainWaterDrops(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(RainWaterDrops, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  rain: { type: ControlType.Number, title: \"Rain\", min: 0, max: 8, step: 0.2, defaultValue: 1.6 },\n  size: { type: ControlType.Number, title: \"Drop size\", min: 0.6, max: 1.6, step: 0.1, defaultValue: 1 },\n  refraction: { type: ControlType.Number, title: \"Refraction\", min: 0, max: 1, step: 0.05, defaultValue: 0.6 },\n  blur: { type: ControlType.Number, title: \"Glass blur\", min: 4, max: 16, step: 1, defaultValue: 8 },\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 \"Rain water drops on glass\" 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 \"Rain water drops on glass\" element from the Enrichr Library: Water drops run down a glass pane over a blurred green gradient, leaving trails and droplets. Each drop acts as a small lens that shows the sharp scene, including puzzle pieces, upside-down. Click or tap to add a drop.\nPage: https://enrichr.dev/elements/rain-water-drops.html\nMachine-readable spec: https://enrichr.dev/elements/rain-water-drops.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-rain-water-drops\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-rain-water-drops\"), { ...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: the canvas is hidden from assistive tech and carries no information. Click spawning is a bonus, nothing depends on it. With prefers-reduced-motion the rain is pre-run for a few seconds and drawn as one still frame, and a click only adds a still drop.",
  "performance": "Each drop larger than a few pixels does one clip and one drawImage from the sharp canvas, and the number of drops is capped (about 260 static and 14 running). The pixel ratio is capped at 1.5, the loop pauses when off screen and stops on destroy(). Fewer drops or a higher blur value lower the cost.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-rwd\">\n  <div class=\"ef-rwd__wrap\">\n    <canvas class=\"ef-rwd__cv\" aria-hidden=\"true\"></canvas>\n    <svg class=\"ef-rwd__src\" aria-hidden=\"true\" focusable=\"false\">\n      <path data-vb=\"1513.7 1453.9 322.3 322.3\" 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\"/>\n      <path data-vb=\"1423.36 860.8 503.07 322.3\" 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\"/>\n      <path data-vb=\"1513.7 166.86 322.3 503.06\" 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\"/>\n    </svg>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-rwd { width: 100%; height: 100%; }\n.ef-rwd__wrap { position: relative; box-sizing: border-box; width: 100%; height: 100%; min-height: 18rem; border-radius: 1rem; overflow: hidden; background: #0c1e18; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }\n.ef-rwd__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }\n.ef-rwd__src { position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Rain on a window pane: a blurred green gradient scene (with puzzle pieces) sits behind the glass; water drops run down it leaving trails and\n// small droplets. Each bigger drop is a tiny lens: it redraws the sharp scene upside-down and magnified inside itself, with a rim shade and a\n// highlight. Click or tap to spawn a drop. Canvas 2D only. Reduced motion pre-runs the rain and draws one still frame.\n// mount(root, { background, accent, rain (0-8 drops/s), size (0.6-1.6), refraction (0-1), blur (4-16) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-rwd__wrap\");\n  var cv = root.querySelector(\".ef-rwd__cv\");\n  var ctx = cv.getContext(\"2d\");\n  var shapes = Array.prototype.map.call(root.querySelectorAll(\".ef-rwd__src path\"), function (p) {\n    var vb = p.getAttribute(\"data-vb\").split(/\\s+/).map(Number);\n    return { p: new Path2D(p.getAttribute(\"d\")), x: vb[0], y: vb[1], w: vb[2], h: vb[3] };\n  });\n  var opts = {}, W = 0, H = 0, S = 1, last = 0, raf = 0, vis = true, dead = false, acc = 0, offs = [];\n  var sharp = document.createElement(\"canvas\"), soft = document.createElement(\"canvas\");\n  var statics = [], runners = [];\n  var MAXSTATIC = 260;\n\n  function rnd(a, b) { return a + Math.random() * (b - a); }\n  function piece(g, s, cx, cy, size, rot, col, al) {\n    g.save(); g.translate(cx, cy); g.rotate(rot);\n    var k = size / Math.max(s.w, s.h); g.scale(k, k); g.translate(-(s.x + s.w / 2), -(s.y + s.h / 2));\n    g.globalAlpha = al; g.fillStyle = col; g.fill(s.p); g.restore();\n  }\n  function buildScene() {\n    if (!W || !H) return;\n    sharp.width = Math.round(W * S); sharp.height = Math.round(H * S);\n    var g = sharp.getContext(\"2d\"), m = Math.min(W, H);\n    g.setTransform(S, 0, 0, S, 0, 0);\n    var bg = g.createLinearGradient(0, 0, W, H);\n    bg.addColorStop(0, opts.background); bg.addColorStop(0.55, \"#005236\"); bg.addColorStop(1, \"#0a6b46\");\n    g.fillStyle = bg; g.fillRect(0, 0, W, H);\n    function blob(x, y, r, col, a) {\n      var rg = g.createRadialGradient(x * W, y * H, 0, x * W, y * H, r * m);\n      rg.addColorStop(0, col); rg.addColorStop(1, \"rgba(0,0,0,0)\");\n      g.globalAlpha = a; g.fillStyle = rg; g.fillRect(0, 0, W, H); g.globalAlpha = 1;\n    }\n    blob(0.78, 0.22, 0.55, opts.accent, 0.6);\n    blob(0.18, 0.82, 0.5, \"#c6f26b\", 0.38);\n    blob(0.5, 0.55, 0.45, \"#2f7d5b\", 0.5);\n    if (shapes.length === 3) {\n      piece(g, shapes[0], W * 0.2, H * 0.3, m * 0.3, -0.22, opts.accent, 0.95);\n      piece(g, shapes[1], W * 0.66, H * 0.74, m * 0.5, 0.12, \"#fbf8f1\", 0.9);\n      piece(g, shapes[2], W * 0.86, H * 0.3, m * 0.34, 0.25, \"#c6f26b\", 0.9);\n      piece(g, shapes[0], W * 0.38, H * 0.82, m * 0.18, 0.5, \"#2f7d5b\", 0.95);\n      piece(g, shapes[2], W * 0.1, H * 0.7, m * 0.22, -0.3, \"#fbf8f1\", 0.8);\n    }\n    var div = Math.max(2, opts.blur), bw = Math.ceil(W / div), bh = Math.ceil(H / div);\n    var tmp = document.createElement(\"canvas\"); tmp.width = bw; tmp.height = bh;\n    var tg = tmp.getContext(\"2d\"); tg.imageSmoothingQuality = \"high\"; tg.drawImage(sharp, 0, 0, bw, bh);\n    soft.width = bw; soft.height = bh;\n    var sg = soft.getContext(\"2d\"); sg.imageSmoothingQuality = \"high\";\n    if (\"filter\" in sg) sg.filter = \"blur(2px)\";\n    sg.drawImage(tmp, 0, 0);\n  }\n  function seed() {\n    statics = []; runners = [];\n    var n = Math.min(MAXSTATIC - 40, Math.round((W * H) / 3000));\n    for (var i = 0; i < n; i++) statics.push({ x: rnd(0, W), y: rnd(0, H), r: Math.pow(Math.random(), 1.9) * 7 + 1.6, life: -1 });\n    for (var j = 0; j < 4; j++) spawn(rnd(0.1, 0.9) * W, rnd(0.05, 0.6) * H, rnd(11, 16));\n  }\n  function spawn(x, y, r) {\n    if (runners.length > 14) runners.shift();\n    runners.push({ x: x, y: y, r: r * opts.size, vy: rnd(30, 60), mode: 1, tm: rnd(0.3, 0.9), dist: 0, trail: [], ph: rnd(0, 6) });\n  }\n  function step(dt) {\n    acc += dt * opts.rain;\n    while (acc >= 1) { acc -= 1; spawn(rnd(0.04, 0.96) * W, rnd(-0.02, 0.5) * H, rnd(9, 15)); }\n    for (var i = runners.length - 1; i >= 0; i--) {\n      var d = runners[i];\n      d.tm -= dt;\n      if (d.tm <= 0) { d.mode = d.mode ? 0 : 1; d.tm = d.mode ? rnd(0.35, 1) : rnd(0.12, 0.5); }\n      var top = 34 + d.r * 12;\n      d.vy += ((d.mode ? top : 4) - d.vy) * Math.min(1, dt * 5);\n      var mvY = d.vy * dt;\n      d.y += mvY; d.x += Math.sin(d.y * 0.04 + d.ph) * 4 * dt; d.dist += mvY;\n      d.trail.push({ x: d.x, y: d.y, a: 1 });\n      for (var k = d.trail.length - 1; k >= 0; k--) { d.trail[k].a -= dt * 0.45; if (d.trail[k].a <= 0) { d.trail.splice(0, k + 1); break; } }\n      if (d.dist > d.r * 1.7 + 8) {\n        d.dist = 0;\n        if (statics.length < MAXSTATIC) statics.push({ x: d.x + rnd(-1, 1), y: d.y - d.r, r: Math.max(1.2, d.r * rnd(0.14, 0.24) / opts.size), life: 12 + Math.random() * 6 });\n        d.r = Math.max(2, d.r * 0.985);\n      }\n      for (var s = statics.length - 1; s >= 0; s--) {\n        var q = statics[s], dx = q.x - d.x, dy = q.y - d.y, rr = q.r * opts.size;\n        if (dx * dx + dy * dy < Math.pow(d.r + rr * 0.5, 2) && rr < d.r * 0.8) {\n          d.r = Math.min(22 * opts.size, Math.sqrt(d.r * d.r + rr * rr * 0.5));\n          statics.splice(s, 1);\n        }\n      }\n      if (d.y - d.r > H || d.r < 2.2) runners.splice(i, 1);\n    }\n    for (var j = statics.length - 1; j >= 0; j--) {\n      var st = statics[j];\n      if (st.life >= 0) { st.life -= dt; if (st.life <= 0) statics.splice(j, 1); }\n    }\n  }\n  function drop(x, y, r, tall, fade) {\n    var rx = r * 0.9, ry = r * (tall ? 1.18 : 1);\n    ctx.save();\n    ctx.globalAlpha = fade;\n    if (r > 3.4) {\n      ctx.beginPath(); ctx.ellipse(x, y, rx, ry, 0, 0, 6.2832); ctx.clip();\n      var kk = 1 + opts.refraction * 2.2, sw = 2 * rx * kk, sh = 2 * ry * kk;\n      ctx.translate(x, y); ctx.rotate(Math.PI);\n      ctx.drawImage(sharp, (x - sw / 2) * S, (y - sh / 2) * S, sw * S, sh * S, -rx, -ry, 2 * rx, 2 * ry);\n      ctx.rotate(-Math.PI); ctx.translate(-x, -y);\n    }\n    var gr = ctx.createRadialGradient(x, y - ry * 0.15, ry * 0.2, x, y, ry * 1.05);\n    gr.addColorStop(0, \"rgba(12,30,24,0)\");\n    gr.addColorStop(0.75, \"rgba(12,30,24,\" + (r > 3.4 ? 0.12 : 0.34) + \")\");\n    gr.addColorStop(1, \"rgba(12,30,24,0.62)\");\n    ctx.fillStyle = gr; ctx.beginPath(); ctx.ellipse(x, y, rx, ry, 0, 0, 6.2832); ctx.fill();\n    var lg = ctx.createRadialGradient(x, y + ry * 0.55, 0, x, y + ry * 0.55, ry * 0.8);\n    lg.addColorStop(0, \"rgba(198,242,107,0.34)\"); lg.addColorStop(1, \"rgba(198,242,107,0)\");\n    ctx.fillStyle = lg; ctx.beginPath(); ctx.ellipse(x, y, rx, ry, 0, 0, 6.2832); ctx.fill();\n    ctx.restore();\n    ctx.save();\n    ctx.globalAlpha = fade;\n    ctx.fillStyle = \"rgba(251,248,241,0.88)\";\n    ctx.beginPath(); ctx.ellipse(x - rx * 0.36, y - ry * 0.42, rx * 0.2, ry * 0.12, -0.6, 0, 6.2832); ctx.fill();\n    ctx.fillStyle = \"rgba(251,248,241,0.28)\";\n    ctx.beginPath(); ctx.ellipse(x + rx * 0.3, y + ry * 0.55, rx * 0.2, ry * 0.07, -0.5, 0, 6.2832); ctx.fill();\n    ctx.restore();\n  }\n  function draw() {\n    if (!W || !H) return;\n    ctx.setTransform(S, 0, 0, S, 0, 0);\n    ctx.imageSmoothingEnabled = true; ctx.imageSmoothingQuality = \"high\";\n    ctx.drawImage(soft, 0, 0, W, H);\n    var veil = ctx.createLinearGradient(0, 0, 0, H);\n    veil.addColorStop(0, \"rgba(251,248,241,0.06)\"); veil.addColorStop(1, \"rgba(12,30,24,0.14)\");\n    ctx.fillStyle = veil; ctx.fillRect(0, 0, W, H);\n    var i, k;\n    ctx.lineCap = \"round\";\n    for (i = 0; i < runners.length; i++) {\n      var d = runners[i], tr = d.trail;\n      for (k = 1; k < tr.length; k++) {\n        ctx.strokeStyle = \"rgba(251,248,241,\" + (0.1 * tr[k].a).toFixed(3) + \")\";\n        ctx.lineWidth = Math.max(1, d.r * 0.55 * (0.4 + 0.6 * tr[k].a));\n        ctx.beginPath(); ctx.moveTo(tr[k - 1].x, tr[k - 1].y); ctx.lineTo(tr[k].x, tr[k].y); ctx.stroke();\n      }\n    }\n    for (i = 0; i < statics.length; i++) {\n      var s = statics[i], f = s.life >= 0 && s.life < 2 ? s.life / 2 : 1;\n      drop(s.x, s.y, s.r * opts.size, false, f);\n    }\n    for (i = 0; i < runners.length; i++) drop(runners[i].x, runners[i].y, runners[i].r, true, 1);\n  }\n  function size() {\n    var r = wrap.getBoundingClientRect();\n    if (!r.width || !r.height) return;\n    W = r.width; H = r.height;\n    S = Math.min(window.devicePixelRatio || 1, 1.5);\n    cv.width = Math.round(W * S); cv.height = Math.round(H * S);\n    buildScene(); seed();\n    if (reduce) still(); else draw();\n  }\n  function still() {\n    for (var i = 0; i < 90; i++) step(1 / 30);\n    draw();\n  }\n  function frame(ts) {\n    raf = 0;\n    if (!vis || dead) return;\n    var dt = Math.min(0.05, (ts - last) / 1000 || 0.016); last = ts;\n    step(dt); draw();\n    raf = requestAnimationFrame(frame);\n  }\n  function start() { if (reduce || raf || !vis || dead) return; last = performance.now(); raf = requestAnimationFrame(frame); }\n  function stop() { if (raf) cancelAnimationFrame(raf); raf = 0; }\n  function down(e) {\n    var r = wrap.getBoundingClientRect();\n    var x = e.clientX - r.left, y = e.clientY - r.top;\n    if (reduce) { statics.push({ x: x, y: y, r: rnd(7, 10), life: -1 }); draw(); return; }\n    spawn(x, y, rnd(13, 18));\n  }\n  wrap.addEventListener(\"pointerdown\", down);\n  offs.push(function () { wrap.removeEventListener(\"pointerdown\", down); });\n  var ro = null, io = null;\n  if (window.ResizeObserver) { ro = new ResizeObserver(size); ro.observe(wrap); } else { window.addEventListener(\"resize\", size); offs.push(function () { window.removeEventListener(\"resize\", size); }); }\n  if (window.IntersectionObserver) {\n    io = new IntersectionObserver(function (en) { vis = en[en.length - 1].isIntersecting; if (vis) start(); else stop(); });\n    io.observe(wrap);\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", rain: 1.6, size: 1, refraction: 0.6, blur: 8 }, opts, next || {});\n    opts.blur = Math.max(4, Math.min(16, opts.blur));\n    wrap.style.background = opts.background;\n    if (prev.accent !== opts.accent || prev.blur !== opts.blur || prev.background !== opts.background) { buildScene(); if (reduce) draw(); }\n    else if (reduce) draw();\n    if (!prev.rain && prev.rain !== 0) { size(); }\n    start();\n  }\n  update(o);\n  return {\n    update: update,\n    destroy: function () {\n      dead = true; stop();\n      if (ro) ro.disconnect();\n      if (io) io.disconnect();\n      offs.forEach(function (f) { f(); }); offs = [];\n    }\n  };\n}"
  }
}