{
  "id": "jiggle-cursor-dot",
  "kind": "element",
  "title": "Jiggle cursor dot",
  "summary": "A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.",
  "url": "https://enrichr.dev/elements/jiggle-cursor-dot.html",
  "section": "page",
  "techniques": [
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "SVG filter",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "playful",
    "tactile"
  ],
  "intents": [
    "jelly cursor follower",
    "wobbly custom cursor dot",
    "cursor dot with displacement filter",
    "liquid cursor effect svg",
    "cursor that jiggles on fast movement"
  ],
  "status": "tested",
  "params": [
    {
      "key": "color",
      "label": "Dot colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "opacity",
      "label": "Opacity",
      "type": "range",
      "min": 0.1,
      "max": 1,
      "step": 0.05,
      "value": 0.6
    },
    {
      "key": "size",
      "label": "Size (px)",
      "type": "range",
      "min": 10,
      "max": 80,
      "step": 1,
      "value": 20
    },
    {
      "key": "jiggle",
      "label": "Jiggle (x per pixel moved)",
      "type": "range",
      "min": 0,
      "max": 50,
      "step": 1,
      "value": 20
    },
    {
      "key": "spin",
      "label": "Spin (degrees per frame)",
      "type": "range",
      "min": 0,
      "max": 3,
      "step": 0.05,
      "value": 0.3
    },
    {
      "key": "blend",
      "label": "Blend mode",
      "type": "select",
      "options": [
        [
          "lighten",
          "Lighten"
        ],
        [
          "normal",
          "Normal"
        ],
        [
          "screen",
          "Screen"
        ],
        [
          "difference",
          "Difference"
        ],
        [
          "darken",
          "Darken (for light backgrounds)"
        ]
      ],
      "value": "lighten"
    },
    {
      "key": "idle",
      "label": "Idle demo darts",
      "type": "select",
      "options": [
        [
          "on",
          "On"
        ],
        [
          "off",
          "Off"
        ]
      ],
      "value": "on"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    }
  ],
  "license": "Free to use in personal and client projects during the preview. Final licence terms will be published here before any paid tier starts; ask before reselling the code as a collection.",
  "contract": "function mount(root, opts) -> { update(partialOpts), destroy() }; root must contain the element markup",
  "exports": {
    "claude": "Add the \"Jiggle cursor dot\" element to this project.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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/jiggle-cursor-dot.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 \"Jiggle cursor dot\" 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 \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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 \"Jiggle cursor dot\" element to this codebase.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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-jiggle-cursor-dot.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Jiggle cursor dot 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 \"Jiggle cursor dot\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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- jiggle-cursor-dot.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 \"./jiggle-cursor-dot\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function JiggleCursorDot(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 \"Jiggle cursor dot\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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- jiggle-cursor-dot.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/JiggleCursorDot.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./jiggle-cursor-dot\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function JiggleCursorDot(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 \"Jiggle cursor dot\" element.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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), jiggle-cursor-dot.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 \"Jiggle cursor dot\" element. No packages, no server code.\n\nThis is the \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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 jiggle-cursor-dot.js and then main.js), style.css (the CSS below), jiggle-cursor-dot.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 \"Jiggle cursor dot\" 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 \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.json\n\nWhat it does: The dot sits exactly on the pointer, with no lag, and turns 0.3 degrees every frame. It wears an SVG filter: feTurbulence makes smooth, low-frequency fractal noise, and feDisplacementMap uses that noise to push the dot's pixels sideways. Every frame the filter's scale is set from how far the pointer moved since the last frame, times the jiggle amount, capped at 600. The scale eases toward that target by 5 percent a frame, so a quick flick builds up a wobble that breaks the dot into a jelly blob and then settles slowly back to a circle. The slow spin turns the noise with it, so the wobble never looks the same twice. With the idle demo on, a virtual pointer darts between random spots while nobody is pointing.\nAccessibility: The element has a text label and the dot is hidden from screen readers. With prefers-reduced-motion the dot still follows the pointer, because that is direct input, but the wobble filter, the spin and the idle darts are all off. Nothing flashes. Nothing needs keyboard input; if you use it as a site cursor, keep the system cursor visible too.\n\nTunable settings:\n- Dot colour: color, default #e6ff55\n- Opacity: range 0.1 to 1, step 0.05, default 0.6\n- Size (px): range 10 to 80, step 1, default 20\n- Jiggle (x per pixel moved): range 0 to 50, step 1, default 20\n- Spin (degrees per frame): range 0 to 3, step 0.05, default 0.3\n- Blend mode: select (Lighten / Normal / Screen / Difference / Darken (for light backgrounds)), default lighten\n- Idle demo darts: select (On / Off), default on\n- Background: color, default #0c1e18\n\nCurrent settings:\n{{SETTINGS}}\n\nFor the developer: Element contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nIn Figma:\n- Draw the resting state as a frame and the end state as a second frame; link them with Smart Animate to show the motion in a prototype.\n- Put the settings above in the frame's notes or Dev Mode annotations so the developer matches them.\n- Link https://enrichr.dev/elements/jiggle-cursor-dot.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 \"Jiggle cursor dot\" 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 \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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 JiggleCursorDot.\n2. Paste the JavaScript below into a separate code file named jiggle-cursor-dot.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 \"./jiggle-cursor-dot\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function JiggleCursorDot(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(JiggleCursorDot, {\n  color: { type: ControlType.Color, title: \"Dot colour\", defaultValue: \"#e6ff55\" },\n  opacity: { type: ControlType.Number, title: \"Opacity\", min: 0.1, max: 1, step: 0.05, defaultValue: 0.6 },\n  size: { type: ControlType.Number, title: \"Size\", min: 10, max: 80, step: 1, defaultValue: 20 },\n  jiggle: { type: ControlType.Number, title: \"Jiggle\", min: 0, max: 50, step: 1, defaultValue: 20 },\n  spin: { type: ControlType.Number, title: \"Spin\", min: 0, max: 3, step: 0.05, defaultValue: 0.3 },\n  blend: { type: ControlType.Enum, title: \"Blend mode\", options: [\"lighten\",\"normal\",\"screen\",\"difference\",\"darken\"], optionTitles: [\"Lighten\",\"Normal\",\"Screen\",\"Difference\",\"Darken (for light backgrounds)\"], defaultValue: \"lighten\" },\n  idle: { type: ControlType.Enum, title: \"Idle demo darts\", options: [\"on\",\"off\"], optionTitles: [\"On\",\"Off\"], defaultValue: \"on\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\n})\n```\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "webflow": "Add the \"Jiggle cursor dot\" 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 \"Jiggle cursor dot\" element from the Enrichr Library: A see-through dot rides on the pointer and wobbles like jelly when you move fast, then calms back to a clean circle.\nPage: https://enrichr.dev/elements/jiggle-cursor-dot.html\nMachine-readable spec: https://enrichr.dev/elements/jiggle-cursor-dot.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-jiggle-cursor-dot\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-jiggle-cursor-dot\"), { ...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 element has a text label and the dot is hidden from screen readers. With prefers-reduced-motion the dot still follows the pointer, because that is direct input, but the wobble filter, the spin and the idle darts are all off. Nothing flashes. Nothing needs keyboard input; if you use it as a site cursor, keep the system cursor visible too.",
  "performance": "Per frame it writes one transform and, only when the value changes, one filter attribute. The filter covers only the dot's own small box, so the cost stays tiny even at large sizes. The loop pauses off screen and in hidden tabs.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/yyMGqGN",
  "source": {
    "markup": "<div class=\"ef-jcd\" role=\"img\" aria-label=\"A lime dot that follows the pointer and wobbles like jelly when it moves fast\">\n  <div class=\"ef-jcd__dot\" aria-hidden=\"true\"></div>\n  <svg class=\"ef-jcd__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\"><defs><filter><feTurbulence type=\"fractalNoise\" baseFrequency=\"0.015\" numOctaves=\"1\" result=\"noise\"></feTurbulence><feDisplacementMap in=\"SourceGraphic\" in2=\"noise\" scale=\"0\" xChannelSelector=\"R\" yChannelSelector=\"G\"></feDisplacementMap></filter></defs></svg>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-jcd { position: relative; width: 100%; height: 100%; min-height: 24rem; overflow: hidden; border-radius: 1rem; background: #0c1e18; touch-action: pan-y; }\n.ef-jcd .ef-jcd__dot { position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: #e6ff55; opacity: 0.6; mix-blend-mode: lighten; box-shadow: 0 0 10px #e6ff5588; pointer-events: none; will-change: transform; transform: translate(-50%, -50%); }\n.ef-jcd .ef-jcd__defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Jiggle cursor dot: a soft, see-through dot sits exactly on the pointer and spins slowly (0.3 degrees a frame). It wears\n// an SVG filter: low-frequency fractal noise (feTurbulence) drives a displacement map, so when the scale is above zero the\n// dot's edge warps like jelly. The scale is the distance the pointer moved since the last frame times the jiggle amount,\n// capped at 600, eased in at 0.05 per frame, so a quick flick makes the dot wobble and break up, then it calms back to a\n// clean circle. With idle on, a virtual pointer darts between random spots while no one is pointing. Reduced motion keeps\n// the dot on the pointer but drops the wobble, the spin and the idle darts. The loop pauses off screen and in hidden tabs.\n// mount(root, { color, opacity, size (px), jiggle (wobble per pixel moved), spin (degrees per frame),\n//               blend (CSS blend mode), idle (on | off), background })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-jcd\");\n  var dot = root.querySelector(\".ef-jcd__dot\");\n  var filter = root.querySelector(\".ef-jcd__defs filter\");\n  var disp = root.querySelector(\".ef-jcd__defs feDisplacementMap\");\n  var uid = \"ef-jcd-\" + Math.random().toString(36).slice(2, 8);\n  var opts = {}, raf = 0, visible = true, io = null, ro = null, destroyed = false, last = 0;\n  var W = 1, H = 1, mouseX = 0, mouseY = 0, lastX = 0, lastY = 0, moved = false;\n  var currentScale = 0, targetScale = 0, rotationAngle = 0, shownScale = -1;\n  var inside = false, lastReal = -1e9, dart = null, rest = 0.8;\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  filter.id = uid;\n  filter.setAttribute(\"x\", \"-10%\"); filter.setAttribute(\"y\", \"-10%\"); filter.setAttribute(\"width\", \"120%\"); filter.setAttribute(\"height\", \"120%\");\n\n  function place() {\n    dot.style.transform = \"translate(calc(\" + mouseX + \"px - 50%), calc(\" + mouseY + \"px - 50%)) rotate(\" + rotationAngle + \"deg)\";\n  }\n  function setScale(s) {\n    // skip the attribute write (and the filter repaint) when nothing visible changed\n    if (Math.abs(s - shownScale) < 0.01) return;\n    shownScale = s; disp.setAttribute(\"scale\", s);\n  }\n\n  // idle demo: dart to a random spot on a sine in-out curve, rest, repeat\n  function idle(now, dt) {\n    if (opts.idle !== \"on\" || inside || now - lastReal < 1500) { dart = null; return; }\n    if (!dart) {\n      rest -= dt;\n      if (rest > 0) return;\n      dart = { t: 0, d: 0.5 + Math.random() * 0.45, x0: mouseX, y0: mouseY, x1: W * (0.15 + Math.random() * 0.7), y1: H * (0.15 + Math.random() * 0.7) };\n    }\n    dart.t += dt / dart.d;\n    var p = Math.min(1, dart.t), e = (1 - Math.cos(Math.PI * p)) / 2;\n    mouseX = dart.x0 + (dart.x1 - dart.x0) * e; mouseY = dart.y0 + (dart.y1 - dart.y0) * e;\n    if (p >= 1) { dart = null; rest = 0.4 + Math.random() * 0.9; }\n  }\n\n  function loop(now) {\n    raf = requestAnimationFrame(loop);\n    var dt = Math.min(0.1, (now - last) / 1000 || 0); last = now;\n    if (!visible || document.hidden) return;\n    idle(now, dt);\n    rotationAngle += opts.spin;\n    place();\n    var dx = mouseX - lastX, dy = mouseY - lastY;\n    var velocity = Math.sqrt(dx * dx + dy * dy);\n    targetScale = Math.min(velocity * opts.jiggle, 600);\n    currentScale += (targetScale - currentScale) * 0.05;\n    setScale(currentScale);\n    lastX = mouseX; lastY = mouseY;\n  }\n\n  function onMove(e) {\n    var r = wrap.getBoundingClientRect();\n    inside = true; lastReal = performance.now(); moved = true; dart = null;\n    mouseX = e.clientX - r.left; mouseY = e.clientY - r.top;\n    if (reduce) place();\n  }\n  function onEnter() { inside = true; lastReal = performance.now(); }\n  function onLeave() { inside = false; lastReal = performance.now(); }\n\n  function size() {\n    W = Math.max(1, wrap.clientWidth); H = Math.max(1, wrap.clientHeight);\n    if (!moved) { mouseX = lastX = W / 2; mouseY = lastY = H / 2; } // the original starts in the middle of the page\n    else { mouseX = Math.min(mouseX, W); mouseY = Math.min(mouseY, H); }\n    place();\n  }\n  function update(partial) {\n    opts = Object.assign({ color: \"#e6ff55\", opacity: 0.6, size: 20, jiggle: 20, spin: 0.3, blend: \"lighten\", idle: \"on\", background: \"#0c1e18\" }, opts, partial || {});\n    opts.opacity = Math.min(1, Math.max(0, num(opts.opacity, 0.6))); opts.size = Math.max(1, num(opts.size, 20));\n    opts.jiggle = Math.max(0, num(opts.jiggle, 20)); opts.spin = num(opts.spin, 0.3);\n    var c = /^#[0-9a-f]{6}$/i.test(opts.color) ? opts.color : \"#e6ff55\";\n    dot.style.background = c;\n    dot.style.boxShadow = \"0 0 10px \" + c + \"88\";\n    dot.style.opacity = opts.opacity;\n    dot.style.width = dot.style.height = opts.size + \"px\";\n    dot.style.mixBlendMode = opts.blend;\n    dot.style.filter = reduce ? \"none\" : \"url(#\" + uid + \")\";\n    wrap.style.background = opts.background;\n    if (!destroyed) place();\n  }\n\n  update(o);\n  size();\n  wrap.addEventListener(\"pointermove\", onMove, { passive: true });\n  wrap.addEventListener(\"pointerdown\", onMove, { passive: true });\n  wrap.addEventListener(\"pointerenter\", onEnter);\n  wrap.addEventListener(\"pointerleave\", onLeave);\n  if (!reduce) {\n    if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(wrap); }\n    last = performance.now(); lastReal = last - 700; // a short pause before the first idle dart\n    raf = requestAnimationFrame(loop);\n  }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) size(); }); ro.observe(wrap); }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf);\n      wrap.removeEventListener(\"pointermove\", onMove);\n      wrap.removeEventListener(\"pointerdown\", onMove);\n      wrap.removeEventListener(\"pointerenter\", onEnter);\n      wrap.removeEventListener(\"pointerleave\", onLeave);\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n    }\n  };\n}"
  }
}