{
  "id": "scrub-stats-band",
  "kind": "element",
  "title": "Scrubbed stats band",
  "summary": "A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.",
  "url": "https://enrichr.dev/elements/scrub-stats-band.html",
  "section": "band",
  "techniques": [
    "scroll-driven"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "confident",
    "clean"
  ],
  "intents": [
    "count up numbers on scroll",
    "stats section",
    "animated statistics",
    "full bleed frame grow",
    "metrics band"
  ],
  "status": "tested",
  "params": [
    {
      "key": "stats",
      "label": "Stats (value:label, comma separated)",
      "type": "text",
      "value": "120+:Projects shipped, 98%:Clients who return, 14:Countries"
    },
    {
      "key": "inset",
      "label": "Starting inset (px each side)",
      "type": "range",
      "min": 0,
      "max": 200,
      "step": 5,
      "value": 80
    },
    {
      "key": "radius",
      "label": "Starting corner radius (px)",
      "type": "range",
      "min": 0,
      "max": 64,
      "step": 2,
      "value": 28
    },
    {
      "key": "manual",
      "label": "Fixed progress % (0 follows scroll)",
      "type": "range",
      "min": 0,
      "max": 100,
      "step": 5,
      "value": 0
    },
    {
      "key": "frameColor",
      "label": "Frame colour",
      "type": "color",
      "value": "#c6f26b"
    },
    {
      "key": "textColor",
      "label": "Text colour",
      "type": "color",
      "value": "#10261f"
    }
  ],
  "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 \"Scrubbed stats band\" element to this project.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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/scrub-stats-band.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 \"Scrubbed stats band\" 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 \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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 \"Scrubbed stats band\" element to this codebase.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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-scrub-stats-band.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Scrubbed stats band 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 \"Scrubbed stats band\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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- scrub-stats-band.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 \"./scrub-stats-band\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrubStatsBand(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 \"Scrubbed stats band\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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- scrub-stats-band.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/ScrubStatsBand.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./scrub-stats-band\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrubStatsBand(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 \"Scrubbed stats band\" element.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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), scrub-stats-band.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 \"Scrubbed stats band\" element. No packages, no server code.\n\nThis is the \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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 scrub-stats-band.js and then main.js), style.css (the CSS below), scrub-stats-band.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 \"Scrubbed stats band\" 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 \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.json\n\nWhat it does: Scroll progress is the band's position as it moves up the viewport, from 0 to 1 over about two thirds of a screen. A smoothstep curve turns that into an ease value. The frame's side margins and corner radius shrink from their starting values to zero by that value, and each number is its target times the same value, so the numbers count up as the frame opens. It is scrubbed, not triggered, so scrolling back plays it in reverse.\nAccessibility: Each stat has a complete label for screen readers and the counting digits are hidden from them, so nothing announces 'one, two, three' while counting. With reduced motion the frame is full width and the numbers show their final values.\n\nTunable settings:\n- Stats (value:label, comma separated): text, default 120+:Projects shipped, 98%:Clients who return, 14:Countries\n- Starting inset (px each side): range 0 to 200, step 5, default 80\n- Starting corner radius (px): range 0 to 64, step 2, default 28\n- Fixed progress % (0 follows scroll): range 0 to 100, step 5, default 0\n- Frame colour: color, default #c6f26b\n- Text colour: color, default #10261f\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/scrub-stats-band.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 \"Scrubbed stats band\" 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 \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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 ScrubStatsBand.\n2. Paste the JavaScript below into a separate code file named scrub-stats-band.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 \"./scrub-stats-band\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrubStatsBand(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(ScrubStatsBand, {\n  stats: { type: ControlType.String, title: \"Stats (value:label, comma separated)\", defaultValue: \"120+:Projects shipped, 98%:Clients who return, 14:Countries\" },\n  inset: { type: ControlType.Number, title: \"Starting inset\", min: 0, max: 200, step: 5, defaultValue: 80 },\n  radius: { type: ControlType.Number, title: \"Starting corner radius\", min: 0, max: 64, step: 2, defaultValue: 28 },\n  manual: { type: ControlType.Number, title: \"Fixed progress %\", min: 0, max: 100, step: 5, defaultValue: 0 },\n  frameColor: { type: ControlType.Color, title: \"Frame colour\", defaultValue: \"#c6f26b\" },\n  textColor: { type: ControlType.Color, title: \"Text colour\", defaultValue: \"#10261f\" },\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 \"Scrubbed stats band\" 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 \"Scrubbed stats band\" element from the Enrichr Library: A framed band that grows to full width while its numbers count up, tied to scroll position and reversible.\nPage: https://enrichr.dev/elements/scrub-stats-band.html\nMachine-readable spec: https://enrichr.dev/elements/scrub-stats-band.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-scrub-stats-band\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-scrub-stats-band\"), { ...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": "Each stat has a complete label for screen readers and the counting digits are hidden from them, so nothing announces 'one, two, three' while counting. With reduced motion the frame is full width and the numbers show their final values.",
  "performance": "One bounding-rect read per frame while on screen, and writes only when progress changed. Margin and radius change layout slightly, so keep the band's content simple.",
  "dependencies": [],
  "source": {
    "markup": "<section class=\"ef-stats\">\r\n  <div class=\"ef-stats__frame\"><ul class=\"ef-stats__list\"></ul></div>\r\n</section>",
    "css": ".ef-stats { overflow: hidden; }\r\n.ef-stats__frame { padding: 2.4rem 1.6rem; background: var(--ef-frame, #c6f26b); color: var(--ef-ink, #10261f); will-change: margin, border-radius; }\r\n.ef-stats__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.4rem; text-align: center; }\r\n.ef-stats__n { display: block; font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }\r\n.ef-stats__l { display: block; margin-top: 0.4rem; font-size: 0.9rem; opacity: 0.8; }",
    "js": "// Scrubbed stats band: as the band scrolls into view, an inset coloured frame grows to full width and its numbers count up.\r\n// It is scrubbed, not triggered: scrolling back reverses it. No animation library.\r\n// mount(root, { stats (\"120+:Projects, 98%:Retention\"), inset (px), radius (px), manual (0 = follow scroll, 1-100 = fixed %), frameColor, textColor })\r\nfunction mount(root, o) {\r\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\r\n  var sec = root.querySelector(\".ef-stats\");\r\n  var frame = root.querySelector(\".ef-stats__frame\");\r\n  var list = root.querySelector(\".ef-stats__list\");\r\n  var opts = {}, items = [], raf = 0, visible = true, io = null, lastP = -1;\r\n\r\n  function parse(str) {\r\n    return str.split(\",\").map(function (chunk) {\r\n      var parts = chunk.split(\":\");\r\n      var m = /^(\\d+(?:\\.\\d+)?)(.*)$/.exec((parts[0] || \"\").trim());\r\n      return { n: m ? parseFloat(m[1]) : 0, suffix: m ? m[2] : \"\", label: parts.slice(1).join(\":\").trim() };\r\n    }).filter(function (i) { return i.label || i.n; });\r\n  }\r\n  function render() {\r\n    list.textContent = \"\";\r\n    frame.style.setProperty(\"--ef-frame\", opts.frameColor);\r\n    frame.style.setProperty(\"--ef-ink\", opts.textColor);\r\n    items = parse(opts.stats).map(function (i) {\r\n      var li = document.createElement(\"li\");\r\n      li.setAttribute(\"aria-label\", i.n + i.suffix + \" \" + i.label);\r\n      var n = document.createElement(\"span\"); n.className = \"ef-stats__n\"; n.setAttribute(\"aria-hidden\", \"true\");\r\n      var l = document.createElement(\"span\"); l.className = \"ef-stats__l\"; l.setAttribute(\"aria-hidden\", \"true\"); l.textContent = i.label;\r\n      li.appendChild(n); li.appendChild(l); list.appendChild(li);\r\n      return { i: i, num: n };\r\n    });\r\n    lastP = -1;\r\n    paint(true);\r\n  }\r\n  function progress() {\r\n    if (reduce) return 1;\r\n    if (opts.manual > 0) return opts.manual / 100;\r\n    var r = sec.getBoundingClientRect(), vh = window.innerHeight || 800;\r\n    return Math.min(1, Math.max(0, (vh * 0.95 - r.top) / (vh * 0.65)));\r\n  }\r\n  function paint(force) {\r\n    var p = progress();\r\n    if (!force && Math.abs(p - lastP) < 0.002) return;\r\n    lastP = p;\r\n    var e = p * p * (3 - 2 * p);\r\n    var inset = (1 - e) * opts.inset;\r\n    frame.style.margin = \"0 \" + inset.toFixed(1) + \"px\";\r\n    frame.style.borderRadius = ((1 - e) * opts.radius).toFixed(1) + \"px\";\r\n    items.forEach(function (it) {\r\n      var v = it.i.n * e;\r\n      it.num.textContent = (it.i.n % 1 ? v.toFixed(1) : Math.round(v)) + it.i.suffix;\r\n    });\r\n  }\r\n  function tick() { raf = requestAnimationFrame(tick); if (visible) paint(false); }\r\n  function update(next) {\r\n    opts = Object.assign({ stats: \"120+:Projects shipped, 98%:Clients who return, 14:Countries\", inset: 80, radius: 28, manual: 0, frameColor: \"#c6f26b\", textColor: \"#10261f\" }, opts, next || {});\r\n    render();\r\n  }\r\n  update(o);\r\n  if (!reduce) {\r\n    if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(sec); }\r\n    raf = requestAnimationFrame(tick);\r\n  }\r\n  return { update: update, destroy: function () { cancelAnimationFrame(raf); if (io) io.disconnect(); } };\r\n}"
  }
}