{
  "id": "circle-reveal-intro",
  "kind": "element",
  "title": "Circle reveal intro",
  "summary": "A gate button opens a circle from the click point that grows to reveal the page.",
  "url": "https://enrichr.dev/elements/circle-reveal-intro.html",
  "section": "hero",
  "techniques": [
    "reveal"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "cinematic",
    "bold"
  ],
  "intents": [
    "page intro",
    "enter button reveal",
    "circle transition",
    "clip path reveal",
    "loader reveal"
  ],
  "status": "tested",
  "params": [
    {
      "key": "title",
      "label": "Revealed title",
      "type": "text",
      "value": "Welcome"
    },
    {
      "key": "label",
      "label": "Button label",
      "type": "text",
      "value": "Enter"
    },
    {
      "key": "origin",
      "label": "Circle starts at",
      "type": "select",
      "options": [
        [
          "click",
          "Click point"
        ],
        [
          "center",
          "Centre"
        ]
      ],
      "value": "click"
    },
    {
      "key": "duration",
      "label": "Duration (ms)",
      "type": "range",
      "min": 300,
      "max": 2500,
      "step": 50,
      "value": 1100
    },
    {
      "key": "auto",
      "label": "Open",
      "type": "select",
      "options": [
        [
          "0",
          "On button press"
        ],
        [
          "1",
          "Automatically in view"
        ]
      ],
      "value": "0"
    },
    {
      "key": "coverColor",
      "label": "Cover colour",
      "type": "color",
      "value": "#10261f"
    },
    {
      "key": "contentColor",
      "label": "Revealed colour",
      "type": "color",
      "value": "#c6f26b"
    },
    {
      "key": "textColor",
      "label": "Revealed 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 \"Circle reveal intro\" element to this project.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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/circle-reveal-intro.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 \"Circle reveal intro\" 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 \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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 \"Circle reveal intro\" element to this codebase.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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-circle-reveal-intro.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Circle reveal intro 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 \"Circle reveal intro\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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- circle-reveal-intro.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 \"./circle-reveal-intro\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CircleRevealIntro(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 \"Circle reveal intro\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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- circle-reveal-intro.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/CircleRevealIntro.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./circle-reveal-intro\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CircleRevealIntro(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 \"Circle reveal intro\" element.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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), circle-reveal-intro.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 \"Circle reveal intro\" element. No packages, no server code.\n\nThis is the \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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 circle-reveal-intro.js and then main.js), style.css (the CSS below), circle-reveal-intro.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 \"Circle reveal intro\" 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 \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.json\n\nWhat it does: The revealed layer sits on top of the cover, clipped to a circle of zero size at a point set by two CSS variables. Opening adds a class that transitions the clip-path to a circle of 150% radius, which is enough to cover the box from any starting point. When the transition ends the clip is removed so nothing stays masked. Until it opens the content is inert and hidden from assistive technology, so nothing behind the gate can be focused.\nAccessibility: The gate is a real button with a visible focus style, and the content is inert until it opens. With reduced motion the reveal is instant. The automatic mode is for pages where a gate would only add friction.\n\nTunable settings:\n- Revealed title: text, default Welcome\n- Button label: text, default Enter\n- Circle starts at: select (Click point / Centre), default click\n- Duration (ms): range 300 to 2500, step 50, default 1100\n- Open: select (On button press / Automatically in view), default 0\n- Cover colour: color, default #10261f\n- Revealed colour: color, default #c6f26b\n- Revealed 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/circle-reveal-intro.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 \"Circle reveal intro\" 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 \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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 CircleRevealIntro.\n2. Paste the JavaScript below into a separate code file named circle-reveal-intro.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 \"./circle-reveal-intro\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CircleRevealIntro(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(CircleRevealIntro, {\n  title: { type: ControlType.String, title: \"Revealed title\", defaultValue: \"Welcome\" },\n  label: { type: ControlType.String, title: \"Button label\", defaultValue: \"Enter\" },\n  origin: { type: ControlType.Enum, title: \"Circle starts at\", options: [\"click\",\"center\"], optionTitles: [\"Click point\",\"Centre\"], defaultValue: \"click\" },\n  duration: { type: ControlType.Number, title: \"Duration\", min: 300, max: 2500, step: 50, defaultValue: 1100 },\n  auto: { type: ControlType.Enum, title: \"Open\", options: [\"0\",\"1\"], optionTitles: [\"On button press\",\"Automatically in view\"], defaultValue: \"0\" },\n  coverColor: { type: ControlType.Color, title: \"Cover colour\", defaultValue: \"#10261f\" },\n  contentColor: { type: ControlType.Color, title: \"Revealed colour\", defaultValue: \"#c6f26b\" },\n  textColor: { type: ControlType.Color, title: \"Revealed 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 \"Circle reveal intro\" 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 \"Circle reveal intro\" element from the Enrichr Library: A gate button opens a circle from the click point that grows to reveal the page.\nPage: https://enrichr.dev/elements/circle-reveal-intro.html\nMachine-readable spec: https://enrichr.dev/elements/circle-reveal-intro.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-circle-reveal-intro\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-circle-reveal-intro\"), { ...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 gate is a real button with a visible focus style, and the content is inert until it opens. With reduced motion the reveal is instant. The automatic mode is for pages where a gate would only add friction.",
  "performance": "A single clip-path transition on one layer. No JavaScript runs during the animation, and the clip is removed afterward.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-circle\">\r\n  <div class=\"ef-circle__cover\"><button class=\"ef-circle__go\" type=\"button\">Enter</button></div>\r\n  <div class=\"ef-circle__content\"><h3 class=\"ef-circle__title\"></h3></div>\r\n</div>",
    "css": ".ef-circle { position: relative; min-height: 16rem; overflow: hidden; border-radius: 1rem; --cx: 50%; --cy: 50%; --ef-dur: 1100ms; }\r\n.ef-circle__cover, .ef-circle__content { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }\r\n.ef-circle__go { appearance: none; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.8rem 1.6rem; border-radius: 100rem; cursor: pointer; }\r\n.ef-circle__go:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\r\n.ef-circle__content { clip-path: circle(0% at var(--cx) var(--cy)); transition: clip-path var(--ef-dur) cubic-bezier(0.7, 0, 0.2, 1); }\r\n.ef-circle.is-open .ef-circle__content { clip-path: circle(150% at var(--cx) var(--cy)); }\r\n.ef-circle.is-done .ef-circle__content { clip-path: none; transition: none; }\r\n.ef-circle__title { margin: 0; font-size: clamp(2rem, 7vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; text-align: center; padding: 0 1rem; }\r\n@media (prefers-reduced-motion: reduce) { .ef-circle__content { transition: none; } }",
    "js": "// Circle reveal intro: a gate (button or automatic) opens a circle that grows from the click point and reveals the page.\r\n// mount(root, { title, label, origin (\"click\" or \"center\"), duration (ms), auto (1 = reveal when scrolled into view, 0 = wait for the button),\r\n//               coverColor, contentColor, textColor }) -> { update, replay, destroy }\r\nfunction mount(root, o) {\r\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\r\n  var box = root.querySelector(\".ef-circle\");\r\n  var cover = box.querySelector(\".ef-circle__cover\");\r\n  var content = box.querySelector(\".ef-circle__content\");\r\n  var btn = box.querySelector(\".ef-circle__go\");\r\n  var title = box.querySelector(\".ef-circle__title\");\r\n  var opts = {}, opened = false, io = null, timer = 0;\r\n\r\n  function lock(on) { content.inert = on; content.setAttribute(\"aria-hidden\", on ? \"true\" : \"false\"); }\r\n  function finish() { box.classList.add(\"is-done\"); }\r\n  function open(e) {\r\n    if (opened) return;\r\n    opened = true;\r\n    var click = opts.origin === \"click\" && e && e.detail > 0 && typeof e.clientX === \"number\";\r\n    if (click) {\r\n      var r = box.getBoundingClientRect();\r\n      box.style.setProperty(\"--cx\", ((e.clientX - r.left) / r.width) * 100 + \"%\");\r\n      box.style.setProperty(\"--cy\", ((e.clientY - r.top) / r.height) * 100 + \"%\");\r\n    } else {\r\n      box.style.setProperty(\"--cx\", \"50%\");\r\n      box.style.setProperty(\"--cy\", \"50%\");\r\n    }\r\n    lock(false);\r\n    box.classList.add(\"is-open\");\r\n    if (reduce) finish(); else timer = setTimeout(finish, opts.duration + 50);\r\n  }\r\n  function replay() {\r\n    clearTimeout(timer);\r\n    opened = false;\r\n    box.classList.remove(\"is-open\", \"is-done\");\r\n    void box.offsetWidth;\r\n    lock(true);\r\n    if (opts.auto && visible) timer = setTimeout(open, 350);\r\n  }\r\n  var visible = false;\r\n  function update(next) {\r\n    opts = Object.assign({ title: \"Welcome\", label: \"Enter\", origin: \"click\", duration: 1100, auto: 0, coverColor: \"#10261f\", contentColor: \"#c6f26b\", textColor: \"#10261f\" }, opts, next || {});\r\n    cover.style.background = opts.coverColor;\r\n    cover.style.color = opts.contentColor;\r\n    content.style.background = opts.contentColor;\r\n    content.style.color = opts.textColor;\r\n    title.textContent = opts.title;\r\n    btn.textContent = opts.label;\r\n    btn.hidden = !!opts.auto;\r\n    box.style.setProperty(\"--ef-dur\", opts.duration + \"ms\");\r\n    if (!opened) lock(true);\r\n    if (opts.auto && !opened && visible) { clearTimeout(timer); timer = setTimeout(open, 350); }\r\n  }\r\n  update(o);\r\n  btn.addEventListener(\"click\", open);\r\n  if (\"IntersectionObserver\" in window) {\r\n    io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; if (visible && opts.auto && !opened) timer = setTimeout(open, 350); }, { threshold: 0.3 });\r\n    io.observe(root);\r\n  }\r\n  return { update: update, replay: replay, destroy: function () { clearTimeout(timer); if (io) io.disconnect(); btn.removeEventListener(\"click\", open); } };\r\n}"
  }
}