{
  "id": "ease-reverse-clip-menu",
  "kind": "element",
  "title": "Clip menu with ease-reverse close",
  "summary": "A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.",
  "url": "https://enrichr.dev/elements/ease-reverse-clip-menu.html",
  "section": "nav",
  "techniques": [
    "reveal",
    "stagger",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "playful",
    "kinetic",
    "polished"
  ],
  "intents": [
    "fullscreen menu opens with clip path from center",
    "menu close animation feels snappier than open",
    "tiles fly outward radially on menu open",
    "interrupt menu animation mid open",
    "reverse animation with different easing"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "easeReverse",
      "label": "Ease reverse",
      "type": "select",
      "options": [
        [
          "on",
          "On"
        ],
        [
          "off",
          "Off (plain reverse)"
        ]
      ],
      "value": "on"
    },
    {
      "key": "exitSpeed",
      "label": "Interrupt speed",
      "type": "range",
      "min": 1,
      "max": 4,
      "step": 0.25,
      "value": 1.5
    },
    {
      "key": "distance",
      "label": "Fly distance (px)",
      "type": "range",
      "min": 200,
      "max": 900,
      "step": 20,
      "value": 420
    },
    {
      "key": "tiles",
      "label": "Tiles",
      "type": "range",
      "min": 6,
      "max": 16,
      "step": 1,
      "value": 12
    }
  ],
  "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 menu with ease-reverse close\" element to this project.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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/ease-reverse-clip-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 menu with ease-reverse close\" 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 menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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 menu with ease-reverse close\" element to this codebase.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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-ease-reverse-clip-menu.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Clip menu with ease-reverse close 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 menu with ease-reverse close\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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- ease-reverse-clip-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 \"./ease-reverse-clip-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function EaseReverseClipMenu(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 menu with ease-reverse close\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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- ease-reverse-clip-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/EaseReverseClipMenu.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./ease-reverse-clip-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function EaseReverseClipMenu(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 menu with ease-reverse close\" element.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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), ease-reverse-clip-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 menu with ease-reverse close\" element. No packages, no server code.\n\nThis is the \"Clip menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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 ease-reverse-clip-menu.js and then main.js), style.css (the CSS below), ease-reverse-clip-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 menu with ease-reverse close\" 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 menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-menu.json\n\nWhat it does: This is a vanilla port of the Codrops easeReverse clip menu, with no GSAP. A single clock runs from 0 to 1.1 seconds. Each tile and the menu read it through their own window (start and duration), and tiles nearer the centre start later. Going forward every value uses an expo-out curve. Going backward the value is 1 minus the curve evaluated on the remaining time, so the closing motion starts fast and settles softly instead of replaying the opening backwards. A full close swaps the tile curve for an elastic out so tiles overshoot home. Closing before the opening finished runs the clock backward faster, set by the speed control. When the curve changes, the gap is remembered and faded out over about a tenth of a second so nothing jumps.\nAccessibility: The toggle is a button with aria-expanded and a changing label. The menu is inert while closed, so its links cannot take focus or be read, and Escape closes it and returns focus to the toggle. The tile cover is decorative and hidden from assistive tech. With prefers-reduced-motion the menu simply appears and the tiles hide with no travel.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Ease reverse: select (On / Off (plain reverse)), default on\n- Interrupt speed: range 1 to 4, step 0.25, default 1.5\n- Fly distance (px): range 200 to 900, step 20, default 420\n- Tiles: range 6 to 16, step 1, default 12\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/ease-reverse-clip-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 menu with ease-reverse close\" 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 menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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 EaseReverseClipMenu.\n2. Paste the JavaScript below into a separate code file named ease-reverse-clip-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 \"./ease-reverse-clip-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function EaseReverseClipMenu(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(EaseReverseClipMenu, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  easeReverse: { type: ControlType.Enum, title: \"Ease reverse\", options: [\"on\",\"off\"], optionTitles: [\"On\",\"Off (plain reverse)\"], defaultValue: \"on\" },\n  exitSpeed: { type: ControlType.Number, title: \"Interrupt speed\", min: 1, max: 4, step: 0.25, defaultValue: 1.5 },\n  distance: { type: ControlType.Number, title: \"Fly distance\", min: 200, max: 900, step: 20, defaultValue: 420 },\n  tiles: { type: ControlType.Number, title: \"Tiles\", min: 6, max: 16, step: 1, defaultValue: 12 },\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 menu with ease-reverse close\" 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 menu with ease-reverse close\" element from the Enrichr Library: A tile cover that flies apart radially while a menu opens from the centre as a clip-path, with a closing motion that keeps its own out-curve, an elastic return, and a faster interrupt.\nPage: https://enrichr.dev/elements/ease-reverse-clip-menu.html\nMachine-readable spec: https://enrichr.dev/elements/ease-reverse-clip-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-ease-reverse-clip-menu\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-ease-reverse-clip-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": "The toggle is a button with aria-expanded and a changing label. The menu is inert while closed, so its links cannot take focus or be read, and Escape closes it and returns focus to the toggle. The tile cover is decorative and hidden from assistive tech. With prefers-reduced-motion the menu simply appears and the tiles hide with no travel.",
  "performance": "Each frame writes one transform and opacity per tile and one clip-path on the menu. Tile positions are measured on build and on resize, not per frame. The loop stops when the clock reaches either end and the jump correction has faded.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/yyMGqme",
  "source": {
    "markup": "<div class=\"ef-erm\">\n  <svg class=\"ef-erm__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\">\n    <symbol id=\"ef-erm-pz1\" viewBox=\"1513.7 1453.9 322.3 322.3\"><path fill=\"currentColor\" d=\"M1821 1761.2h-292.3v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5.1 7.8 8.6 19.7 13.6 32.7 11.9 16.8-2.3 30.1-16 32-32.7 2.5-22.6-15.1-41.6-37.1-41.6-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.4-14.5-14.4v-111.7h292.3v111.7c0 8-6.4 14.4-14.5 14.4-4.2 0-8.1-1.8-10.9-5-7.9-8.6-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.6 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5z\"/></symbol>\n    <symbol id=\"ef-erm-pz4\" viewBox=\"1423.36 860.8 503.07 322.3\"><path fill=\"currentColor\" d=\"M1821 875.8v111.6c0 8 6.5 14.5 14.5 14.5 4.2 0 8.1-1.9 10.9-5 6.8-7.5 16.7-12.3 27.7-12.3 22 0 39.6 19 37.1 41.6-1.9 16.7-15.2 30.5-32 32.7-13 1.7-24.8-3.3-32.7-11.9-2.8-3.2-6.8-5-11-5-8 0-14.5 6.4-14.5 14.4v111.7h-111.6c-8 0-14.5-6.5-14.5-14.5 0-4.2 1.9-8.2 5-11 8.7-7.9 13.7-19.7 12-32.7-2.3-16.8-16-30.1-32.8-32-22.5-2.5-41.5 15.1-41.5 37.1 0 11 4.7 20.9 12.3 27.7 3.1 2.8 4.9 6.7 4.9 10.8v0.1c0 8-6.4 14.5-14.5 14.5h-111.6v-111.7c0-8-6.4-14.4-14.5-14.4-4.1 0-8 1.8-10.8 4.9-6.9 7.6-16.7 12.3-27.7 12.3-22 0-39.6-19-37.1-41.6 1.9-16.7 15.2-30.4 32-32.7 13-1.7 24.8 3.3 32.7 11.9 2.8 3.2 6.7 5.1 10.9 5.1 8.1 0 14.5-6.5 14.5-14.5v-111.6z\"/></symbol>\n    <symbol id=\"ef-erm-pz8\" viewBox=\"1513.7 166.86 322.3 503.06\"><path fill=\"currentColor\" d=\"M1528.7 564.5v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5 7.8 8.7 19.7 13.7 32.7 11.9 16.8-2.2 30.1-15.9 32-32.7 2.5-22.5-15.1-41.5-37.1-41.5-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.5-14.5-14.5v-111.6h111.6c8.1 0 14.5-6.5 14.5-14.5 0-4.1-1.8-8.1-4.9-10.9-7.6-6.8-12.3-16.6-12.3-27.6 0-22 19-39.6 41.5-37.1 16.8 1.8 30.5 15.2 32.8 32 1.7 12.9-3.3 24.8-12 32.7-3.1 2.8-5 6.7-5 10.9 0 8 6.5 14.5 14.5 14.5h111.6v111.6c0 8-6.4 14.5-14.5 14.5-4.2 0-8.1-1.9-10.9-5-7.9-8.7-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.5 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5v111.6h-111.6c-8 0-14.5 6.5-14.5 14.5 0 4.2 1.9 8.1 5 10.9 7.5 6.8 12.3 16.7 12.3 27.7 0 22-19 39.5-41.6 37.1-16.8-1.9-30.5-15.3-32.7-32-1.7-13 3.3-24.9 11.9-32.7 3.1-2.9 5-6.8 5-11 0-8-6.4-14.5-14.5-14.5z\"/></symbol>\n  </svg>\n  <div class=\"ef-erm__stage\">\n    <div class=\"ef-erm__cover\" aria-hidden=\"true\"></div>\n    <nav class=\"ef-erm__menu\" aria-label=\"Example menu\" inert>\n      <svg class=\"ef-erm__bgpz\" aria-hidden=\"true\"><use href=\"#ef-erm-pz4\"/></svg>\n      <ul class=\"ef-erm__list\">\n        <li><a class=\"ef-erm__link\" href=\"#\"><span class=\"ef-erm__n\">01</span><span class=\"ef-erm__t\">Work</span></a></li>\n        <li><a class=\"ef-erm__link\" href=\"#\"><span class=\"ef-erm__n\">02</span><span class=\"ef-erm__t\">Studio</span></a></li>\n        <li><a class=\"ef-erm__link\" href=\"#\"><span class=\"ef-erm__n\">03</span><span class=\"ef-erm__t\">Journal</span></a></li>\n        <li><a class=\"ef-erm__link\" href=\"#\"><span class=\"ef-erm__n\">04</span><span class=\"ef-erm__t\">Contact</span></a></li>\n      </ul>\n    </nav>\n    <button class=\"ef-erm__toggle\" type=\"button\" aria-expanded=\"false\" aria-label=\"Open menu\">\n      <svg viewBox=\"0 0 9 9\" aria-hidden=\"true\"><rect x=\"0\" y=\"0\" width=\"9\" height=\"1\"/><rect x=\"0\" y=\"4\" width=\"9\" height=\"1\"/><rect x=\"0\" y=\"8\" width=\"9\" height=\"1\"/></svg>\n      <span>Menu</span>\n    </button>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/EaseReverseClipMenu (MIT) — Copyright (c) 2009 - 2025 [Codrops](https://codrops.com) */\n.ef-erm { --ef-acc: #e6ff55; position: relative; width: 100%; height: 100%; min-height: 26rem; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; color: #fbf8f1; }\n.ef-erm__defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.ef-erm__stage { position: absolute; inset: 0; overflow: hidden; background: #0c1e18; }\n.ef-erm__cover { position: absolute; inset: 0; display: grid; gap: 0.5rem; padding: 0.5rem; box-sizing: border-box; }\n.ef-erm__tile { position: relative; border-radius: 10px; overflow: hidden; will-change: transform, opacity; color: var(--ef-acc); }\n.ef-erm__tile svg { position: absolute; left: 50%; top: 50%; width: 62%; height: 62%; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); }\n.ef-erm__tile span { position: absolute; left: 0.5rem; bottom: 0.35rem; font-size: 0.62rem; letter-spacing: 0.14em; font-weight: 700; color: #fbf8f1; opacity: 0.85; }\n.ef-erm__menu { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; padding: 0 8%; overflow: hidden; background: radial-gradient(ellipse at 20% 100%, #0a6b46, transparent 70%), linear-gradient(150deg, #005236, #0c1e18); clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%); visibility: hidden; will-change: clip-path; }\n.ef-erm__bgpz { position: absolute; right: -8%; bottom: -14%; width: 62%; height: 62%; color: var(--ef-acc); opacity: 0.12; transform: rotate(-12deg); pointer-events: none; }\n.ef-erm__list { position: relative; list-style: none; margin: 0; padding: 0; width: 100%; }\n.ef-erm__link { display: flex; align-items: baseline; gap: 0.9rem; padding: 0.15rem 0; color: #fbf8f1; text-decoration: none; font-size: clamp(2rem, 9vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; outline: none; transition: color 200ms, transform 300ms cubic-bezier(.2, .8, .2, 1); }\n.ef-erm__n { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ef-acc); }\n.ef-erm__link:hover, .ef-erm__link:focus-visible { color: var(--ef-acc); transform: translateX(0.6rem); }\n.ef-erm__link:focus-visible .ef-erm__t { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }\n.ef-erm__toggle { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 4; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.95rem 0.55rem 0.8rem; border: 0; border-radius: 999px; background: var(--ef-acc); color: #0c1e18; font: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; transition: transform 200ms; }\n.ef-erm__toggle:hover { transform: scale(1.05); }\n.ef-erm__toggle:focus-visible { outline: 2px solid #fbf8f1; outline-offset: 3px; }\n.ef-erm__toggle svg { width: 1rem; height: 1rem; fill: currentColor; overflow: visible; }\n.ef-erm__toggle rect { transform-box: fill-box; transform-origin: center; transition: transform 300ms cubic-bezier(.2, .8, .2, 1), opacity 200ms; }\n.ef-erm__toggle[aria-expanded=\"true\"] rect:nth-child(1) { transform: translateY(4px) rotate(45deg); }\n.ef-erm__toggle[aria-expanded=\"true\"] rect:nth-child(2) { opacity: 0; }\n.ef-erm__toggle[aria-expanded=\"true\"] rect:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }\n@media (prefers-reduced-motion: reduce) { .ef-erm__link, .ef-erm__toggle, .ef-erm__toggle rect { transition: none; } .ef-erm__link:hover, .ef-erm__link:focus-visible, .ef-erm__toggle:hover { transform: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/EaseReverseClipMenu (MIT) — Copyright (c) 2009 - 2025 [Codrops](https://codrops.com)\n// Ease-reverse clip menu: a grid of tiles flies radially outward (centre tiles leave last) while a menu opens as a clip-path from the middle.\n// The point is the way back. Played in reverse, each motion keeps its own \"out\" curve instead of replaying the opening curve backwards, so\n// closing starts fast and settles softly; a full close lets the tiles overshoot home with an elastic; closing mid-open runs at a faster speed.\n// Vanilla port: one master clock (0 to 1.1 s) read by per-item windows, so no timeline library is needed.\n// mount(root, { accent, easeReverse (\"on\" | \"off\"), exitSpeed (1-4), distance (px), tiles (6-16) })\nfunction mount(root, o) {\n  var mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  var stage = root.querySelector(\".ef-erm__stage\");\n  var cover = root.querySelector(\".ef-erm__cover\");\n  var menu = root.querySelector(\".ef-erm__menu\");\n  var toggle = root.querySelector(\".ef-erm__toggle\");\n  var links = [].slice.call(root.querySelectorAll(\".ef-erm__link\"));\n  var T = 1.1, MENU_DELAY = 0.3, MENU_DUR = 0.8, TILE_DUR = 0.7, TILE_MAX_DELAY = 0.3;\n  var opts = {}, tiles = [], t = 0, dir = 0, speed = 1, mode = \"fwd\", isOpen = false;\n  var raf = 0, last = 0, corrK = 0, menuC = 0, ro = null, offs = [], built = \"\";\n\n  function clamp(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }\n  function expoOut(u) { return u >= 1 ? 1 : u <= 0 ? 0 : 1 - Math.pow(2, -10 * u); }\n  function elasticOut(u) { return u >= 1 ? 1 : u <= 0 ? 0 : Math.pow(2, -10 * u) * Math.sin((u - 0.075) * (2 * Math.PI) / 0.3) + 1; }\n\n  // eased value (0 = closed, 1 = open) for a window at the current clock; kind is \"tile\" or \"menu\"\n  function val(start, dur, kind) {\n    var u = clamp((t - start) / dur);\n    if (mode === \"fwd\" || opts.easeReverse !== \"on\") return expoOut(u);\n    if (kind === \"tile\" && mode === \"full\") return 1 - elasticOut(1 - u);\n    return 1 - expoOut(1 - u);\n  }\n\n  function art(i, a) {\n    var d = \"#0c1e18\", c = \"#fbf8f1\", p = i % 5;\n    if (p === 0) return \"linear-gradient(155deg, #0a6b46, \" + d + \")\";\n    if (p === 1) return \"linear-gradient(200deg, #c6f26b -30%, #2f7d5b 45%, #005236)\";\n    if (p === 2) return \"radial-gradient(circle at 70% 30%, \" + a + \" 0 16%, transparent 17%), linear-gradient(160deg, #005236, \" + d + \")\";\n    if (p === 3) return \"repeating-linear-gradient(125deg, #005236 0 10px, #0a6b46 10px 20px)\";\n    return \"conic-gradient(from 200deg at 30% 70%, #005236, #2f7d5b, \" + c + \" 40%, #005236)\";\n  }\n\n  function build() {\n    var n = Math.max(6, Math.min(16, Math.round(opts.tiles)));\n    cover.textContent = \"\";\n    tiles = [];\n    var W = stage.clientWidth || 520, H = stage.clientHeight || 520;\n    var cols = Math.max(2, Math.min(n, Math.round(Math.sqrt(n * W / H))));\n    var rows = Math.ceil(n / cols);\n    cover.style.gridTemplateColumns = \"repeat(\" + cols + \", 1fr)\";\n    cover.style.gridTemplateRows = \"repeat(\" + rows + \", 1fr)\";\n    var pz = [\"#ef-erm-pz1\", \"#ef-erm-pz4\", \"#ef-erm-pz8\"];\n    for (var i = 0; i < n; i++) {\n      var el = document.createElement(\"div\");\n      el.className = \"ef-erm__tile\";\n      el.style.background = art(i, opts.accent);\n      var nm = document.createElement(\"span\"); nm.textContent = String(i + 1).padStart(2, \"0\");\n      var ns = \"http://www.w3.org/2000/svg\";\n      var sv = document.createElementNS(ns, \"svg\");\n      var us = document.createElementNS(ns, \"use\");\n      us.setAttribute(\"href\", pz[i % 3]);\n      sv.appendChild(us);\n      sv.style.setProperty(\"--r\", (((i * 29) % 40) - 20) + \"deg\");\n      if (i % 5 === 1) el.style.color = \"#0c1e18\";\n      if (i % 5 === 4) el.style.color = \"#0a6b46\";\n      el.appendChild(sv); el.appendChild(nm);\n      cover.appendChild(el);\n      tiles.push({ el: el, x: 0, y: 0, delay: 0, rot: (((i * 37) % 61) / 61) * 60 - 30, c: 0 });\n    }\n    layout();\n  }\n  function layout() {\n    var W = stage.clientWidth, H = stage.clientHeight;\n    var maxD = Math.hypot(W / 2, H / 2) || 1;\n    tiles.forEach(function (it) {\n      var dx = it.el.offsetLeft + it.el.offsetWidth / 2 - W / 2;\n      var dy = it.el.offsetTop + it.el.offsetHeight / 2 - H / 2;\n      if (dx === 0 && dy === 0) { dx = 1; dy = 1; }\n      var len = Math.hypot(dx, dy);\n      it.x = dx / len * opts.distance; it.y = dy / len * opts.distance;\n      it.delay = TILE_MAX_DELAY * (1 - clamp(len / maxD));\n    });\n    render();\n  }\n\n  function render() {\n    var reduce = mq.matches;\n    var vm;\n    if (reduce) {\n      vm = isOpen ? 1 : 0;\n      tiles.forEach(function (it) { it.el.style.transform = \"none\"; it.el.style.opacity = isOpen ? \"0\" : \"1\"; });\n    } else {\n      vm = val(MENU_DELAY, MENU_DUR, \"menu\") + menuC * corrK;\n      tiles.forEach(function (it) {\n        var v = val(it.delay, TILE_DUR, \"tile\") + it.c * corrK;\n        it.el.style.transform = \"translate3d(\" + (it.x * v).toFixed(1) + \"px,\" + (it.y * v).toFixed(1) + \"px,0) rotate(\" + (it.rot * v).toFixed(1) + \"deg)\";\n        it.el.style.opacity = String(clamp(1 - v).toFixed(3));\n      });\n    }\n    var a = 50 * (1 - vm), b = 50 + 50 * vm;\n    menu.style.visibility = vm > 0.002 ? \"visible\" : \"hidden\";\n    menu.style.clipPath = \"polygon(\" + a.toFixed(2) + \"% \" + a.toFixed(2) + \"%, \" + b.toFixed(2) + \"% \" + a.toFixed(2) + \"%, \" + b.toFixed(2) + \"% \" + b.toFixed(2) + \"%, \" + a.toFixed(2) + \"% \" + b.toFixed(2) + \"%)\";\n  }\n\n  function tick(now) {\n    raf = 0;\n    var dt = last ? Math.min(64, now - last) : 16;\n    last = now;\n    var busy = false;\n    if (dir !== 0) {\n      t += dir * speed * dt / 1000;\n      if (t >= T) { t = T; dir = 0; } else if (t <= 0) { t = 0; dir = 0; } else busy = true;\n    }\n    if (corrK > 0.002) { corrK *= Math.exp(-dt / 110); busy = true; } else corrK = 0;\n    render();\n    if (busy) raf = requestAnimationFrame(tick); else last = 0;\n  }\n  function kick() { if (!raf) raf = requestAnimationFrame(tick); }\n\n  // switch mode without a visual jump: remember the gap and let it fade out\n  function setMode(m) {\n    var before = tiles.map(function (it) { return val(it.delay, TILE_DUR, \"tile\") + it.c * corrK; });\n    var beforeM = val(MENU_DELAY, MENU_DUR, \"menu\") + menuC * corrK;\n    mode = m;\n    tiles.forEach(function (it, i) { it.c = before[i] - val(it.delay, TILE_DUR, \"tile\"); });\n    menuC = beforeM - val(MENU_DELAY, MENU_DUR, \"menu\");\n    corrK = 1;\n  }\n\n  function sync() {\n    toggle.setAttribute(\"aria-expanded\", String(isOpen));\n    toggle.setAttribute(\"aria-label\", isOpen ? \"Close menu\" : \"Open menu\");\n    if (isOpen) menu.removeAttribute(\"inert\"); else menu.setAttribute(\"inert\", \"\");\n  }\n  function flip() {\n    var reduce = mq.matches;\n    var wasFull = t >= T - 0.001;\n    isOpen = !isOpen;\n    sync();\n    if (reduce) { t = isOpen ? T : 0; dir = 0; mode = \"fwd\"; corrK = 0; render(); return; }\n    if (isOpen) { setMode(\"fwd\"); dir = 1; speed = 1; }\n    else { setMode(wasFull ? \"full\" : \"int\"); dir = -1; speed = wasFull ? 1 : opts.exitSpeed; }\n    kick();\n  }\n  function onKey(e) { if (e.key === \"Escape\" && isOpen) { e.preventDefault(); flip(); toggle.focus(); } }\n  function noop(e) { e.preventDefault(); }\n\n  function on(el, ev, fn) { el.addEventListener(ev, fn); offs.push(function () { el.removeEventListener(ev, fn); }); }\n  on(toggle, \"click\", flip);\n  on(root, \"keydown\", onKey);\n  links.forEach(function (l) { on(l, \"click\", noop); });\n  if (typeof ResizeObserver !== \"undefined\") { ro = new ResizeObserver(function () { layout(); }); ro.observe(stage); }\n\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ accent: \"#e6ff55\", easeReverse: \"on\", exitSpeed: 1.5, distance: 420, tiles: 12 }, opts, next || {});\n    opts.tiles = Math.max(6, Math.min(16, Math.round(opts.tiles)));\n    opts.distance = Math.max(100, +opts.distance);\n    opts.exitSpeed = Math.max(1, Math.min(4, +opts.exitSpeed));\n    root.style.setProperty(\"--ef-acc\", opts.accent);\n    var key = opts.tiles + \"|\" + opts.accent;\n    if (key !== built) { built = key; build(); }\n    else if (prev.distance !== opts.distance) layout();\n    else render();\n  }\n  update(o);\n  sync();\n  return {\n    update: update,\n    destroy: function () {\n      offs.forEach(function (f) { f(); }); offs = [];\n      if (ro) { ro.disconnect(); ro = null; }\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0; dir = 0;\n    }\n  };\n}"
  }
}