{
  "id": "invert-ripple-cursor",
  "kind": "element",
  "title": "Ripple invert cursor",
  "summary": "A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.",
  "url": "https://enrichr.dev/elements/invert-ripple-cursor.html",
  "section": "page",
  "techniques": [
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "SVG filter",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "playful"
  ],
  "intents": [
    "invert colours under the cursor",
    "difference blend mode cursor",
    "liquid ripple cursor on fast mouse movement",
    "big circle cursor over headline",
    "jiggly distortion cursor effect"
  ],
  "status": "tested",
  "params": [
    {
      "key": "title",
      "label": "Headline",
      "type": "text",
      "value": "Invert"
    },
    {
      "key": "subtitle",
      "label": "Subtitle",
      "type": "text",
      "value": "Move the pointer fast to ripple"
    },
    {
      "key": "size",
      "label": "Circle size (px)",
      "type": "range",
      "min": 80,
      "max": 320,
      "step": 4,
      "value": 200
    },
    {
      "key": "ripple",
      "label": "Ripple strength (0 = off)",
      "type": "range",
      "min": 0,
      "max": 600,
      "step": 10,
      "value": 600
    },
    {
      "key": "smoothing",
      "label": "Follow (1 = no lag)",
      "type": "range",
      "min": 0.05,
      "max": 1,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "spin",
      "label": "Spin (degrees per frame)",
      "type": "range",
      "min": 0,
      "max": 2,
      "step": 0.1,
      "value": 0.3
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#ffffff"
    },
    {
      "key": "textColor",
      "label": "Text colour",
      "type": "color",
      "value": "#000000"
    }
  ],
  "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 \"Ripple invert cursor\" element to this project.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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/invert-ripple-cursor.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 \"Ripple invert cursor\" 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 \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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 \"Ripple invert cursor\" element to this codebase.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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-invert-ripple-cursor.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Ripple invert cursor 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 \"Ripple invert cursor\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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- invert-ripple-cursor.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 \"./invert-ripple-cursor\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InvertRippleCursor(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 \"Ripple invert cursor\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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- invert-ripple-cursor.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/InvertRippleCursor.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./invert-ripple-cursor\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InvertRippleCursor(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 \"Ripple invert cursor\" element.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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), invert-ripple-cursor.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 \"Ripple invert cursor\" element. No packages, no server code.\n\nThis is the \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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 invert-ripple-cursor.js and then main.js), style.css (the CSS below), invert-ripple-cursor.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 \"Ripple invert cursor\" 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 \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.json\n\nWhat it does: A white circle sits above the content with mix-blend-mode: difference, so wherever it overlaps, white turns black and black turns white. The circle also carries an SVG filter: feTurbulence draws a soft, low-frequency noise field and feDisplacementMap pushes the circle's pixels around by that noise. Each frame the script measures how far the circle moved since the last frame, multiplies that speed into a target distortion (capped by the ripple setting) and eases the filter's scale toward it by 5 percent a frame, so a fast flick makes the edge boil and it then settles back into a clean circle. A slow constant spin turns the noise pattern while it is distorted, which keeps the ripple from looking frozen. The filter is only attached while the distortion is above zero.\nAccessibility: The circle is decorative, hidden from assistive technology and ignores pointer events, so links and text underneath stay usable and selectable. The headline is real text. With reduced motion the circle jumps straight to the pointer with no lag, ripple or spin. Inverting a large area can be harsh: keep it to a hero or a single section rather than a whole page.\n\nTunable settings:\n- Headline: text, default Invert\n- Subtitle: text, default Move the pointer fast to ripple\n- Circle size (px): range 80 to 320, step 4, default 200\n- Ripple strength (0 = off): range 0 to 600, step 10, default 600\n- Follow (1 = no lag): range 0.05 to 1, step 0.05, default 1\n- Spin (degrees per frame): range 0 to 2, step 0.1, default 0.3\n- Background: color, default #ffffff\n- Text colour: color, default #000000\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/invert-ripple-cursor.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 \"Ripple invert cursor\" 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 \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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 InvertRippleCursor.\n2. Paste the JavaScript below into a separate code file named invert-ripple-cursor.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 \"./invert-ripple-cursor\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InvertRippleCursor(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(InvertRippleCursor, {\n  title: { type: ControlType.String, title: \"Headline\", defaultValue: \"Invert\" },\n  subtitle: { type: ControlType.String, title: \"Subtitle\", defaultValue: \"Move the pointer fast to ripple\" },\n  size: { type: ControlType.Number, title: \"Circle size\", min: 80, max: 320, step: 4, defaultValue: 200 },\n  ripple: { type: ControlType.Number, title: \"Ripple strength\", min: 0, max: 600, step: 10, defaultValue: 600 },\n  smoothing: { type: ControlType.Number, title: \"Follow\", min: 0.05, max: 1, step: 0.05, defaultValue: 1 },\n  spin: { type: ControlType.Number, title: \"Spin\", min: 0, max: 2, step: 0.1, defaultValue: 0.3 },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#ffffff\" },\n  textColor: { type: ControlType.Color, title: \"Text colour\", defaultValue: \"#000000\" },\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 \"Ripple invert cursor\" 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 \"Ripple invert cursor\" element from the Enrichr Library: A big white circle follows the pointer and inverts everything beneath it, and its edge ripples like liquid when you move fast.\nPage: https://enrichr.dev/elements/invert-ripple-cursor.html\nMachine-readable spec: https://enrichr.dev/elements/invert-ripple-cursor.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-invert-ripple-cursor\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-invert-ripple-cursor\"), { ...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 circle is decorative, hidden from assistive technology and ignores pointer events, so links and text underneath stay usable and selectable. The headline is real text. With reduced motion the circle jumps straight to the pointer with no lag, ripple or spin. Inverting a large area can be harsh: keep it to a hero or a single section rather than a whole page.",
  "performance": "One requestAnimationFrame loop runs only while the circle is moving or rippling and stops once it settles; it also pauses when the element is off screen. Each frame writes one transform, and the filter scale attribute only when its rounded value changes. Large displacement values on a big circle cost more to paint, so lower the ripple strength if a low-end phone stutters.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-irc\"><div class=\"ef-irc__zone\"><h2 class=\"ef-irc__t\"></h2><p class=\"ef-irc__s\"></p><div class=\"ef-irc__blob\" aria-hidden=\"true\"></div></div></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-irc__zone { position: relative; isolation: isolate; overflow: hidden; min-height: 20rem; padding: 2rem 1.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 1rem; touch-action: pan-y; container-type: inline-size; }\n.ef-irc .ef-irc__t { margin: 0; font-size: clamp(2.6rem, 13vw, 8rem); font-size: clamp(2.6rem, 17cqi, 8rem); font-weight: 900; line-height: 1; letter-spacing: -0.05em; text-transform: uppercase; overflow-wrap: anywhere; }\n.ef-irc .ef-irc__s { margin: 1rem 0 0; opacity: 1; font-size: clamp(1rem, 2.4vw, 1.5rem); font-weight: 500; }\n.ef-irc__blob { position: absolute; left: 0; top: 0; z-index: 2; width: var(--ef-size, 200px); height: var(--ef-size, 200px); border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none; will-change: transform; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Ripple invert cursor: a big white circle follows the pointer and inverts the colours beneath it (mix-blend-mode: difference).\n// Move fast and its edge ripples like liquid: an SVG turbulence + displacement filter whose strength follows pointer speed, then settles.\n// mount(root, { title, subtitle, size (px), ripple (max distortion 0-600), smoothing (0.05-1, 1 = no lag), spin (degrees per frame), background, textColor })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var zone = root.querySelector(\".ef-irc__zone\"), blob = root.querySelector(\".ef-irc__blob\");\n  var title = root.querySelector(\".ef-irc__t\"), sub = root.querySelector(\".ef-irc__s\");\n  var NS = \"http://www.w3.org/2000/svg\", id = \"ef-irc-\" + Math.random().toString(36).slice(2, 8);\n  var svg = document.createElementNS(NS, \"svg\"), f = document.createElementNS(NS, \"filter\");\n  var turb = document.createElementNS(NS, \"feTurbulence\"), disp = document.createElementNS(NS, \"feDisplacementMap\");\n  svg.setAttribute(\"aria-hidden\", \"true\"); svg.setAttribute(\"width\", \"0\"); svg.setAttribute(\"height\", \"0\");\n  svg.style.cssText = \"position:absolute;width:0;height:0;pointer-events:none\";\n  f.setAttribute(\"id\", id); f.setAttribute(\"x\", \"-50%\"); f.setAttribute(\"y\", \"-50%\"); f.setAttribute(\"width\", \"200%\"); f.setAttribute(\"height\", \"200%\");\n  turb.setAttribute(\"type\", \"fractalNoise\"); turb.setAttribute(\"baseFrequency\", \"0.015\"); turb.setAttribute(\"numOctaves\", \"1\"); turb.setAttribute(\"result\", \"noise\");\n  disp.setAttribute(\"in\", \"SourceGraphic\"); disp.setAttribute(\"in2\", \"noise\"); disp.setAttribute(\"scale\", \"0\");\n  disp.setAttribute(\"xChannelSelector\", \"R\"); disp.setAttribute(\"yChannelSelector\", \"G\");\n  f.appendChild(turb); f.appendChild(disp); svg.appendChild(f); zone.appendChild(svg);\n\n  var opts = {}, raf = 0, visible = true, io = null, ro = null, placed = false;\n  var tx = 0, ty = 0, x = 0, y = 0, lx = 0, ly = 0, scale = 0, target = 0, angle = 0, shown = -1;\n\n  function center() { if (placed) return; tx = x = lx = zone.clientWidth / 2; ty = y = ly = zone.clientHeight / 2; }\n  function paint() {\n    blob.style.transform = \"translate3d(\" + x.toFixed(1) + \"px,\" + y.toFixed(1) + \"px,0) translate(-50%,-50%) rotate(\" + angle.toFixed(1) + \"deg)\";\n    var s = Math.round(scale);\n    if (s !== shown) { shown = s; disp.setAttribute(\"scale\", String(s)); blob.style.filter = s > 0 ? \"url(#\" + id + \")\" : \"\"; }\n  }\n  function frame() {\n    raf = 0;\n    if (!visible) return;\n    var k = reduce ? 1 : opts.smoothing;\n    x += (tx - x) * k;\n    y += (ty - y) * k;\n    var dx = x - lx, dy = y - ly;\n    lx = x; ly = y;\n    var speed = Math.sqrt(dx * dx + dy * dy);\n    target = reduce ? 0 : Math.min(speed * 20, opts.ripple);\n    scale += (target - scale) * 0.05;\n    if (!reduce) angle = (angle + opts.spin) % 360;\n    paint();\n    var moving = Math.abs(tx - x) > 0.3 || Math.abs(ty - y) > 0.3 || scale > 0.5 || target > 0;\n    if (moving) raf = requestAnimationFrame(frame);\n    else if (scale !== 0) { scale = 0; paint(); }\n  }\n  function wake() { if (!raf && visible) raf = requestAnimationFrame(frame); }\n  function move(e) {\n    var r = zone.getBoundingClientRect();\n    tx = e.clientX - r.left;\n    ty = e.clientY - r.top;\n    if (!placed) { placed = true; if (reduce) { x = lx = tx; y = ly = ty; } }\n    wake();\n  }\n  function update(next) {\n    opts = Object.assign({ title: \"Invert\", subtitle: \"Move the pointer fast to ripple\", size: 200, ripple: 600, smoothing: 1, spin: 0.3, background: \"#ffffff\", textColor: \"#000000\" }, opts, next || {});\n    opts.size = Number(opts.size); opts.ripple = Number(opts.ripple); opts.smoothing = Math.max(0.02, Math.min(1, Number(opts.smoothing))); opts.spin = Number(opts.spin);\n    zone.style.background = opts.background;\n    zone.style.color = opts.textColor;\n    title.style.color = sub.style.color = opts.textColor;\n    zone.style.setProperty(\"--ef-size\", opts.size + \"px\");\n    title.textContent = opts.title;\n    sub.textContent = opts.subtitle;\n    sub.hidden = !opts.subtitle;\n    center();\n    paint();\n  }\n  update(o);\n  zone.addEventListener(\"pointermove\", move);\n  zone.addEventListener(\"pointerdown\", move);\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { center(); paint(); }); ro.observe(zone); }\n  if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; if (visible) wake(); }); io.observe(zone); }\n  return {\n    update: update,\n    destroy: function () {\n      cancelAnimationFrame(raf); raf = 0;\n      if (io) io.disconnect(); if (ro) ro.disconnect();\n      zone.removeEventListener(\"pointermove\", move); zone.removeEventListener(\"pointerdown\", move);\n      if (svg.parentNode) svg.parentNode.removeChild(svg);\n    }\n  };\n}"
  }
}