{
  "id": "footer-bounce-scroll",
  "kind": "element",
  "title": "Footer bounce on scroll speed",
  "summary": "A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.",
  "url": "https://enrichr.dev/elements/footer-bounce-scroll.html",
  "section": "band",
  "techniques": [
    "scroll-driven",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "playful",
    "bold",
    "fluid"
  ],
  "intents": [
    "footer bounce on scroll",
    "elastic stretch scroll velocity",
    "spring footer animation",
    "scroll speed squash and stretch",
    "playful site footer"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "text",
      "label": "Headline",
      "type": "text",
      "value": "Let's make it"
    },
    {
      "key": "strength",
      "label": "Stretch strength",
      "type": "range",
      "min": 0.2,
      "max": 3,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "stiffness",
      "label": "Spring stiffness",
      "type": "range",
      "min": 40,
      "max": 400,
      "step": 10,
      "value": 160
    },
    {
      "key": "bounce",
      "label": "Bounciness",
      "type": "range",
      "min": 0.1,
      "max": 0.9,
      "step": 0.05,
      "value": 0.6
    }
  ],
  "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 \"Footer bounce on scroll speed\" element to this project.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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/footer-bounce-scroll.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 \"Footer bounce on scroll speed\" 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 \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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 \"Footer bounce on scroll speed\" element to this codebase.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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-footer-bounce-scroll.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Footer bounce on scroll speed 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 \"Footer bounce on scroll speed\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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- footer-bounce-scroll.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 \"./footer-bounce-scroll\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FooterBounceScroll(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 \"Footer bounce on scroll speed\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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- footer-bounce-scroll.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/FooterBounceScroll.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./footer-bounce-scroll\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FooterBounceScroll(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 \"Footer bounce on scroll speed\" element.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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), footer-bounce-scroll.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 \"Footer bounce on scroll speed\" element. No packages, no server code.\n\nThis is the \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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 footer-bounce-scroll.js and then main.js), style.css (the CSS below), footer-bounce-scroll.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 \"Footer bounce on scroll speed\" 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 \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.json\n\nWhat it does: The script keeps one stretch value s and a velocity v for a damped spring. Each scroll movement adds an impulse to v that is proportional to the scroll distance, so faster scrolling kicks harder. A short animation loop integrates the spring in a few sub-steps per frame and writes scale(1 - s * 0.12, 1 + s) on the footer with its origin at the bottom edge, so it grows upward and thins slightly, then overshoots and settles. Page scroll supplies the impulse when the page scrolls; when it does not (a clipped preview, or a short page) the wheel, a pointer drag and the arrow and page keys on the element supply it instead. The loop stops when the spring is at rest.\nAccessibility: The element is a focusable group so keyboard users can trigger the bounce with the arrow and page keys when the page itself does not scroll; when it does, those keys scroll the page as usual. Reduced motion turns the stretch off entirely and leaves a static footer. Keep real links in the footer as normal anchors; the stretch is purely visual and does not move focus targets far, but avoid putting tiny controls near the stretched top edge.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Headline: text, default Let's make it\n- Stretch strength: range 0.2 to 3, step 0.1, default 1\n- Spring stiffness: range 40 to 400, step 10, default 160\n- Bounciness: range 0.1 to 0.9, step 0.05, default 0.6\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/footer-bounce-scroll.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 \"Footer bounce on scroll speed\" 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 \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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 FooterBounceScroll.\n2. Paste the JavaScript below into a separate code file named footer-bounce-scroll.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 \"./footer-bounce-scroll\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function FooterBounceScroll(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(FooterBounceScroll, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  text: { type: ControlType.String, title: \"Headline\", defaultValue: \"Let's make it\" },\n  strength: { type: ControlType.Number, title: \"Stretch strength\", min: 0.2, max: 3, step: 0.1, defaultValue: 1 },\n  stiffness: { type: ControlType.Number, title: \"Spring stiffness\", min: 40, max: 400, step: 10, defaultValue: 160 },\n  bounce: { type: ControlType.Number, title: \"Bounciness\", min: 0.1, max: 0.9, step: 0.05, defaultValue: 0.6 },\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 \"Footer bounce on scroll speed\" 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 \"Footer bounce on scroll speed\" element from the Enrichr Library: A footer block that stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\nPage: https://enrichr.dev/elements/footer-bounce-scroll.html\nMachine-readable spec: https://enrichr.dev/elements/footer-bounce-scroll.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-footer-bounce-scroll\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-footer-bounce-scroll\"), { ...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 is a focusable group so keyboard users can trigger the bounce with the arrow and page keys when the page itself does not scroll; when it does, those keys scroll the page as usual. Reduced motion turns the stretch off entirely and leaves a static footer. Keep real links in the footer as normal anchors; the stretch is purely visual and does not move focus targets far, but avoid putting tiny controls near the stretched top edge.",
  "performance": "Only a single transform is written per frame on one element, and only while the spring is moving. The scroll listener is passive and ignores events when the footer is off screen. No layout properties are animated.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-fbs\">\n  <div class=\"ef-fbs__wrap\" tabindex=\"0\" role=\"group\" aria-label=\"Footer that stretches and bounces with scroll speed. Scroll, drag or use the arrow keys over it.\">\n    <div class=\"ef-fbs__foot\">\n      <span class=\"ef-fbs__bar\" aria-hidden=\"true\"></span>\n      <p class=\"ef-fbs__kick\">Say hello</p>\n      <p class=\"ef-fbs__head\"></p>\n      <p class=\"ef-fbs__links\"><span>hello@studio.example</span><span>Instagram</span><span>Back to top</span></p>\n    </div>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-fbs { width: 100%; }\n.ef-fbs__wrap { position: relative; box-sizing: border-box; width: 100%; height: 22rem; overflow: hidden; border-radius: 1rem; display: flex; align-items: flex-end; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; outline: none; overscroll-behavior: contain; }\n.ef-fbs__wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--ef-acc, #e6ff55); }\n.ef-fbs__foot { --s: 0; position: relative; box-sizing: border-box; width: 100%; height: 13rem; padding: 1.6rem 1.6rem 1.3rem; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 1.6rem 1.6rem 0 0; background: #005236; color: #f2f6f0; transform-origin: 50% 100%; will-change: transform; }\n.ef-fbs__bar { position: absolute; left: 0; right: 0; top: 0; height: 0.4rem; border-radius: 1.6rem 1.6rem 0 0; background: var(--ef-acc, #e6ff55); opacity: calc(0.35 + var(--s) * 0.65); }\n.ef-fbs__kick { margin: 0 0 0.3rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ef-acc, #e6ff55); }\n.ef-fbs__head { margin: 0; font-size: clamp(2.4rem, 11vw, 5rem); font-weight: 900; letter-spacing: -0.04em; line-height: 0.95; }\n.ef-fbs__links { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.8rem; opacity: 0.85; }\n@media (prefers-reduced-motion: reduce) { .ef-fbs__foot { will-change: auto; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Footer bounce on scroll speed: the footer block stretches and squashes from its bottom edge by how fast you scroll, then wobbles back on a damped spring.\n// Velocity comes from page scroll when the page scrolls, and from wheel, touch/mouse drag and arrow keys on the element itself when it does not (e.g. a clipped preview).\n// Reduced motion keeps the block still. mount(root, { background, accent, text, strength (0.2-3), stiffness (40-400), bounce (0.1-0.9) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-fbs__wrap\");\n  var foot = root.querySelector(\".ef-fbs__foot\");\n  var head = root.querySelector(\".ef-fbs__head\");\n  var opts = {}, offs = [], raf = 0, last = 0, s = 0, v = 0, lastY = 0, drag = null, visible = true;\n\n  function scrollable() { var d = document.documentElement; return d.scrollHeight > window.innerHeight + 2; }\n  function impulse(dy) {\n    if (reduce) return;\n    var d = Math.max(-120, Math.min(120, dy));\n    v += d * 0.045 * opts.strength;\n    run();\n  }\n  function paint() {\n    var c = Math.max(-0.35, Math.min(0.9, s));\n    foot.style.transform = reduce ? \"none\" : \"scale(\" + (1 - c * 0.12).toFixed(4) + \", \" + (1 + c).toFixed(4) + \")\";\n    foot.style.setProperty(\"--s\", Math.min(1, Math.abs(c)).toFixed(3));\n  }\n  function run() { if (!raf) { last = performance.now(); raf = requestAnimationFrame(tick); } }\n  function tick(t) {\n    raf = 0;\n    var dt = Math.min(0.05, (t - last) / 1000); last = t;\n    var k = opts.stiffness, ratio = Math.max(0.12, 1.05 - opts.bounce), c = 2 * ratio * Math.sqrt(k);\n    var n = 4, h = dt / n;\n    for (var i = 0; i < n; i++) { v += (-k * s - c * v) * h; s += v * h; }\n    paint();\n    if (Math.abs(s) < 0.0006 && Math.abs(v) < 0.006) { s = 0; v = 0; paint(); return; }\n    run();\n  }\n  function onWheel(e) {\n    if (scrollable()) return;\n    impulse(e.deltaY * (e.deltaMode === 1 ? 32 : e.deltaMode === 2 ? 400 : 1) * 0.6);\n  }\n  function onScroll() {\n    var y = window.pageYOffset || document.documentElement.scrollTop || 0, dy = y - lastY;\n    lastY = y;\n    if (visible) impulse(dy * 0.8);\n  }\n  function onDown(e) { drag = { y: e.clientY, id: e.pointerId }; try { wrap.setPointerCapture(e.pointerId); } catch (x) {} }\n  function onMove(e) {\n    if (!drag || e.pointerId !== drag.id) return;\n    var dy = e.clientY - drag.y; drag.y = e.clientY;\n    impulse(-dy * 1.2);\n  }\n  function onUp(e) { if (drag && e.pointerId === drag.id) { try { wrap.releasePointerCapture(e.pointerId); } catch (x) {} drag = null; } }\n  function onKey(e) {\n    var map = { ArrowDown: 40, ArrowUp: -40, PageDown: 110, PageUp: -110 };\n    if (!(e.key in map)) return;\n    if (scrollable()) return;\n    e.preventDefault();\n    impulse(map[e.key]);\n  }\n  function touchMode() { wrap.style.touchAction = scrollable() ? \"pan-y\" : \"none\"; }\n  function bind() {\n    lastY = window.pageYOffset || 0;\n    wrap.addEventListener(\"wheel\", onWheel, { passive: true });\n    wrap.addEventListener(\"pointerdown\", onDown);\n    wrap.addEventListener(\"pointermove\", onMove);\n    wrap.addEventListener(\"pointerup\", onUp);\n    wrap.addEventListener(\"pointercancel\", onUp);\n    wrap.addEventListener(\"keydown\", onKey);\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    window.addEventListener(\"resize\", touchMode);\n    var io = null;\n    if (window.IntersectionObserver) { io = new IntersectionObserver(function (en) { visible = en[0].isIntersecting; }); io.observe(wrap); }\n    touchMode();\n    offs.push(function () {\n      wrap.removeEventListener(\"wheel\", onWheel); wrap.removeEventListener(\"pointerdown\", onDown);\n      wrap.removeEventListener(\"pointermove\", onMove); wrap.removeEventListener(\"pointerup\", onUp);\n      wrap.removeEventListener(\"pointercancel\", onUp); wrap.removeEventListener(\"keydown\", onKey);\n      window.removeEventListener(\"scroll\", onScroll); window.removeEventListener(\"resize\", touchMode);\n      if (io) io.disconnect();\n    });\n  }\n  function update(next) {\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", text: \"Let's make it\", strength: 1, stiffness: 160, bounce: 0.6 }, opts, next || {});\n    opts.strength = Math.max(0.2, Math.min(3, +opts.strength));\n    opts.stiffness = Math.max(40, Math.min(400, +opts.stiffness));\n    opts.bounce = Math.max(0.1, Math.min(0.9, +opts.bounce));\n    wrap.style.background = opts.background;\n    wrap.style.setProperty(\"--ef-acc\", opts.accent);\n    head.textContent = String(opts.text);\n    paint();\n  }\n  bind();\n  update(o);\n  return {\n    update: update,\n    destroy: function () {\n      offs.forEach(function (f) { f(); }); offs = [];\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0; s = 0; v = 0; foot.style.transform = \"none\";\n    }\n  };\n}"
  }
}