{
  "id": "wiggle-drop-header",
  "kind": "element",
  "title": "Wiggle drop header",
  "summary": "A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.",
  "url": "https://enrichr.dev/elements/wiggle-drop-header.html",
  "section": "nav",
  "techniques": [
    "scroll-driven",
    "reveal"
  ],
  "stack": [
    "Vanilla JS",
    "SVG"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "playful",
    "energetic"
  ],
  "intents": [
    "hide header on scroll down show on scroll up",
    "elastic header drop animation",
    "wobbly navbar svg",
    "header with bouncy bottom edge",
    "smart sticky header with wiggle"
  ],
  "status": "tested",
  "params": [
    {
      "key": "autoplay",
      "label": "Autoplay",
      "type": "select",
      "options": [
        [
          "on",
          "On, loop on its own"
        ],
        [
          "off",
          "Off, follow scrolling"
        ]
      ],
      "value": "on"
    },
    {
      "key": "wiggle",
      "label": "Wiggle amount (px)",
      "type": "range",
      "min": 80,
      "max": 800,
      "step": 1,
      "value": 240
    },
    {
      "key": "speed",
      "label": "Drop duration (s)",
      "type": "range",
      "min": 0.5,
      "max": 4,
      "step": 0.1,
      "value": 1.8
    },
    {
      "key": "distortion",
      "label": "Distortion",
      "type": "range",
      "min": 0,
      "max": 250,
      "step": 1,
      "value": 0
    },
    {
      "key": "pause",
      "label": "Pause between drops (s)",
      "type": "range",
      "min": 0.5,
      "max": 5,
      "step": 0.1,
      "value": 1.5
    },
    {
      "key": "links",
      "label": "Nav links (comma separated, Label or Label=url)",
      "type": "text",
      "value": "Library, Tools, Pricing"
    },
    {
      "key": "cta",
      "label": "Button text",
      "type": "text",
      "value": "Get started"
    },
    {
      "key": "colour1",
      "label": "Header colour (left)",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "colour2",
      "label": "Header colour (right)",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "ink",
      "label": "Header text",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "text",
      "label": "Page text",
      "type": "color",
      "value": "#fbf8f1"
    }
  ],
  "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 \"Wiggle drop header\" element to this project.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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/wiggle-drop-header.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 \"Wiggle drop header\" 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 \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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 \"Wiggle drop header\" element to this codebase.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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-wiggle-drop-header.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Wiggle drop header 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 \"Wiggle drop header\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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- wiggle-drop-header.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 \"./wiggle-drop-header\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function WiggleDropHeader(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 \"Wiggle drop header\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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- wiggle-drop-header.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/WiggleDropHeader.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./wiggle-drop-header\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function WiggleDropHeader(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 \"Wiggle drop header\" element.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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), wiggle-drop-header.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 \"Wiggle drop header\" element. No packages, no server code.\n\nThis is the \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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 wiggle-drop-header.js and then main.js), style.css (the CSS below), wiggle-drop-header.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 \"Wiggle drop header\" 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 \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.json\n\nWhat it does: The header's colour is one SVG path, stretched across the width, whose bottom edge is two curves meeting in the middle. To drop the header in, the three middle points of that edge are set to the wiggle amount at once, so the edge sags into a deep bulge, and then eased back to a straight line on an elastic out curve (amplitude 1.2, period 0.3) over the drop duration. At the same time the header slides down from minus 100 percent in 44 percent of that time on a power3 out curve, so it lands first and the edge keeps wobbling. Hiding is a 0.5 second power2 in-out slide up. Autoplay hides and drops it on a loop for previews that cannot scroll. With autoplay off it listens to scrolling on the window and on any scrolling ancestor: scrolling down past 100 pixels hides it and any scroll up drops it back. The optional distortion runs the shape through an SVG turbulence and displacement filter whose noise frequency drifts between 0.004 and 0.009 on a 4 second sine loop. All tweens are a few lines of easing maths on one requestAnimationFrame clock, in place of GSAP.\nAccessibility: The logo, links and button are real links and a button inside a header and a labelled nav, with visible focus rings. If keyboard focus lands in the header while it is hidden, it drops back in, and the autoplay loop waits while the pointer or focus is on it. The Test animation button replays the drop. With prefers-reduced-motion there is no slide and no wiggle: autoplay is off and the header simply fades out and back.\n\nTunable settings:\n- Autoplay: select (On, loop on its own / Off, follow scrolling), default on\n- Wiggle amount (px): range 80 to 800, step 1, default 240\n- Drop duration (s): range 0.5 to 4, step 0.1, default 1.8\n- Distortion: range 0 to 250, step 1, default 0\n- Pause between drops (s): range 0.5 to 5, step 0.1, default 1.5\n- Nav links (comma separated, Label or Label=url): text, default Library, Tools, Pricing\n- Button text: text, default Get started\n- Header colour (left): color, default #fbf8f1\n- Header colour (right): color, default #e6ff55\n- Header text: color, default #0c1e18\n- Background: color, default #0c1e18\n- Page text: color, default #fbf8f1\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/wiggle-drop-header.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 \"Wiggle drop header\" 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 \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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 WiggleDropHeader.\n2. Paste the JavaScript below into a separate code file named wiggle-drop-header.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 \"./wiggle-drop-header\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function WiggleDropHeader(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(WiggleDropHeader, {\n  autoplay: { type: ControlType.Enum, title: \"Autoplay\", options: [\"on\",\"off\"], optionTitles: [\"On, loop on its own\",\"Off, follow scrolling\"], defaultValue: \"on\" },\n  wiggle: { type: ControlType.Number, title: \"Wiggle amount\", min: 80, max: 800, step: 1, defaultValue: 240 },\n  speed: { type: ControlType.Number, title: \"Drop duration\", min: 0.5, max: 4, step: 0.1, defaultValue: 1.8 },\n  distortion: { type: ControlType.Number, title: \"Distortion\", min: 0, max: 250, step: 1, defaultValue: 0 },\n  pause: { type: ControlType.Number, title: \"Pause between drops\", min: 0.5, max: 5, step: 0.1, defaultValue: 1.5 },\n  links: { type: ControlType.String, title: \"Nav links (comma separated, Label or Label=url)\", defaultValue: \"Library, Tools, Pricing\" },\n  cta: { type: ControlType.String, title: \"Button text\", defaultValue: \"Get started\" },\n  colour1: { type: ControlType.Color, title: \"Header colour (left)\", defaultValue: \"#fbf8f1\" },\n  colour2: { type: ControlType.Color, title: \"Header colour (right)\", defaultValue: \"#e6ff55\" },\n  ink: { type: ControlType.Color, title: \"Header text\", defaultValue: \"#0c1e18\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\n  text: { type: ControlType.Color, title: \"Page text\", defaultValue: \"#fbf8f1\" },\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 \"Wiggle drop header\" 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 \"Wiggle drop header\" element from the Enrichr Library: A site header that slides away as you scroll down and drops back in with an elastic wobble along its bottom edge.\nPage: https://enrichr.dev/elements/wiggle-drop-header.html\nMachine-readable spec: https://enrichr.dev/elements/wiggle-drop-header.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-wiggle-drop-header\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-wiggle-drop-header\"), { ...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 logo, links and button are real links and a button inside a header and a labelled nav, with visible focus rings. If keyboard focus lands in the header while it is hidden, it drops back in, and the autoplay loop waits while the pointer or focus is on it. The Test animation button replays the drop. With prefers-reduced-motion there is no slide and no wiggle: autoplay is off and the header simply fades out and back.",
  "performance": "Each frame changes at most one transform and one path attribute, and only while a tween runs; with autoplay off the frame loop stops completely when nothing is moving. The scroll listener is passive. The turbulence filter is only attached when distortion is above zero, because SVG filters repaint the whole shape every frame. Animation pauses off screen and in hidden tabs.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/vExvabr",
  "source": {
    "markup": "<div class=\"ef-wdh\">\n  <header class=\"ef-wdh__bar\">\n    <div class=\"ef-wdh__shape\" aria-hidden=\"true\">\n      <svg class=\"ef-wdh__svg\" preserveAspectRatio=\"none\" viewBox=\"0 0 2278 240\" focusable=\"false\">\n        <defs>\n          <linearGradient class=\"ef-wdh__grad\" id=\"ef-wdh-grad\" x1=\"0\" y1=\"0\" x2=\"2278\" y2=\"240\" gradientUnits=\"userSpaceOnUse\">\n            <stop class=\"ef-wdh__s1\" offset=\"0.2\" stop-color=\"#fbf8f1\"></stop>\n            <stop class=\"ef-wdh__s2\" offset=\"0.8\" stop-color=\"#e6ff55\"></stop>\n          </linearGradient>\n          <filter class=\"ef-wdh__filter\" id=\"ef-wdh-dist\" x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\">\n            <feTurbulence class=\"ef-wdh__turb\" type=\"fractalNoise\" baseFrequency=\"0.004\" numOctaves=\"1\" result=\"rawNoise\"></feTurbulence>\n            <feGaussianBlur in=\"rawNoise\" stdDeviation=\"2\" result=\"noise\"></feGaussianBlur>\n            <feDisplacementMap class=\"ef-wdh__disp\" in=\"SourceGraphic\" in2=\"noise\" scale=\"0\" xChannelSelector=\"R\" yChannelSelector=\"G\"></feDisplacementMap>\n          </filter>\n        </defs>\n        <g class=\"ef-wdh__g\"><path class=\"ef-wdh__path\" fill=\"url(#ef-wdh-grad)\" d=\"M0,0 L2278,0 L2278,80 C2278,80, 1814,80, 1139,80 C464,80, 0,80, 0,80 Z\"></path></g>\n      </svg>\n    </div>\n    <div class=\"ef-wdh__nav\">\n      <a class=\"ef-wdh__logo\" href=\"#\" aria-label=\"Enrichr home\"><svg class=\"ef-wdh__mark\" viewBox=\"0 0 50 50\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"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\"/></svg><span class=\"ef-wdh__word\">Enrichr</span></a>\n      <nav class=\"ef-wdh__links\" aria-label=\"Main\"></nav>\n      <a class=\"ef-wdh__cta\" href=\"#\"></a>\n    </div>\n  </header>\n  <div class=\"ef-wdh__main\">\n    <h2 class=\"ef-wdh__h\">Scroll to wiggle.</h2>\n    <p class=\"ef-wdh__p\"></p>\n    <button type=\"button\" class=\"ef-wdh__test\">Test animation</button>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-wdh { --ef-wdh-bg: #0c1e18; --ef-wdh-text: #fbf8f1; --ef-wdh-ink: #0c1e18; position: relative; width: 100%; min-height: 26rem; box-sizing: border-box; overflow: hidden; border-radius: 1rem; background: var(--ef-wdh-bg); color: var(--ef-wdh-text); font-family: 'Instrument Sans', system-ui, sans-serif; container-type: inline-size; }\n.ef-wdh .ef-wdh__bar { position: absolute; top: 0; left: 0; z-index: 2; width: 100%; height: 80px; will-change: transform; }\n.ef-wdh .ef-wdh__shape { position: absolute; top: 0; left: 0; z-index: -1; width: 100%; height: 240px; pointer-events: none; }\n.ef-wdh .ef-wdh__svg { display: block; width: 100%; height: 100%; overflow: visible; }\n.ef-wdh .ef-wdh__nav { box-sizing: border-box; max-width: 1200px; height: 80px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--ef-wdh-ink); }\n.ef-wdh .ef-wdh__logo { display: flex; align-items: center; gap: 0.35rem; color: inherit; text-decoration: none; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.05em; }\n.ef-wdh .ef-wdh__mark { width: 2rem; height: 2rem; flex: none; }\n.ef-wdh .ef-wdh__links { display: none; gap: 32px; }\n.ef-wdh .ef-wdh__link { color: inherit; text-decoration: none; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; transition: color 0.3s; }\n.ef-wdh .ef-wdh__link:hover { color: #126e45; }\n.ef-wdh .ef-wdh__cta { flex: none; padding: 10px 24px; border: none; border-radius: 9999px; background: var(--ef-wdh-ink); color: var(--ef-wdh-text); font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: 0.875rem; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: all 0.3s; }\n.ef-wdh .ef-wdh__cta:hover { background: var(--ef-wdh-text); color: var(--ef-wdh-ink); }\n.ef-wdh .ef-wdh__logo:focus-visible, .ef-wdh .ef-wdh__link:focus-visible, .ef-wdh .ef-wdh__cta:focus-visible { outline: 2px solid var(--ef-wdh-ink); outline-offset: 4px; border-radius: 6px; }\n.ef-wdh .ef-wdh__cta:focus-visible { border-radius: 9999px; }\n.ef-wdh .ef-wdh__main { position: relative; z-index: 1; box-sizing: border-box; min-height: 26rem; padding: 10rem 24px 2.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; }\n.ef-wdh .ef-wdh__h { margin: 0; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: clamp(2rem, 6cqi, 3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: inherit; opacity: 1; }\n.ef-wdh .ef-wdh__p { max-width: 34rem; margin: 1rem 0 0; font-size: 1rem; line-height: 1.5; color: color-mix(in srgb, var(--ef-wdh-text) 62%, var(--ef-wdh-bg)); opacity: 1; }\n.ef-wdh .ef-wdh__test { margin-top: 1.6rem; padding: 10px 24px; border: 1px solid color-mix(in srgb, var(--ef-wdh-text) 35%, transparent); border-radius: 9999px; background: transparent; color: inherit; font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: all 0.3s; }\n.ef-wdh .ef-wdh__test:hover { background: var(--ef-wdh-text); color: var(--ef-wdh-bg); }\n.ef-wdh .ef-wdh__test:focus-visible { outline: 2px solid #e6ff55; outline-offset: 3px; }\n.ef-wdh.is-still .ef-wdh__bar { transition: opacity 0.2s ease; }\n.ef-wdh.is-still.is-off .ef-wdh__bar { opacity: 0; }\n@container (min-width: 640px) { .ef-wdh .ef-wdh__links { display: flex; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Wiggle drop header: a site header that slides up out of view and drops back in with a wobble along its bottom edge.\n// The header's colour is one SVG path. To drop it in, the middle of the path's bottom edge is pulled down to the wiggle\n// amount at once, then springs back to a straight line on an elastic out curve (amplitude 1.2, period 0.3) over the drop\n// duration, while the header slides down from -100% in 44% of that time on a power3 out curve. Hiding is a 0.5 s power2\n// in-out slide. An optional SVG turbulence filter roughens the shape, its noise frequency breathing on a 4 s sine loop.\n// Autoplay hides and drops it on a loop (it holds while the pointer or keyboard focus is on it); with autoplay off it\n// follows scrolling, on the nearest scrolling ancestor or the window: scrolling down past 100 px hides it, scrolling up\n// drops it. The Test button hides it fast (0.3 s power2 in) and drops it. Reduced motion fades it out and in instead,\n// with no slide and no wiggle. Animation pauses off screen and in hidden tabs.\n// mount(root, { autoplay (\"on\" loop or \"off\" follow scroll), wiggle (px the edge is pulled down), speed (drop duration, s),\n//               distortion (turbulence strength), pause (s between drops), links (comma separated, \"Label\" or \"Label=url\"),\n//               cta (button text), colour1 (header left), colour2 (header right), ink (header text), background, text })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-wdh\");\n  var bar = root.querySelector(\".ef-wdh__bar\");\n  var path = root.querySelector(\".ef-wdh__path\");\n  var grad = root.querySelector(\".ef-wdh__grad\");\n  var stop1 = root.querySelector(\".ef-wdh__s1\"), stop2 = root.querySelector(\".ef-wdh__s2\");\n  var filter = root.querySelector(\".ef-wdh__filter\"), turb = root.querySelector(\".ef-wdh__turb\"), disp = root.querySelector(\".ef-wdh__disp\");\n  var g = root.querySelector(\".ef-wdh__g\");\n  var nav = root.querySelector(\".ef-wdh__links\"), cta = root.querySelector(\".ef-wdh__cta\");\n  var lede = root.querySelector(\".ef-wdh__p\"), test = root.querySelector(\".ef-wdh__test\");\n  // unique ids, so two headers on one page do not share a gradient or filter\n  var uid = \"ef-wdh-\" + Math.random().toString(36).slice(2, 9);\n  grad.id = uid + \"-g\"; filter.id = uid + \"-f\"; path.setAttribute(\"fill\", \"url(#\" + grad.id + \")\");\n\n  var opts = {}, raf = 0, last = 0, clock = 0, visible = true, destroyed = false, io = null, inTick = false;\n  var hy = 0, hidden = false, tweens = {}, queue = [], hover = false, focusIn = false, mode = \"\", linkSig = \"\", flat = true;\n  var lastTop = 0, lastSrc = null;\n\n  // GSAP's eases, written out\n  function power2In(p) { return p * p * p; }\n  function power2InOut(p) { return p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2; }\n  function power3Out(p) { return 1 - Math.pow(1 - p, 4); }\n  var EA = 1.2, EP = 0.3, E3 = EP / (2 * Math.PI) * Math.asin(1 / EA), E2 = 2 * Math.PI / EP;\n  function elasticOut(p) { return p >= 1 ? 1 : EA * Math.pow(2, -10 * p) * Math.sin((p - E3) * E2) + 1; } // elastic.out(1.2, 0.3)\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function shape(w) { return \"M0,0 L2278,0 L2278,80 C2278,80, 1814,\" + w + \", 1139,\" + w + \" C464,\" + w + \", 0,80, 0,80 Z\"; }\n  function setY(v) { hy = v; bar.style.transform = v ? \"translate3d(0,\" + v.toFixed(3) + \"%,0)\" : \"\"; }\n  function setW(v) { flat = Math.abs(v - 80) < 0.01; path.setAttribute(\"d\", shape(flat ? 80 : v.toFixed(2))); }\n\n  // a tiny tween engine: one running tween per key, rendered from the shared clock\n  function tween(key, from, to, dur, ease, apply, done) {\n    tweens[key] = { from: from, to: to, dur: Math.max(0.001, dur), ease: ease, apply: apply, done: done, t: 0 };\n    apply(from);\n    kick();\n  }\n  function after(sec, fn) { queue.push({ at: clock + sec, fn: fn }); kick(); }\n\n  function hide(dur, ease, done) {\n    hidden = true;\n    if (reduce) { box.classList.add(\"is-off\"); if (done) after(dur, done); return; }\n    tween(\"y\", hy, -100, dur, ease, setY, done);\n  }\n  function drop() {\n    hidden = false;\n    if (reduce) { box.classList.remove(\"is-off\"); return; }\n    tween(\"y\", hy, 0, opts.speed * 0.44, power3Out, setY);\n    tween(\"d\", opts.wiggle, 80, opts.speed, elasticOut, setW);\n  }\n  function loopDrop() { drop(); after(opts.speed + opts.pause, loopHide); }\n  function loopHide() {\n    if (hover || focusIn) { after(0.3, loopHide); return; }\n    hide(0.5, power2InOut);\n    after(0.85, loopDrop);\n  }\n  function startMode() {\n    queue = [];\n    if (opts.autoplay === \"on\" && reduce) {\n      lede.textContent = \"Reduced motion is on, so the header stays put. Press Test animation to fade it out and back.\";\n      if (hidden) drop();\n    } else if (opts.autoplay === \"on\") {\n      lede.textContent = \"This preview loops on its own. On a page, scrolling down hides the header and scrolling up drops it back in with a wiggle.\";\n      if (hidden) after(0.35, loopDrop); else after(opts.pause, loopHide);\n    } else {\n      lede.textContent = \"Scroll down to hide the header, scroll up to drop it back in with a wiggle. Or press Test animation.\";\n      if (hidden) drop();\n    }\n  }\n  function onTest() {\n    queue = [];\n    hide(0.3, power2In, function () {\n      drop();\n      if (opts.autoplay === \"on\" && !reduce) after(opts.speed + opts.pause, loopHide);\n    });\n  }\n\n  // scroll mode: listen in the capture phase, so the window and any scrolling ancestor of the header are both heard\n  function onScroll(e) {\n    if (opts.autoplay === \"on\" || destroyed) return;\n    var t = e.target, src = (!t || t === document || t === document.documentElement || t === document.body) ? null : t;\n    if (src && !(src.contains && src.contains(box))) return;\n    var st = src ? src.scrollTop : (window.pageYOffset || document.documentElement.scrollTop || 0);\n    if (src !== lastSrc) { lastSrc = src; lastTop = 0; }\n    if (st > lastTop && st > 100) { if (!hidden) { queue = []; hide(0.5, power2InOut); } }\n    else if (st < lastTop) { if (hidden) drop(); }\n    lastTop = st <= 0 ? 0 : st;\n  }\n\n  function busy() {\n    for (var k in tweens) return true;\n    return queue.length > 0 || (opts.distortion > 0 && !reduce);\n  }\n  function tick(now) {\n    raf = 0; inTick = true;\n    var dt = Math.min(0.05, (now - last) / 1000 || 0); last = now;\n    if (visible && !document.hidden) {\n      clock += dt;\n      for (var k in tweens) {\n        var tw = tweens[k]; tw.t += dt;\n        var p = Math.min(1, tw.t / tw.dur);\n        tw.apply(tw.from + (tw.to - tw.from) * tw.ease(p));\n        if (p >= 1) { delete tweens[k]; if (tw.done) tw.done(); }\n      }\n      var due = queue.filter(function (q) { return q.at <= clock; });\n      if (due.length) { queue = queue.filter(function (q) { return q.at > clock; }); due.forEach(function (q) { q.fn(); }); }\n      if (opts.distortion > 0 && !reduce) {\n        var tt = clock % 8, ph = tt < 4 ? tt / 4 : (8 - tt) / 4; // 0.004 to 0.009 and back, 4 s each way, sine in-out\n        turb.setAttribute(\"baseFrequency\", (0.004 + 0.005 * (1 - Math.cos(Math.PI * ph)) / 2).toFixed(5));\n      }\n    }\n    inTick = false;\n    if (busy() && !destroyed) raf = requestAnimationFrame(tick);\n  }\n  function kick() { if (!raf && !inTick && !destroyed) { last = performance.now(); raf = requestAnimationFrame(tick); } }\n\n  function buildLinks() {\n    var sig = String(opts.links);\n    if (sig === linkSig) return;\n    linkSig = sig; nav.textContent = \"\";\n    sig.split(\",\").map(function (s) { var k = s.indexOf(\"=\"); return k < 0 ? { t: s.trim(), href: \"#\" } : { t: s.slice(0, k).trim(), href: s.slice(k + 1).trim() || \"#\" }; })\n      .filter(function (l) { return l.t; }).slice(0, 6).forEach(function (l) {\n        var a = document.createElement(\"a\"); a.className = \"ef-wdh__link\"; a.href = l.href; a.textContent = l.t;\n        nav.appendChild(a);\n      });\n  }\n  function onDemoClick(e) { var a = e.target.closest && e.target.closest(\"a\"); if (a && a.getAttribute(\"href\") === \"#\") e.preventDefault(); }\n  function onEnter() { hover = true; }\n  function onLeave() { hover = false; }\n  function onFocusIn() { focusIn = true; if (hidden) { queue = []; drop(); if (opts.autoplay === \"on\" && !reduce) after(opts.speed + opts.pause, loopHide); } }\n  function onFocusOut() { focusIn = bar.contains(document.activeElement); }\n  function onVis() { if (!document.hidden) kick(); }\n\n  function update(partial) {\n    opts = Object.assign({\n      autoplay: \"on\", wiggle: 240, speed: 1.8, distortion: 0, pause: 1.5, links: \"Library, Tools, Pricing\", cta: \"Get started\",\n      colour1: \"#fbf8f1\", colour2: \"#e6ff55\", ink: \"#0c1e18\", background: \"#0c1e18\", text: \"#fbf8f1\"\n    }, opts, partial || {});\n    opts.wiggle = Math.max(0, num(opts.wiggle, 240)); opts.speed = Math.max(0.1, num(opts.speed, 1.8));\n    opts.distortion = Math.max(0, num(opts.distortion, 0)); opts.pause = Math.max(0, num(opts.pause, 1.5));\n    opts.autoplay = opts.autoplay === \"off\" || opts.autoplay === false ? \"off\" : \"on\";\n    box.style.setProperty(\"--ef-wdh-bg\", opts.background);\n    box.style.setProperty(\"--ef-wdh-text\", opts.text);\n    box.style.setProperty(\"--ef-wdh-ink\", opts.ink);\n    stop1.setAttribute(\"stop-color\", opts.colour1);\n    stop2.setAttribute(\"stop-color\", opts.colour2);\n    disp.setAttribute(\"scale\", String(opts.distortion));\n    if (opts.distortion > 0) g.setAttribute(\"filter\", \"url(#\" + filter.id + \")\"); else g.removeAttribute(\"filter\");\n    cta.textContent = opts.cta;\n    buildLinks();\n    if (destroyed) return;\n    if (opts.autoplay !== mode) { mode = opts.autoplay; startMode(); }\n    if (busy()) kick();\n  }\n\n  box.classList.toggle(\"is-still\", reduce);\n  // autoplay starts hidden and drops in straight away; reduced motion starts with the header in place\n  if (!reduce && (o && o.autoplay === \"off\") !== true) { setY(-100); hidden = true; }\n  update(o);\n  test.addEventListener(\"click\", onTest);\n  bar.addEventListener(\"click\", onDemoClick);\n  bar.addEventListener(\"pointerenter\", onEnter);\n  bar.addEventListener(\"pointerleave\", onLeave);\n  bar.addEventListener(\"focusin\", onFocusIn);\n  bar.addEventListener(\"focusout\", onFocusOut);\n  document.addEventListener(\"scroll\", onScroll, { passive: true, capture: true });\n  document.addEventListener(\"visibilitychange\", onVis);\n  if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; if (visible) kick(); }); io.observe(box); }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf); raf = 0; tweens = {}; queue = [];\n      test.removeEventListener(\"click\", onTest);\n      bar.removeEventListener(\"click\", onDemoClick);\n      bar.removeEventListener(\"pointerenter\", onEnter);\n      bar.removeEventListener(\"pointerleave\", onLeave);\n      bar.removeEventListener(\"focusin\", onFocusIn);\n      bar.removeEventListener(\"focusout\", onFocusOut);\n      document.removeEventListener(\"scroll\", onScroll, { passive: true, capture: true });\n      document.removeEventListener(\"visibilitychange\", onVis);\n      if (io) io.disconnect();\n    }\n  };\n}"
  }
}