{
  "id": "menu-rows-to-grid",
  "kind": "element",
  "title": "Menu rows to grid layout",
  "summary": "A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.",
  "url": "https://enrichr.dev/elements/menu-rows-to-grid.html",
  "section": "nav",
  "techniques": [
    "reveal",
    "stagger"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "editorial",
    "kinetic"
  ],
  "intents": [
    "menu to grid animation",
    "hover row image preview menu",
    "flip images into grid layout",
    "expanding cover page transition",
    "list item opens image gallery"
  ],
  "status": "tested",
  "params": [
    {
      "key": "titles",
      "label": "Row titles (comma list)",
      "type": "text",
      "value": "Nobody's Love, Good Wings, Wild Honey, Slow Orbit, Paper Moon"
    },
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "cover",
      "label": "Cover colour",
      "type": "color",
      "value": "#005236"
    },
    {
      "key": "duration",
      "label": "Duration (s)",
      "type": "range",
      "min": 0.3,
      "max": 2.5,
      "step": 0.1,
      "value": 0.9
    },
    {
      "key": "rows",
      "label": "Rows",
      "type": "range",
      "min": 2,
      "max": 5,
      "step": 1,
      "value": 4
    }
  ],
  "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 \"Menu rows to grid layout\" element to this project.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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/menu-rows-to-grid.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 \"Menu rows to grid layout\" 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 \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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 \"Menu rows to grid layout\" element to this codebase.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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-menu-rows-to-grid.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Menu rows to grid layout 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 \"Menu rows to grid layout\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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- menu-rows-to-grid.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 \"./menu-rows-to-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function MenuRowsToGrid(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 \"Menu rows to grid layout\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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- menu-rows-to-grid.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/MenuRowsToGrid.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./menu-rows-to-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function MenuRowsToGrid(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 \"Menu rows to grid layout\" element.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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), menu-rows-to-grid.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 \"Menu rows to grid layout\" element. No packages, no server code.\n\nThis is the \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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 menu-rows-to-grid.js and then main.js), style.css (the CSS below), menu-rows-to-grid.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 \"Menu rows to grid layout\" 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 \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.json\n\nWhat it does: This is a vanilla port with no GSAP or Flip plugin; everything uses the Web Animations API. Hover reveals each row's four images with staggered CSS transitions and swaps the title with a short slide out and a rotated slide in. On click, a cover element clips open from the clicked row's rectangle to the whole box, the titles slide away, and the row's images are moved into a preview grid. Their first and last rectangles are measured, and each image animates from the inverse transform to none (a hand-written FLIP) while the remaining grid tiles pop in. Close reverses the sequence and puts the images back in their row.\nAccessibility: Rows are real buttons with labels, so the menu works from the keyboard and focus shows the same hover preview. Focus moves to Close when a row opens and back to the row afterwards, and Escape closes. Hidden rows are removed from the tab order while the grid is open. With reduced motion the image strip fades and everything else changes state with no travel.\n\nTunable settings:\n- Row titles (comma list): text, default Nobody's Love, Good Wings, Wild Honey, Slow Orbit, Paper Moon\n- Accent colour: color, default #e6ff55\n- Cover colour: color, default #005236\n- Duration (s): range 0.3 to 2.5, step 0.1, default 0.9\n- Rows: range 2 to 5, step 1, default 4\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/menu-rows-to-grid.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 \"Menu rows to grid layout\" 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 \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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 MenuRowsToGrid.\n2. Paste the JavaScript below into a separate code file named menu-rows-to-grid.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 \"./menu-rows-to-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function MenuRowsToGrid(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(MenuRowsToGrid, {\n  titles: { type: ControlType.String, title: \"Row titles (comma list)\", defaultValue: \"Nobody's Love, Good Wings, Wild Honey, Slow Orbit, Paper Moon\" },\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  cover: { type: ControlType.Color, title: \"Cover colour\", defaultValue: \"#005236\" },\n  duration: { type: ControlType.Number, title: \"Duration\", min: 0.3, max: 2.5, step: 0.1, defaultValue: 0.9 },\n  rows: { type: ControlType.Number, title: \"Rows\", min: 2, max: 5, step: 1, defaultValue: 4 },\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 \"Menu rows to grid layout\" 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 \"Menu rows to grid layout\" element from the Enrichr Library: A menu of big titles where hovering a row slides in an image strip and swaps the title style; clicking expands a cover and flies the row's images into a grid. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/menu-rows-to-grid.html\nMachine-readable spec: https://enrichr.dev/elements/menu-rows-to-grid.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-menu-rows-to-grid\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-menu-rows-to-grid\"), { ...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 real buttons with labels, so the menu works from the keyboard and focus shows the same hover preview. Focus moves to Close when a row opens and back to the row afterwards, and Escape closes. Hidden rows are removed from the tab order while the grid is open. With reduced motion the image strip fades and everything else changes state with no travel.",
  "performance": "The cover animates clip-path and the images animate transform and opacity. Nothing runs when idle. Animations are cancelled on close and on destroy, so no timers or listeners remain.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/ogZJMKq",
  "source": {
    "markup": "<div class=\"ef-mtg\">\n  <svg class=\"ef-mtg__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\"><defs>\n<symbol id=\"efmtg-p1\" viewBox=\"1513.7 1453.9 322.3 322.3\">\n    <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\"/>\n  </symbol>\n<symbol id=\"efmtg-p4\" viewBox=\"1423.36 860.8 503.07 322.3\">\n    <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\"/>\n  </symbol>\n<symbol id=\"efmtg-p8\" viewBox=\"1513.7 166.86 322.3 503.06\">\n    <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\"/>\n  </symbol>\n  </defs></svg>\n  <div class=\"ef-mtg__stage\"></div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/MenuToGrid (MIT) — Copyright (c) 2009 - 2021 Codrops */\n.ef-mtg { width: 100%; }\n.ef-mtg__defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.ef-mtg__stage { --acc: #e6ff55; --cov: #005236; position: relative; box-sizing: border-box; width: 100%; height: 24rem; overflow: hidden; border-radius: 1rem; background: #0c1e18; color: #fbf8f1; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n.ef-mtg__rows { position: absolute; inset: 0; display: flex; flex-direction: column; }\n.ef-mtg__row { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; box-sizing: border-box; width: 100%; padding: 0 1.2rem; margin: 0; background: none; border: 0; border-top: 1px solid rgba(251, 248, 241, 0.18); color: inherit; font: inherit; text-align: left; cursor: pointer; }\n.ef-mtg__row:last-child { border-bottom: 1px solid rgba(251, 248, 241, 0.18); }\n.ef-mtg__row:focus-visible { outline: 2px solid var(--acc); outline-offset: -4px; }\n.ef-mtg__t { display: block; overflow: hidden; padding: 0.15em 0; }\n.ef-mtg__t > span { display: block; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-transform: uppercase; transform-origin: 0 50%; will-change: transform; }\n.ef-mtg__t.is-switch > span { color: var(--acc); font-style: italic; letter-spacing: -0.045em; }\n.ef-mtg__imgs { display: flex; gap: 0.45rem; height: 62%; max-height: 4.2rem; flex: 0 0 auto; }\n.ef-mtg__img { position: relative; overflow: hidden; border-radius: 0.4rem; flex: 0 0 auto; transform-origin: 0 0; }\n.ef-mtg__imgs .ef-mtg__img { width: 3.1rem; height: 100%; opacity: 0; transform: translateX(20%) scale(0.8); transition: opacity 400ms cubic-bezier(.2,.8,.2,1), transform 400ms cubic-bezier(.2,.8,.2,1); }\n.ef-mtg__imgs .ef-mtg__img:nth-child(1) { transition-delay: 105ms; }\n.ef-mtg__imgs .ef-mtg__img:nth-child(2) { transition-delay: 70ms; }\n.ef-mtg__imgs .ef-mtg__img:nth-child(3) { transition-delay: 35ms; }\n.ef-mtg__row.is-hover .ef-mtg__imgs .ef-mtg__img { opacity: 1; transform: none; }\n.ef-mtg__row.is-snap .ef-mtg__imgs .ef-mtg__img { transition: none; transition-delay: 0s; opacity: 1; transform: none; }\n.ef-mtg__piece { position: absolute; left: 50%; top: 50%; width: 64%; height: 64%; transform: translate(-50%, -50%); display: block; opacity: 0.92; }\n.ef-mtg__cover { position: absolute; inset: 0; z-index: 2; background: var(--cov); opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }\n.ef-mtg__prev { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; box-sizing: border-box; padding: 1rem 1.2rem 1.2rem; }\n.ef-mtg__prev.is-current { display: flex; }\n.ef-mtg__pt { margin: 0; overflow: hidden; padding: 0.1em 0; flex: 0 0 auto; }\n.ef-mtg__pt > span { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; text-transform: uppercase; color: var(--acc); font-style: italic; transform-origin: 100% 50%; will-change: transform; }\n.ef-mtg__grid { flex: 1 1 0; min-height: 0; margin-top: 0.8rem; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 0.55rem; }\n.ef-mtg__grid .ef-mtg__img { width: 100%; height: 100%; border-radius: 0.5rem; }\n.ef-mtg__close { position: absolute; z-index: 4; top: 1.05rem; right: 1.2rem; display: none; padding: 0.45rem 0.8rem; border-radius: 99px; border: 1.5px solid rgba(251, 248, 241, 0.7); background: none; color: #fbf8f1; font: inherit; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; opacity: 0; transition: background 250ms, color 250ms; }\n.ef-mtg__close.is-show { display: block; }\n.ef-mtg__close:hover { background: var(--acc); color: #0c1e18; border-color: var(--acc); }\n.ef-mtg__close:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }\n@media (prefers-reduced-motion: reduce) { .ef-mtg__imgs .ef-mtg__img { transition: opacity 200ms; transform: none; } .ef-mtg__close { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/MenuToGrid (MIT) — Copyright (c) 2009 - 2021 Codrops\n// Menu rows to grid: hovering a row slides a strip of images in and swaps its title; clicking expands a cover over the whole box and the row's\n// images fly (hand-rolled FLIP, measured first and last rectangles) into a grid where more tiles pop in. Close reverses it.\n// Vanilla port, no GSAP or Flip plugin: everything uses the Web Animations API. Rows are real buttons, Escape closes, reduced motion skips the movement.\n// mount(root, { titles (comma list), accent, cover, duration (s), rows (2-5) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var stage = root.querySelector(\".ef-mtg__stage\");\n  var opts = {}, rows = [], anims = [], offs = [], timers = [];\n  var cur = -1, busy = false, isOpen = false;\n  var EASE = \"cubic-bezier(0.83, 0, 0.17, 1)\", EXPO = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n  var GRADS = [\n    \"linear-gradient(160deg, #0a6b46, #0c1e18)\", \"linear-gradient(200deg, #c6f26b, #2f7d5b)\", \"radial-gradient(circle at 30% 30%, #e6ff55, #005236 70%)\", \"linear-gradient(135deg, #0c1e18, #2f7d5b)\",\n    \"linear-gradient(180deg, #fbf8f1, #c6f26b)\", \"conic-gradient(from 200deg at 40% 60%, #005236, #c6f26b, #0a6b46)\", \"linear-gradient(150deg, #2f7d5b, #005236)\", \"radial-gradient(circle at 70% 70%, #c6f26b, #0c1e18 75%)\"\n  ];\n  var PIECES = [\"p1\", \"p4\", \"p8\"];\n  var cover, closeBtn, rowsWrap;\n\n  function el(tag, cls, txt) { var e = document.createElement(tag); if (cls) e.className = cls; if (txt != null) e.textContent = txt; return e; }\n  function ms(f) { return reduce ? 1 : Math.max(1, opts.duration * 1000 * f); }\n  function play(node, kf, o2) {\n    var a = node.animate(kf, Object.assign({ fill: \"both\" }, o2));\n    anims.push(a);\n    return a;\n  }\n  function flush() { anims.forEach(function (a) { try { a.cancel(); } catch (e) {} }); anims = []; }\n  function later(fn, t) { var id = setTimeout(fn, t); timers.push(id); return id; }\n  function clearTimers() { timers.forEach(clearTimeout); timers = []; }\n  function art(i, withPiece) {\n    var d = el(\"div\", \"ef-mtg__img\");\n    d.style.background = GRADS[i % GRADS.length];\n    if (withPiece) {\n      var s = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n      s.setAttribute(\"class\", \"ef-mtg__piece\"); s.setAttribute(\"aria-hidden\", \"true\"); s.setAttribute(\"focusable\", \"false\");\n      var u = document.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\n      u.setAttribute(\"href\", \"#efmtg-\" + PIECES[i % 3]);\n      s.appendChild(u);\n      s.style.color = i % 3 === 0 ? opts.accent : i % 3 === 1 ? \"#fbf8f1\" : \"#c6f26b\";\n      d.appendChild(s);\n    }\n    return d;\n  }\n  function on(t, ev, fn) { t.addEventListener(ev, fn); offs.push(function () { t.removeEventListener(ev, fn); }); }\n\n  function teardown() {\n    flush(); clearTimers();\n    offs.forEach(function (f) { f(); }); offs = [];\n    stage.textContent = \"\"; rows = []; cur = -1; busy = false; isOpen = false;\n  }\n\n  function build() {\n    teardown();\n    stage.style.setProperty(\"--acc\", opts.accent);\n    stage.style.setProperty(\"--cov\", opts.cover);\n    var names = String(opts.titles || \"\").split(\",\").map(function (s) { return s.trim(); }).filter(Boolean);\n    if (!names.length) names = [\"Untitled\"];\n    rowsWrap = el(\"div\", \"ef-mtg__rows\");\n    cover = el(\"div\", \"ef-mtg__cover\");\n    closeBtn = el(\"button\", \"ef-mtg__close\", \"Close\");\n    closeBtn.type = \"button\"; closeBtn.setAttribute(\"aria-label\", \"Close and return to the menu\");\n    stage.appendChild(rowsWrap); stage.appendChild(cover);\n    for (var r = 0; r < opts.rows; r++) (function (r) {\n      var btn = el(\"button\", \"ef-mtg__row\"); btn.type = \"button\";\n      var tw = el(\"span\", \"ef-mtg__t\"), t = el(\"span\", \"\", names[r % names.length]); tw.appendChild(t);\n      var imgs = el(\"span\", \"ef-mtg__imgs\"); imgs.setAttribute(\"aria-hidden\", \"true\");\n      var list = [];\n      for (var k = 0; k < 4; k++) { var im = art(r * 4 + k, k % 2 === 0); imgs.appendChild(im); list.push(im); }\n      btn.appendChild(tw); btn.appendChild(imgs);\n      btn.setAttribute(\"aria-label\", \"Open \" + names[r % names.length]);\n      rowsWrap.appendChild(btn);\n      var prev = el(\"div\", \"ef-mtg__prev\"); prev.setAttribute(\"role\", \"region\"); prev.setAttribute(\"aria-label\", names[r % names.length]);\n      var pt = el(\"h3\", \"ef-mtg__pt\"), pts = el(\"span\", \"\", names[r % names.length]); pt.appendChild(pts);\n      var grid = el(\"div\", \"ef-mtg__grid\"), extras = [];\n      for (var j = 0; j < 4; j++) { var ex = art(r * 4 + 4 + j, j % 2 === 1); ex.style.opacity = \"1\"; grid.appendChild(ex); extras.push(ex); }\n      prev.appendChild(pt); prev.appendChild(grid);\n      stage.appendChild(prev);\n      var row = { btn: btn, tw: tw, t: t, imgs: imgs, list: list, prev: prev, pt: pts, grid: grid, extras: extras };\n      rows.push(row);\n      function enter() { if (isOpen || busy) return; hover(row, true); }\n      function leave() { if (isOpen || busy) return; hover(row, false); }\n      on(btn, \"pointerenter\", enter); on(btn, \"pointerleave\", leave);\n      on(btn, \"focus\", enter); on(btn, \"blur\", leave);\n      on(btn, \"click\", function () { open(r); });\n    })(r);\n    stage.appendChild(closeBtn);\n    on(closeBtn, \"click\", close);\n    on(stage, \"keydown\", function (e) { if (e.key === \"Escape\" && isOpen) close(); });\n  }\n\n  function hover(row, state) {\n    if (row.hov === state) return;\n    row.hov = state;\n    row.btn.classList.toggle(\"is-hover\", state);\n    if (reduce) { row.tw.classList.toggle(\"is-switch\", state); return; }\n    var a = play(row.t, [{ transform: \"translateY(0)\" }, { transform: \"translateY(-100%)\" }], { duration: 100, easing: \"ease-in\" });\n    a.onfinish = function () {\n      row.tw.classList.toggle(\"is-switch\", state);\n      play(row.t, [{ transform: \"translateY(100%) rotate(15deg)\" }, { transform: \"translateY(0) rotate(0)\" }], { duration: 500, easing: EXPO });\n    };\n  }\n\n  function open(i) {\n    if (busy || isOpen) return;\n    busy = true; isOpen = true; cur = i;\n    var row = rows[i], H = stage.clientHeight;\n    var top = row.btn.offsetTop, h = row.btn.offsetHeight;\n    row.hov = true; row.btn.classList.add(\"is-hover\", \"is-snap\");\n    row.tw.classList.add(\"is-switch\");\n    var D = ms(1);\n    rows.forEach(function (rw) { rw.btn.tabIndex = -1; rw.btn.setAttribute(\"aria-hidden\", \"true\"); });\n    // cover grows from the row to the full box\n    cover.style.opacity = \"1\";\n    play(cover, [{ clipPath: \"inset(\" + top + \"px 0 \" + (H - top - h) + \"px 0)\" }, { clipPath: \"inset(0 0 0 0)\" }], { duration: D, easing: EASE });\n    // every title slides out, away from the clicked row\n    rows.forEach(function (rw, n) {\n      play(rw.t, [{ transform: \"translateY(0)\" }, { transform: \"translateY(\" + (n > i ? 110 : -110) + \"%)\" }], { duration: ms(0.55), easing: EASE });\n    });\n    // FLIP the row's images into the preview grid\n    var first = row.list.map(function (im) { return im.getBoundingClientRect(); });\n    row.prev.classList.add(\"is-current\");\n    for (var k = row.list.length - 1; k >= 0; k--) row.grid.insertBefore(row.list[k], row.grid.firstChild);\n    row.list.forEach(function (im, k2) {\n      var l = im.getBoundingClientRect(), f = first[k2];\n      play(im, [\n        { transformOrigin: \"0 0\", transform: \"translate(\" + (f.left - l.left) + \"px,\" + (f.top - l.top) + \"px) scale(\" + (f.width / l.width) + \",\" + (f.height / l.height) + \")\" },\n        { transformOrigin: \"0 0\", transform: \"none\" }\n      ], { duration: D, easing: EASE, delay: reduce ? 0 : k2 * 40 });\n    });\n    row.extras.forEach(function (ex, j) {\n      play(ex, [{ opacity: 0, transform: \"scale(0) translateY(\" + Math.round(Math.random() * 120) + \"%)\" }, { opacity: 1, transform: \"none\" }], { duration: D, easing: EASE, delay: reduce ? 0 : (4 + j) * 40 });\n    });\n    // preview title and close button\n    play(row.pt, [{ transform: \"translateY(-100%) rotate(15deg)\" }, { transform: \"translateY(0) rotate(0)\" }], { duration: D, easing: EASE });\n    closeBtn.classList.add(\"is-show\");\n    play(closeBtn, [{ opacity: 0 }, { opacity: 1 }], { duration: D, easing: EASE });\n    later(function () { busy = false; closeBtn.focus({ preventScroll: true }); }, D + 200);\n  }\n\n  function close() {\n    if (busy || !isOpen) return;\n    busy = true;\n    var row = rows[cur], H = stage.clientHeight;\n    var top = row.btn.offsetTop, h = row.btn.offsetHeight, D = ms(0.55);\n    var all = row.list.concat(row.extras);\n    all.forEach(function (im, n) {\n      play(im, [{ opacity: 1, transform: \"none\" }, { opacity: 0, transform: \"scale(0)\" }], { duration: D, easing: EASE, delay: reduce ? 0 : n * 40 });\n    });\n    play(row.pt, [{ transform: \"translateY(0)\" }, { transform: \"translateY(100%)\" }], { duration: ms(0.65), easing: EASE });\n    play(closeBtn, [{ opacity: 1 }, { opacity: 0 }], { duration: D, easing: EASE });\n    var cd = reduce ? 0 : D * 0.8;\n    play(cover, [{ clipPath: \"inset(0 0 0 0)\", opacity: 1 }, { clipPath: \"inset(\" + (top + h / 2) + \"px 0 \" + (H - top - h / 2) + \"px 0)\", opacity: 1 }], { duration: ms(0.55), easing: EXPO, delay: cd });\n    later(function () {\n      // titles slide back, staggered outward from the closed row\n      rows.forEach(function (rw, n) {\n        var from = n > cur ? 110 : -110;\n        play(rw.t, [{ transform: \"translateY(\" + from + \"%)\" }, { transform: \"translateY(0)\" }], { duration: ms(0.5), easing: EASE, delay: reduce ? 0 : Math.abs(n - cur) * 30 });\n      });\n    }, cd + ms(0.3));\n    later(function () {\n      row.list.forEach(function (im) { row.imgs.appendChild(im); });\n      flush();\n      cover.style.opacity = \"0\";\n      row.prev.classList.remove(\"is-current\");\n      closeBtn.classList.remove(\"is-show\");\n      row.btn.classList.remove(\"is-hover\", \"is-snap\");\n      row.tw.classList.remove(\"is-switch\");\n      row.hov = false;\n      rows.forEach(function (rw) { rw.btn.tabIndex = 0; rw.btn.removeAttribute(\"aria-hidden\"); });\n      isOpen = false; busy = false;\n      row.btn.focus({ preventScroll: true });\n    }, cd + ms(0.55) + ms(0.3) + 60);\n  }\n\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ titles: \"Nobody's Love, Good Wings, Wild Honey, Slow Orbit, Paper Moon\", accent: \"#e6ff55\", cover: \"#005236\", duration: 0.9, rows: 4 }, opts, next || {});\n    opts.rows = Math.max(2, Math.min(5, Math.round(+opts.rows || 4)));\n    opts.duration = Math.max(0.2, Math.min(3, +opts.duration || 0.9));\n    if (prev.titles !== opts.titles || prev.accent !== opts.accent || prev.cover !== opts.cover || prev.rows !== opts.rows) build();\n  }\n  update(o);\n  return { update: update, destroy: teardown };\n}"
  }
}