{
  "id": "clip-reveal-menu",
  "kind": "element",
  "title": "Clip reveal menu",
  "summary": "Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.",
  "url": "https://enrichr.dev/elements/clip-reveal-menu.html",
  "section": "nav",
  "techniques": [
    "pointer-interaction",
    "reveal"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "editorial"
  ],
  "intents": [
    "clip path hover background menu",
    "circle reveal on list hover",
    "text invert on hover",
    "pattern background reveal on row hover",
    "wipe highlight for navigation rows"
  ],
  "status": "tested",
  "params": [
    {
      "key": "items",
      "label": "Rows (comma separated)",
      "type": "text",
      "value": "Brand identity, Web design, Motion, Packaging, Editorial"
    },
    {
      "key": "mode",
      "label": "Reveal style",
      "type": "select",
      "options": [
        [
          "circle",
          "Circle from pointer"
        ],
        [
          "wipe",
          "Wipe from entry side"
        ],
        [
          "grow",
          "Grow from middle"
        ]
      ],
      "value": "circle"
    },
    {
      "key": "speed",
      "label": "Duration (ms)",
      "type": "range",
      "min": 200,
      "max": 1200,
      "step": 50,
      "value": 650
    },
    {
      "key": "color",
      "label": "Text colour",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "accent",
      "label": "Pattern colour",
      "type": "color",
      "value": "#e6ff55"
    }
  ],
  "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 \"Clip reveal menu\" element to this project.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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/clip-reveal-menu.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 \"Clip reveal menu\" 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 \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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 \"Clip reveal menu\" element to this codebase.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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-clip-reveal-menu.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Clip reveal menu 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 \"Clip reveal menu\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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- clip-reveal-menu.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 \"./clip-reveal-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ClipRevealMenu(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 \"Clip reveal menu\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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- clip-reveal-menu.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/ClipRevealMenu.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./clip-reveal-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ClipRevealMenu(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 \"Clip reveal menu\" element.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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), clip-reveal-menu.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 \"Clip reveal menu\" element. No packages, no server code.\n\nThis is the \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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 clip-reveal-menu.js and then main.js), style.css (the CSS below), clip-reveal-menu.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 \"Clip reveal menu\" 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 \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.json\n\nWhat it does: Every row holds its label twice. The first copy is normal text in the page colour. The second sits inside a layer that covers the row, has a pattern drawn with CSS gradients (stripes, dots, a soft ramp, a checker, fine lines, cycling by row) and is clipped away with clip-path. Hover or focus transitions the clip to fully open, so the pattern and the dark copy of the word appear together and the text appears to invert exactly along the moving edge. In circle mode the clip starts as a zero radius circle at the point where the pointer entered and collapses toward the point where it left. Wipe mode slides in from the side of entry, and grow mode opens from the middle line. Rows also open one at a time by themselves while idle so the effect shows without a pointer.\nAccessibility: Rows are focusable and keyboard focus opens the reveal from the left edge. The inverted copy is hidden from assistive technology, so the label is read once. The pattern is decorative and the dark ink on the light pattern keeps strong contrast with the defaults; check it if you recolour. With reduced motion the transition is instant and the idle demo is off.\n\nTunable settings:\n- Rows (comma separated): text, default Brand identity, Web design, Motion, Packaging, Editorial\n- Reveal style: select (Circle from pointer / Wipe from entry side / Grow from middle), default circle\n- Duration (ms): range 200 to 1200, step 50, default 650\n- Text colour: color, default #fbf8f1\n- Pattern colour: color, default #e6ff55\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/clip-reveal-menu.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 \"Clip reveal menu\" 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 \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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 ClipRevealMenu.\n2. Paste the JavaScript below into a separate code file named clip-reveal-menu.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 \"./clip-reveal-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ClipRevealMenu(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(ClipRevealMenu, {\n  items: { type: ControlType.String, title: \"Rows (comma separated)\", defaultValue: \"Brand identity, Web design, Motion, Packaging, Editorial\" },\n  mode: { type: ControlType.Enum, title: \"Reveal style\", options: [\"circle\",\"wipe\",\"grow\"], optionTitles: [\"Circle from pointer\",\"Wipe from entry side\",\"Grow from middle\"], defaultValue: \"circle\" },\n  speed: { type: ControlType.Number, title: \"Duration\", min: 200, max: 1200, step: 50, defaultValue: 650 },\n  color: { type: ControlType.Color, title: \"Text colour\", defaultValue: \"#fbf8f1\" },\n  accent: { type: ControlType.Color, title: \"Pattern colour\", defaultValue: \"#e6ff55\" },\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 \"Clip reveal menu\" 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 \"Clip reveal menu\" element from the Enrichr Library: Text rows that open a generated pattern behind the word with a clip-path transition on hover, while the word inverts along the edge.\nPage: https://enrichr.dev/elements/clip-reveal-menu.html\nMachine-readable spec: https://enrichr.dev/elements/clip-reveal-menu.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-clip-reveal-menu\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-clip-reveal-menu\"), { ...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": "Rows are focusable and keyboard focus opens the reveal from the left edge. The inverted copy is hidden from assistive technology, so the label is read once. The pattern is decorative and the dark ink on the light pattern keeps strong contrast with the defaults; check it if you recolour. With reduced motion the transition is instant and the idle demo is off.",
  "performance": "Only clip-path changes, on one layer per row, and only while a row is transitioning. Patterns are pure CSS gradients with no images. There is no JavaScript loop; the idle demo is a single timer that pauses when the element is off screen.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-clip\"><ul class=\"ef-clip__list\"></ul></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-clip { container-type: inline-size; width: 100%; min-height: 16rem; display: flex; align-items: center; box-sizing: border-box; --ef-clip-d: 650ms; }\n.ef-clip__list { list-style: none; margin: 0; padding: 0; width: 100%; }\n.ef-clip__row { position: relative; overflow: hidden; cursor: pointer; outline: none; border-bottom: 1px solid color-mix(in srgb, var(--ef-clip-c, #fbf8f1) 22%, transparent); }\n.ef-clip__row:first-child { border-top: 1px solid color-mix(in srgb, var(--ef-clip-c, #fbf8f1) 22%, transparent); }\n.ef-clip__t { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.3em 4%; font-family: ui-sans-serif, system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif; font-size: 1.8rem; font-size: clamp(1.4rem, 8.5cqi, 3.1rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; color: var(--ef-clip-c, #fbf8f1); white-space: nowrap; }\n.ef-clip__n { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: max(0.62rem, 0.32em); font-weight: 500; letter-spacing: 0.04em; opacity: 0.7; }\n.ef-clip__bg { position: absolute; inset: 0; clip-path: var(--c0, inset(50% 0 50% 0)); transition: clip-path var(--ef-clip-d) cubic-bezier(0.7, 0, 0.2, 1); pointer-events: none; }\n.ef-clip__row.is-on .ef-clip__bg { clip-path: var(--c1, inset(0)); }\n.ef-clip__bg .ef-clip__t { position: absolute; inset: 0; color: var(--ef-clip-k, #0c1e18); }\n.ef-clip__row:focus-visible { box-shadow: inset 0 0 0 2px var(--ef-clip-a, #e6ff55); }\n.ef-clip.is-still .ef-clip__bg { transition: none; }\n.ef-clip__bg[data-p=\"0\"] { background: repeating-linear-gradient(135deg, var(--ef-clip-a, #e6ff55) 0 14px, color-mix(in srgb, var(--ef-clip-a, #e6ff55) 78%, #fff) 14px 28px); }\n.ef-clip__bg[data-p=\"1\"] { background: radial-gradient(circle, color-mix(in srgb, var(--ef-clip-k, #0c1e18) 55%, transparent) 1.6px, transparent 2.2px) 0 0 / 14px 14px, var(--ef-clip-a, #e6ff55); }\n.ef-clip__bg[data-p=\"2\"] { background: linear-gradient(115deg, color-mix(in srgb, var(--ef-clip-a, #e6ff55) 55%, #7dffc8) 0, var(--ef-clip-a, #e6ff55) 62%); }\n.ef-clip__bg[data-p=\"3\"] { background: repeating-conic-gradient(var(--ef-clip-a, #e6ff55) 0 25%, color-mix(in srgb, var(--ef-clip-a, #e6ff55) 74%, #fff) 0 50%) 0 0 / 30px 30px; }\n.ef-clip__bg[data-p=\"4\"] { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ef-clip-k, #0c1e18) 14%, transparent) 0 2px, transparent 2px 12px), linear-gradient(100deg, var(--ef-clip-a, #e6ff55), color-mix(in srgb, var(--ef-clip-a, #e6ff55) 50%, #c9ffea) 55%, var(--ef-clip-a, #e6ff55)); }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Clip reveal menu: text rows that open a generated pattern behind the word with a clip-path transition on hover or focus, while the word inverts exactly along the clip edge.\n// The pattern is pure CSS gradients, one per row. The inverted word is a second copy of the label inside the clipped layer.\n// mount(root, { items (comma separated), mode (\"circle\" grows from the pointer, \"wipe\" slides in from the side the pointer entered, \"grow\" opens from the middle), speed (ms), color (text), accent (pattern colour), ink (text colour on the pattern), demo (1 = rows open by themselves while idle) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-clip\"), ul = box.querySelector(\".ef-clip__list\");\n  var opts = {}, rows = [], hoverRow = -1, demoTimer = 0, demoOff = 0, demoI = 0, io = null, visible = true, listeners = [];\n  box.classList.toggle(\"is-still\", reduce);\n\n  function clips(row, x, y) {\n    var m = opts.mode, px = Math.round(x) + \"%\", py = Math.round(y) + \"%\";\n    if (m === \"wipe\") { row.style.setProperty(\"--c0\", x < 50 ? \"inset(0 100% 0 0)\" : \"inset(0 0 0 100%)\"); row.style.setProperty(\"--c1\", \"inset(0 0 0 0)\"); }\n    else if (m === \"grow\") { row.style.setProperty(\"--c0\", \"inset(50% 0 50% 0)\"); row.style.setProperty(\"--c1\", \"inset(0 0 0 0)\"); }\n    else { row.style.setProperty(\"--c0\", \"circle(0% at \" + px + \" \" + py + \")\"); row.style.setProperty(\"--c1\", \"circle(150% at \" + px + \" \" + py + \")\"); }\n  }\n  function open(i, x, y) { var r = rows[i]; clips(r, x, y); r.classList.add(\"is-on\"); }\n  function close(i, x, y) { var r = rows[i]; clips(r, x, y); r.classList.remove(\"is-on\"); }\n  function pct(e, r) {\n    var q = r.getBoundingClientRect();\n    return [Math.max(0, Math.min(100, ((e.clientX - q.left) / q.width) * 100)), Math.max(0, Math.min(100, ((e.clientY - q.top) / q.height) * 100))];\n  }\n  function demo() {\n    clearTimeout(demoTimer); demoTimer = 0;\n    if (reduce || !Number(opts.demo) || !rows.length || !visible) return;\n    demoTimer = setTimeout(function () {\n      if (hoverRow < 0) {\n        var i = demoI++ % rows.length;\n        open(i, 8, 50);\n        demoOff = setTimeout(function () { if (rows[i]) close(i, 92, 50); }, 1500);\n      }\n      demo();\n    }, 2800);\n  }\n  function build() {\n    listeners.forEach(function (l) { l[0].removeEventListener(l[1], l[2]); });\n    listeners = []; clearTimeout(demoOff);\n    ul.textContent = \"\";\n    rows = opts.items.split(\",\").map(function (s) { return s.trim(); }).filter(Boolean).map(function (label, i) {\n      var li = document.createElement(\"li\"); li.className = \"ef-clip__row\"; li.tabIndex = 0;\n      function line(hidden) {\n        var t = document.createElement(\"span\"); t.className = \"ef-clip__t\";\n        var a = document.createElement(\"span\"); a.textContent = label;\n        var n = document.createElement(\"span\"); n.className = \"ef-clip__n\"; n.textContent = String(i + 1).padStart(2, \"0\");\n        t.appendChild(a); t.appendChild(n); if (hidden) t.setAttribute(\"aria-hidden\", \"true\"); return t;\n      }\n      var bg = document.createElement(\"div\"); bg.className = \"ef-clip__bg\"; bg.setAttribute(\"data-p\", String(i % 5)); bg.setAttribute(\"aria-hidden\", \"true\");\n      bg.appendChild(line(true));\n      li.appendChild(line(false)); li.appendChild(bg); ul.appendChild(li);\n      var onEnter = function (e) { hoverRow = i; var p = pct(e, li); open(i, p[0], p[1]); };\n      var onLeave = function (e) { if (hoverRow === i) hoverRow = -1; var p = pct(e, li); close(i, p[0], p[1]); };\n      var onFocus = function () { open(i, 0, 50); };\n      var onBlur = function () { close(i, 100, 50); };\n      [[\"pointerenter\", onEnter], [\"pointerleave\", onLeave], [\"focus\", onFocus], [\"blur\", onBlur]].forEach(function (p) { li.addEventListener(p[0], p[1]); listeners.push([li, p[0], p[1]]); });\n      return li;\n    });\n  }\n  function update(next) {\n    var prev = opts.items;\n    opts = Object.assign({ items: \"Brand identity, Web design, Motion, Packaging, Editorial\", mode: \"circle\", speed: 650, color: \"#fbf8f1\", accent: \"#e6ff55\", ink: \"#0c1e18\", demo: 1 }, opts, next || {});\n    box.style.setProperty(\"--ef-clip-c\", opts.color);\n    box.style.setProperty(\"--ef-clip-a\", opts.accent);\n    box.style.setProperty(\"--ef-clip-k\", opts.ink);\n    box.style.setProperty(\"--ef-clip-d\", Math.max(0, Number(opts.speed)) + \"ms\");\n    if (prev !== opts.items) build();\n    rows.forEach(function (r) { clips(r, 50, 50); });\n    demo();\n  }\n  update(o);\n  if (\"IntersectionObserver\" in window && !reduce) {\n    io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; demo(); });\n    io.observe(root);\n  }\n  return {\n    update: update,\n    destroy: function () {\n      clearTimeout(demoTimer); clearTimeout(demoOff);\n      if (io) io.disconnect();\n      listeners.forEach(function (l) { l[0].removeEventListener(l[1], l[2]); });\n      listeners = [];\n    }\n  };\n}"
  }
}