{
  "id": "liquid-logo-distortion",
  "kind": "element",
  "title": "Liquid logo distortion",
  "summary": "Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.",
  "url": "https://enrichr.dev/elements/liquid-logo-distortion.html",
  "section": "hero",
  "techniques": [
    "pointer-interaction",
    "webgl"
  ],
  "stack": [
    "Vanilla JS",
    "WebGL"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "fluid"
  ],
  "intents": [
    "liquid logo hover effect",
    "webgl text distortion on mouse move",
    "rgb split hover effect",
    "chromatic aberration cursor effect",
    "distort logo with pointer shader"
  ],
  "status": "tested",
  "params": [
    {
      "key": "text",
      "label": "Wordmark text",
      "type": "text",
      "value": "Enrichr"
    },
    {
      "key": "layout",
      "label": "Layout",
      "type": "select",
      "options": [
        [
          "row",
          "Mark beside text"
        ],
        [
          "stack",
          "Mark above text"
        ],
        [
          "text",
          "Text only"
        ]
      ],
      "value": "row"
    },
    {
      "key": "warp",
      "label": "Warp amount",
      "type": "range",
      "min": 0,
      "max": 0.5,
      "step": 0.01,
      "value": 0.15
    },
    {
      "key": "split",
      "label": "RGB split",
      "type": "range",
      "min": 0,
      "max": 0.2,
      "step": 0.001,
      "value": 0.04
    },
    {
      "key": "morph",
      "label": "Random morph",
      "type": "range",
      "min": 0,
      "max": 0.1,
      "step": 0.001,
      "value": 0.02
    },
    {
      "key": "fine",
      "label": "Fine displacement",
      "type": "range",
      "min": 1,
      "max": 50,
      "step": 0.5,
      "value": 15
    },
    {
      "key": "radius",
      "label": "Effect radius",
      "type": "range",
      "min": 0.05,
      "max": 1,
      "step": 0.01,
      "value": 0.25
    },
    {
      "key": "idle",
      "label": "Idle demo sweeps",
      "type": "select",
      "options": [
        [
          "on",
          "On"
        ],
        [
          "off",
          "Off"
        ]
      ],
      "value": "on"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "ink",
      "label": "Text colour",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "mark",
      "label": "Mark colour",
      "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 \"Liquid logo distortion\" element to this project.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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/liquid-logo-distortion.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 \"Liquid logo distortion\" 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 \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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 \"Liquid logo distortion\" element to this codebase.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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-liquid-logo-distortion.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Liquid logo distortion 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 \"Liquid logo distortion\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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- liquid-logo-distortion.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 \"./liquid-logo-distortion\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LiquidLogoDistortion(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 \"Liquid logo distortion\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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- liquid-logo-distortion.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/LiquidLogoDistortion.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./liquid-logo-distortion\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LiquidLogoDistortion(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 \"Liquid logo distortion\" element.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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), liquid-logo-distortion.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 \"Liquid logo distortion\" element. No packages, no server code.\n\nThis is the \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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 liquid-logo-distortion.js and then main.js), style.css (the CSS below), liquid-logo-distortion.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 \"Liquid logo distortion\" 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 \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.json\n\nWhat it does: The puzzle-piece mark and the wordmark are drawn on a hidden 2D canvas the size of the element, and that canvas becomes a WebGL texture on one full-screen triangle. A fragment shader reads the texture three times, once for each colour channel. Around the pointer, inside a soft circle whose size grows with speed, it pushes the picture away from the pointer, shifts red one way and blue the other, and adds a slow sine wobble and a fine noise ripple that both move with time. Speed is the distance the pointer moved in one event times 100, capped at 2. It eases in at a tenth per frame and decays by 0.8 every 50 milliseconds, and the pointer itself is smoothed by a tenth per frame, so a quick flick leaves a liquid wake that settles in about a second. With the idle demo on, a virtual pointer sweeps across the logo every few seconds while nobody is hovering.\nAccessibility: The canvas has a text label that names the wordmark and the logo, and it updates when the text changes. With prefers-reduced-motion the logo is drawn once, sharp, and the pointer and idle sweeps are ignored. The effect is decorative and needs no keyboard input. The colour split appears only while the pointer moves and fades within a second, so nothing flashes on its own.\n\nTunable settings:\n- Wordmark text: text, default Enrichr\n- Layout: select (Mark beside text / Mark above text / Text only), default row\n- Warp amount: range 0 to 0.5, step 0.01, default 0.15\n- RGB split: range 0 to 0.2, step 0.001, default 0.04\n- Random morph: range 0 to 0.1, step 0.001, default 0.02\n- Fine displacement: range 1 to 50, step 0.5, default 15\n- Effect radius: range 0.05 to 1, step 0.01, default 0.25\n- Idle demo sweeps: select (On / Off), default on\n- Background: color, default #fbf8f1\n- Text colour: color, default #0c1e18\n- Mark colour: 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/liquid-logo-distortion.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 \"Liquid logo distortion\" 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 \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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 LiquidLogoDistortion.\n2. Paste the JavaScript below into a separate code file named liquid-logo-distortion.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 \"./liquid-logo-distortion\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LiquidLogoDistortion(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(LiquidLogoDistortion, {\n  text: { type: ControlType.String, title: \"Wordmark text\", defaultValue: \"Enrichr\" },\n  layout: { type: ControlType.Enum, title: \"Layout\", options: [\"row\",\"stack\",\"text\"], optionTitles: [\"Mark beside text\",\"Mark above text\",\"Text only\"], defaultValue: \"row\" },\n  warp: { type: ControlType.Number, title: \"Warp amount\", min: 0, max: 0.5, step: 0.01, defaultValue: 0.15 },\n  split: { type: ControlType.Number, title: \"RGB split\", min: 0, max: 0.2, step: 0.001, defaultValue: 0.04 },\n  morph: { type: ControlType.Number, title: \"Random morph\", min: 0, max: 0.1, step: 0.001, defaultValue: 0.02 },\n  fine: { type: ControlType.Number, title: \"Fine displacement\", min: 1, max: 50, step: 0.5, defaultValue: 15 },\n  radius: { type: ControlType.Number, title: \"Effect radius\", min: 0.05, max: 1, step: 0.01, defaultValue: 0.25 },\n  idle: { type: ControlType.Enum, title: \"Idle demo sweeps\", options: [\"on\",\"off\"], optionTitles: [\"On\",\"Off\"], defaultValue: \"on\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#fbf8f1\" },\n  ink: { type: ControlType.Color, title: \"Text colour\", defaultValue: \"#0c1e18\" },\n  mark: { type: ControlType.Color, title: \"Mark colour\", 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 \"Liquid logo distortion\" 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 \"Liquid logo distortion\" element from the Enrichr Library: Your logo turns to liquid under the pointer: it warps, splits into red, green and blue, and ripples, then settles back sharp.\nPage: https://enrichr.dev/elements/liquid-logo-distortion.html\nMachine-readable spec: https://enrichr.dev/elements/liquid-logo-distortion.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-liquid-logo-distortion\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-liquid-logo-distortion\"), { ...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 canvas has a text label that names the wordmark and the logo, and it updates when the text changes. With prefers-reduced-motion the logo is drawn once, sharp, and the pointer and idle sweeps are ignored. The effect is decorative and needs no keyboard input. The colour split appears only while the pointer moves and fades within a second, so nothing flashes on its own.",
  "performance": "One shader pass with three texture reads per pixel, at a pixel ratio capped at 2. The logo texture is redrawn only on resize, a parameter change or when the font finishes loading. The loop pauses off screen and in hidden tabs, and destroy deletes the texture, buffer and program and releases the WebGL context. Without WebGL the plain 2D logo is shown instead.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/QwpzBJe",
  "source": {
    "markup": "<div class=\"ef-lqd\"><canvas class=\"ef-lqd__gl\" role=\"img\" aria-label=\"The Enrichr logo, a puzzle-piece mark and the word Enrichr, which ripples like liquid with a colour split where the pointer moves\"></canvas></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-lqd { position: relative; width: 100%; height: 100%; min-height: 26rem; overflow: hidden; border-radius: 1rem; background: #fbf8f1; touch-action: pan-y; }\n.ef-lqd .ef-lqd__gl, .ef-lqd .ef-lqd__fb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Liquid logo distortion: the Enrichr puzzle-piece mark and wordmark are drawn on a 2D canvas, uploaded as a WebGL texture,\n// and one fragment shader warps that texture around the pointer. The warp pushes pixels away from the pointer by its\n// speed, splits the red and blue channels apart (an RGB split), and adds a slow sine morph plus a fine noise ripple, all\n// inside a soft circle that grows with speed. The pointer is smoothed with a 0.1 lerp per frame, its speed is the distance\n// moved per event times 100 (capped at 2), eased in at 0.1 per frame and decayed by 0.8 every 50 ms, so a flick leaves a\n// short liquid wake that settles. With idle on, a virtual pointer sweeps across the logo now and then while no one is\n// hovering. Reduced motion draws the logo once, sharp, and ignores the pointer. Without WebGL the plain 2D logo shows.\n// The loop pauses off screen and in hidden tabs.\n// mount(root, { text (wordmark), layout (row | stack | text), warp, split (RGB split), morph (random morph),\n//               fine (fine displacement frequency), radius, idle (on | off), background, ink (text colour), mark (mark colour) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-lqd\");\n  var canvas = root.querySelector(\".ef-lqd__gl\");\n  var tex2d = document.createElement(\"canvas\");\n  var tctx = tex2d.getContext(\"2d\");\n  var MARK = \"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\";\n  var MB = { x: 4.068, y: 2.566, w: 37.866, h: 45.587 }; // the mark's bounding box inside its 50 x 50 view box\n  var markPath = typeof Path2D === \"function\" ? new Path2D(MARK) : null;\n  var FONT = \"'Parkinsans', 'Space Grotesk', sans-serif\";\n  var opts = {}, raf = 0, visible = true, io = null, ro = null, destroyed = false, last = 0, time = 0, acc = 0;\n  var W = 1, H = 1, dpr = 1, gl = null, prog = null, buf = null, tex = null, u = {}, fb = null;\n  // pointer state, in 0..1 with y up, exactly like the original: target, smoothed, last, speed target, smoothed speed\n  var tx = -10, ty = -10, mx = -10, my = -10, lx = 0, ly = 0, tv = 0, vel = 0;\n  var inside = false, lastReal = -1e9, sweep = null, sweepDir = 1, nextSweep = 1.2;\n\n  var VS = \"attribute vec2 p;varying vec2 vUv;void main(){vUv=p*.5+.5;gl_Position=vec4(p,0.,1.);}\";\n  var FS = [\n    \"#ifdef GL_FRAGMENT_PRECISION_HIGH\", \"precision highp float;\", \"#else\", \"precision mediump float;\", \"#endif\",\n    \"uniform sampler2D tDiffuse;uniform vec2 uResolution;uniform vec2 uMouse;uniform float uVelo;uniform float uTime;\",\n    \"uniform float uWarpStrength;uniform float uCaStrength;uniform float uRadius;uniform float uNoiseStrength;uniform float uFineNoise;\",\n    \"varying vec2 vUv;\",\n    \"float random(vec2 st){return fract(sin(dot(st.xy,vec2(12.9898,78.233)))*43758.5453123);}\",\n    \"float noise(vec2 st){vec2 i=floor(st);vec2 f=fract(st);float a=random(i);float b=random(i+vec2(1.,0.));\",\n    \"float c=random(i+vec2(0.,1.));float d=random(i+vec2(1.,1.));vec2 u=f*f*(3.-2.*f);\",\n    \"return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;}\",\n    \"void main(){vec2 uv=vUv;vec2 aspect=vec2(uResolution.x/uResolution.y,1.);vec2 mouse=uMouse*aspect;vec2 st=uv*aspect;\",\n    \"vec2 dir=st-mouse;float dist=length(dir);vec2 normDir=dist>0.?dir/dist:vec2(0.);\",\n    \"float radius=uRadius+(uVelo*.1);float strength=smoothstep(radius,0.,dist);float warpAmount=strength*uVelo*uWarpStrength;\",\n    \"float t=uTime*3.;\",\n    \"vec2 noiseDisp=vec2(sin(uv.y*12.+t)*cos(uv.x*12.-t),cos(uv.y*12.+t)*sin(uv.x*12.-t))*uNoiseStrength*strength*(uVelo+.5);\",\n    \"float fineRand=(noise(uv*uFineNoise+vec2(t*.5,-t*.3))-.5)*2.;\",\n    \"vec2 fineDisp=vec2(fineRand,-fineRand)*(uNoiseStrength*.75)*strength*(uVelo+.8);\",\n    \"vec2 distortedUv=uv-normDir*warpAmount*aspect+noiseDisp+fineDisp;\",\n    \"float caAmount=strength*uVelo*uCaStrength;vec2 rgbShift=normDir*caAmount*aspect;\",\n    \"float r=texture2D(tDiffuse,distortedUv+rgbShift).r;float g=texture2D(tDiffuse,distortedUv).g;float b=texture2D(tDiffuse,distortedUv-rgbShift).b;\",\n    \"gl_FragColor=vec4(r,g,b,1.);}\"\n  ].join(\"\\n\");\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n\n  // ---- the logo texture, drawn by hand on a 2D canvas (this replaces html2canvas) ----\n  function fontAt(px) { return \"700 \" + px + \"px \" + FONT; }\n  function lines(text, fs) {\n    tctx.font = fontAt(fs);\n    var one = [text], words = text.split(/\\s+/);\n    if (words.length < 2) return one;\n    var best = null, bestW = 1e9;\n    for (var i = 1; i < words.length; i++) {\n      var a = words.slice(0, i).join(\" \"), b = words.slice(i).join(\" \");\n      var w = Math.max(tctx.measureText(a).width, tctx.measureText(b).width);\n      if (w < bestW) { bestW = w; best = [a, b]; }\n    }\n    return best || one;\n  }\n  function drawTexture() {\n    var pw = Math.max(2, Math.round(W * dpr)), ph = Math.max(2, Math.round(H * dpr));\n    if (tex2d.width !== pw || tex2d.height !== ph) { tex2d.width = pw; tex2d.height = ph; }\n    var c = tctx;\n    c.setTransform(dpr, 0, 0, dpr, 0, 0);\n    c.fillStyle = opts.background; c.fillRect(0, 0, W, H);\n    var text = String(opts.text == null ? \"\" : opts.text).replace(/\\s+/g, \" \").trim();\n    var layout = opts.layout, showMark = layout !== \"text\" && markPath, showText = text.length > 0;\n    if (!showMark && !showText) return;\n    // measure at 100px, then scale the whole lockup to fit 80% of the width and about half the height\n    var ls = [text], fs = 100, tw = 0, i;\n    if (showText) {\n      c.font = fontAt(100);\n      tw = c.measureText(text).width;\n      if (tw > 0 && layout !== \"row\" && text.indexOf(\" \") > 0 && (W * 0.8) / tw * 100 < H * 0.16) { ls = lines(text, 100); }\n      tw = 0; for (i = 0; i < ls.length; i++) tw = Math.max(tw, c.measureText(ls[i]).width);\n    }\n    var m = c.measureText(\"Hg\"), asc = m.actualBoundingBoxAscent || 74, desc = m.actualBoundingBoxDescent || 22;\n    var lineH = 100 * 0.95, textH = showText ? asc + desc + (ls.length - 1) * lineH : 0;\n    var markH = layout === \"stack\" ? 130 : 112, markW = markH * MB.w / MB.h, gap = showMark && showText ? (layout === \"stack\" ? 26 : 30) : 0;\n    if (!showMark) { markW = 0; markH = 0; }\n    var boxW = layout === \"stack\" ? Math.max(tw, markW) : markW + gap + tw;\n    var boxH = layout === \"stack\" ? markH + gap + textH : Math.max(markH, textH);\n    var k = Math.min((W * 0.8) / Math.max(1, boxW), (H * 0.62) / Math.max(1, boxH));\n    var ox = (W - boxW * k) / 2, oy = (H - boxH * k) / 2;\n    c.save();\n    c.translate(ox, oy); c.scale(k, k);\n    var mx0 = layout === \"stack\" ? (boxW - markW) / 2 : 0, my0 = layout === \"stack\" ? 0 : (boxH - markH) / 2;\n    if (showMark) {\n      c.save();\n      c.translate(mx0, my0); c.scale(markH / MB.h, markH / MB.h); c.translate(-MB.x, -MB.y);\n      c.fillStyle = opts.mark; c.fill(markPath);\n      c.restore();\n    }\n    if (showText) {\n      c.fillStyle = opts.ink; c.font = fontAt(100); c.textBaseline = \"alphabetic\";\n      var tx0 = layout === \"stack\" ? 0 : markW + gap, ty0 = layout === \"stack\" ? markH + gap : (boxH - textH) / 2;\n      for (i = 0; i < ls.length; i++) {\n        var lw = c.measureText(ls[i]).width;\n        var x = layout === \"stack\" ? (boxW - lw) / 2 : tx0;\n        c.fillText(ls[i], x, ty0 + asc + i * lineH);\n      }\n    }\n    c.restore();\n  }\n\n  // ---- WebGL ----\n  function sh(type, src) { var s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return gl.getShaderParameter(s, gl.COMPILE_STATUS) ? s : null; }\n  function setup() {\n    var v = sh(gl.VERTEX_SHADER, VS), f = sh(gl.FRAGMENT_SHADER, FS);\n    if (!v || !f) return false;\n    prog = gl.createProgram(); gl.attachShader(prog, v); gl.attachShader(prog, f); gl.linkProgram(prog);\n    if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) return false;\n    gl.useProgram(prog);\n    buf = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n    gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n    var loc = gl.getAttribLocation(prog, \"p\"); gl.enableVertexAttribArray(loc); gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n    [\"tDiffuse\", \"uResolution\", \"uMouse\", \"uVelo\", \"uTime\", \"uWarpStrength\", \"uCaStrength\", \"uRadius\", \"uNoiseStrength\", \"uFineNoise\"].forEach(function (k) { u[k] = gl.getUniformLocation(prog, k); });\n    tex = gl.createTexture(); gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, tex);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.uniform1i(u.tDiffuse, 0);\n    return true;\n  }\n  function upload() {\n    if (!gl || !tex) return;\n    gl.bindTexture(gl.TEXTURE_2D, tex);\n    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex2d);\n  }\n  function render() {\n    if (!gl || !prog) return;\n    gl.viewport(0, 0, canvas.width, canvas.height);\n    gl.uniform2f(u.uResolution, W, H);\n    gl.uniform2f(u.uMouse, mx, my);\n    gl.uniform1f(u.uVelo, vel);\n    gl.uniform1f(u.uTime, time);\n    gl.uniform1f(u.uWarpStrength, opts.warp);\n    gl.uniform1f(u.uCaStrength, opts.split);\n    gl.uniform1f(u.uNoiseStrength, opts.morph);\n    gl.uniform1f(u.uFineNoise, opts.fine);\n    gl.uniform1f(u.uRadius, opts.radius);\n    gl.drawArrays(gl.TRIANGLES, 0, 3);\n  }\n  function repaint() { drawTexture(); if (fb) { fb.width = tex2d.width; fb.height = tex2d.height; fb.getContext(\"2d\").drawImage(tex2d, 0, 0); } else { upload(); render(); } }\n\n  // ---- pointer: the original's mousemove maths, per pointer event, in the element's own box ----\n  function moveTo(nx, ny) {\n    tx = nx; ty = ny;\n    var dx = tx - lx, dy = ty - ly;\n    tv = Math.min(Math.sqrt(dx * dx + dy * dy) * 100, 2.0);\n    lx = tx; ly = ty;\n  }\n  function onMove(e) {\n    var r = wrap.getBoundingClientRect();\n    if (r.width < 1 || r.height < 1) return;\n    inside = true; lastReal = performance.now(); sweep = null;\n    moveTo((e.clientX - r.left) / r.width, 1 - (e.clientY - r.top) / r.height);\n  }\n  function onEnter() { inside = true; lastReal = performance.now(); sweep = null; }\n  function onLeave() { inside = false; lastReal = performance.now(); }\n\n  // idle demo: a virtual pointer sweeps across the logo on a gentle arc, from just outside one edge to just outside the other\n  function idleStep(now, dt) {\n    if (opts.idle !== \"on\" || inside || now - lastReal < 1800) { nextSweep = Math.max(nextSweep, 0.6); return; }\n    if (!sweep) {\n      nextSweep -= dt;\n      if (nextSweep > 0) return;\n      var y0 = 0.35 + Math.random() * 0.3, y1 = 0.35 + Math.random() * 0.3;\n      sweep = { t: 0, d: 1.5, x0: sweepDir > 0 ? -0.15 : 1.15, x1: sweepDir > 0 ? 1.15 : -0.15, y0: y0, y1: y1, bow: (Math.random() - 0.5) * 0.4 };\n      sweepDir = -sweepDir;\n      if (mx < -1) { mx = tx = lx = sweep.x0; my = ty = ly = sweep.y0; }\n    }\n    sweep.t += dt / sweep.d;\n    var p = Math.min(1, sweep.t), e = (1 - Math.cos(Math.PI * p)) / 2;\n    moveTo(sweep.x0 + (sweep.x1 - sweep.x0) * e, sweep.y0 + (sweep.y1 - sweep.y0) * e + Math.sin(Math.PI * e) * sweep.bow);\n    if (p >= 1) { sweep = null; nextSweep = 2.2 + Math.random() * 1.6; }\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    time += dt;\n    acc += dt * 1000;\n    while (acc >= 50) { tv *= 0.8; acc -= 50; } // the original's setInterval(() => targetVelocity *= 0.8, 50)\n    idleStep(now, dt);\n    var k = 1 - Math.pow(0.9, dt * 60); // lerp 0.1 per 60 fps frame, the same feel on any refresh rate\n    mx += (tx - mx) * k; my += (ty - my) * k;\n    vel += (tv - vel) * k;\n    render();\n  }\n\n  function size() {\n    dpr = Math.min(window.devicePixelRatio || 1, 2);\n    W = Math.max(1, wrap.clientWidth); H = Math.max(1, wrap.clientHeight);\n    var pw = Math.round(W * dpr), ph = Math.round(H * dpr);\n    if (canvas.width !== pw || canvas.height !== ph) { canvas.width = pw; canvas.height = ph; }\n    repaint();\n  }\n  function update(partial) {\n    opts = Object.assign({ text: \"Enrichr\", layout: \"row\", warp: 0.15, split: 0.04, morph: 0.02, fine: 15, radius: 0.25, idle: \"on\",\n      background: \"#fbf8f1\", ink: \"#0c1e18\", mark: \"#0c1e18\" }, opts, partial || {});\n    opts.warp = num(opts.warp, 0.15); opts.split = num(opts.split, 0.04); opts.morph = num(opts.morph, 0.02);\n    opts.fine = num(opts.fine, 15); opts.radius = Math.max(0.01, num(opts.radius, 0.25));\n    wrap.style.background = opts.background;\n    var t = String(opts.text || \"\").trim();\n    canvas.setAttribute(\"aria-label\", (t ? t + \": \" : \"\") + (opts.layout !== \"text\" ? \"the Enrichr puzzle-piece logo, \" : \"\") + \"which ripples like liquid with a colour split where the pointer moves\");\n    if (destroyed) return;\n    repaint();\n  }\n\n  gl = canvas.getContext(\"webgl\", { antialias: true, alpha: false, premultipliedAlpha: false, powerPreference: \"low-power\" });\n  var ok = !!gl && setup();\n  if (!ok) {\n    canvas.style.display = \"none\";\n    fb = document.createElement(\"canvas\"); fb.className = \"ef-lqd__fb\";\n    fb.setAttribute(\"role\", \"img\"); fb.setAttribute(\"aria-label\", \"The Enrichr logo\");\n    wrap.appendChild(fb);\n  }\n  update(o);\n  size();\n  // the wordmark font may still be loading; redraw the texture when it lands\n  if (document.fonts && document.fonts.load) {\n    document.fonts.load(\"700 64px Parkinsans\").then(function () { if (!destroyed) repaint(); }, function () {});\n    document.fonts.ready.then(function () { if (!destroyed) repaint(); });\n  }\n  if (ok && !reduce) {\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 (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(wrap); }\n    last = performance.now(); raf = requestAnimationFrame(loop);\n  }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) 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      if (fb && fb.parentNode) fb.parentNode.removeChild(fb);\n      if (gl) {\n        var ext = gl.getExtension(\"WEBGL_lose_context\");\n        if (tex) gl.deleteTexture(tex); if (buf) gl.deleteBuffer(buf); if (prog) gl.deleteProgram(prog);\n        if (ext) ext.loseContext();\n      }\n    }\n  };\n}"
  }
}