{
  "id": "image-to-grid-reveal",
  "kind": "element",
  "title": "Image to grid reveal",
  "summary": "A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.",
  "url": "https://enrichr.dev/elements/image-to-grid-reveal.html",
  "section": "gallery",
  "techniques": [
    "reveal",
    "stagger"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "editorial",
    "polished",
    "confident"
  ],
  "intents": [
    "image to grid transition",
    "hero image shrinks into grid",
    "flip image into gallery layout",
    "enter button opens portfolio grid",
    "tiles fly in from centre"
  ],
  "status": "tested",
  "params": [
    {
      "key": "title",
      "label": "Title",
      "type": "text",
      "value": "Siobhan O'dwaya"
    },
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "duration",
      "label": "Duration (s)",
      "type": "range",
      "min": 0.4,
      "max": 3,
      "step": 0.1,
      "value": 1.4
    },
    {
      "key": "spread",
      "label": "Fly-in distance (px)",
      "type": "range",
      "min": 0,
      "max": 300,
      "step": 10,
      "value": 120
    },
    {
      "key": "art",
      "label": "Tile art",
      "type": "select",
      "options": [
        [
          "puzzle",
          "Puzzle pieces"
        ],
        [
          "gradient",
          "Gradient only"
        ]
      ],
      "value": "puzzle"
    }
  ],
  "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 \"Image to grid reveal\" element to this project.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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/image-to-grid-reveal.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 \"Image to grid reveal\" 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 \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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 \"Image to grid reveal\" element to this codebase.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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-image-to-grid-reveal.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Image to grid reveal 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 \"Image to grid reveal\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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- image-to-grid-reveal.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 \"./image-to-grid-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ImageToGridReveal(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 \"Image to grid reveal\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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- image-to-grid-reveal.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/ImageToGridReveal.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./image-to-grid-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ImageToGridReveal(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 \"Image to grid reveal\" element.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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), image-to-grid-reveal.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 \"Image to grid reveal\" element. No packages, no server code.\n\nThis is the \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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 image-to-grid-reveal.js and then main.js), style.css (the CSS below), image-to-grid-reveal.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 \"Image to grid reveal\" 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 \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.json\n\nWhat it does: This is a vanilla port with no GSAP or Flip plugin. One progress value from 0 (closed) to 1 (open) is tweened with requestAnimationFrame, and every layer is a pure function of it. The hero image is moved by interpolating between its first rectangle (centre of the box) and its last rectangle (its slot in the grid), which is a hand-written FLIP. Each tile gets a delay based on its distance from the centre and flies in along the vector pointing away from it; labels slide up out of an overflow clip; the background and text colours are mixed from the same progress value. Because everything reads one number, reversing mid-flight just works.\nAccessibility: Enter and Back are real buttons with labels, focus moves to Back when the grid opens and returns to Enter when it closes, and Escape closes the grid. The decorative tiles are hidden from assistive tech. With reduced motion the hero and grid swap instantly with no movement.\n\nTunable settings:\n- Title: text, default Siobhan O'dwaya\n- Accent colour: color, default #e6ff55\n- Duration (s): range 0.4 to 3, step 0.1, default 1.4\n- Fly-in distance (px): range 0 to 300, step 10, default 120\n- Tile art: select (Puzzle pieces / Gradient only), default puzzle\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/image-to-grid-reveal.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 \"Image to grid reveal\" 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 \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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 ImageToGridReveal.\n2. Paste the JavaScript below into a separate code file named image-to-grid-reveal.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 \"./image-to-grid-reveal\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ImageToGridReveal(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(ImageToGridReveal, {\n  title: { type: ControlType.String, title: \"Title\", defaultValue: \"Siobhan O'dwaya\" },\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  duration: { type: ControlType.Number, title: \"Duration\", min: 0.4, max: 3, step: 0.1, defaultValue: 1.4 },\n  spread: { type: ControlType.Number, title: \"Fly-in distance\", min: 0, max: 300, step: 10, defaultValue: 120 },\n  art: { type: ControlType.Enum, title: \"Tile art\", options: [\"puzzle\",\"gradient\"], optionTitles: [\"Puzzle pieces\",\"Gradient only\"], defaultValue: \"puzzle\" },\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 \"Image to grid reveal\" 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 \"Image to grid reveal\" element from the Enrichr Library: A large hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards, with sliding labels and a colour shift. Puzzle-piece art, no images.\nPage: https://enrichr.dev/elements/image-to-grid-reveal.html\nMachine-readable spec: https://enrichr.dev/elements/image-to-grid-reveal.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-image-to-grid-reveal\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-image-to-grid-reveal\"), { ...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": "Enter and Back are real buttons with labels, focus moves to Back when the grid opens and returns to Enter when it closes, and Escape closes the grid. The decorative tiles are hidden from assistive tech. With reduced motion the hero and grid swap instantly with no movement.",
  "performance": "Tiles animate transform and opacity only. The hero changes left, top, width and height each frame, which is fine for one element but would be worth switching to a transform-based FLIP if the hero held heavy content. The loop stops as soon as the value settles.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/rayorXj",
  "source": {
    "markup": "<div class=\"ef-itg\">\n  <svg class=\"ef-itg__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\"><defs>\n<symbol id=\"efitg-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=\"efitg-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=\"efitg-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-itg__stage\"></div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/ImageToGridTransition (MIT) — Copyright (c) 2009 - 2021 Codrops */\n.ef-itg { width: 100%; }\n.ef-itg__defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.ef-itg__stage { --bg: #005236; --fg: #fbf8f1; --acc: #e6ff55; position: relative; box-sizing: border-box; width: 100%; height: 24rem; overflow: hidden; border-radius: 1rem; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n.ef-itg__tile { position: absolute; display: block; will-change: transform, opacity; }\n.ef-itg__img, .ef-itg__hero { position: relative; overflow: hidden; border-radius: 0.5rem; }\n.ef-itg__tile .ef-itg__img { width: 100%; height: 100%; }\n.ef-itg__hero { position: absolute; z-index: 2; border-radius: 0.7rem; will-change: left, top, width, height; }\n.ef-itg__piece { position: absolute; left: 50%; top: 50%; width: 62%; height: 62%; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); opacity: 0.9; display: block; }\n.ef-itg__hero .ef-itg__piece { width: 56%; height: 56%; color: var(--acc); opacity: 0.95; }\n.ef-itg__img::after, .ef-itg__hero::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 30, 24, 0) 55%, rgba(12, 30, 24, 0.35)); pointer-events: none; }\n.ef-itg__lbl { position: absolute; left: 0; right: 0; top: 100%; margin-top: 0.3rem; overflow: hidden; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.25; }\n.ef-itg__lbl > span { display: block; will-change: transform; }\n.ef-itg__big { position: absolute; z-index: 3; left: 32%; top: 12%; margin: 0; color: #fbf8f1; font-size: 2rem; font-weight: 800; line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase; pointer-events: none; }\n.ef-itg__big > span { display: block; will-change: transform, opacity; }\n.ef-itg__small { position: absolute; z-index: 1; margin: 0; font-size: 0.8rem; font-weight: 800; line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; pointer-events: none; }\n.ef-itg__small > span { display: block; margin-bottom: 0.15rem; will-change: transform, opacity; }\n.ef-itg__btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }\n.ef-itg__enter { position: absolute; z-index: 4; left: 50%; bottom: 11%; margin-left: -2.2rem; width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-items: center; color: #fbf8f1; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: inset 0 0 0 1.5px rgba(251, 248, 241, 0.75); transition: background 250ms, color 250ms; }\n.ef-itg__enter:hover { background: var(--acc); color: #0c1e18; box-shadow: inset 0 0 0 1.5px var(--acc); }\n.ef-itg__back { position: absolute; z-index: 4; width: 3rem; height: 1.6rem; display: grid; place-items: center; border-radius: 0.4rem; }\n.ef-itg__back svg { width: 100%; height: 0.7rem; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; }\n.ef-itg__btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }\n.ef-itg__back:focus-visible { outline-color: #0a6b46; }\n.ef-itg__stage[data-open=\"0\"] .ef-itg__back, .ef-itg__stage[data-open=\"0\"] .ef-itg__tile { pointer-events: none; }\n@media (prefers-reduced-motion: reduce) { .ef-itg__enter { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/ImageToGridTransition (MIT) — Copyright (c) 2009 - 2021 Codrops\n// Image to grid reveal: one big hero image shrinks and glides into its slot in a scattered grid while the other tiles fly in from the centre outwards.\n// Vanilla port, no GSAP: one eased progress value (0 closed, 1 open) is tweened with requestAnimationFrame, and every layer is a pure function of it.\n// The hero image is moved by interpolating its first and last rectangles (a hand-rolled FLIP). Reduced motion swaps instantly.\n// mount(root, { title, accent, duration (s), spread (px), art (\"puzzle\"|\"gradient\") })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var stage = root.querySelector(\".ef-itg__stage\");\n  var opts = {}, raf = 0, prog = 0, target = 0, last = 0, built = false;\n  var TILES = [\n    [5, 8, 20, 28, \"Carrutha Method\"], [5, 46, 15, 40, \"Maria Coluga\"], [24, 56, 19, 34, \"Gabeta Quest\"], [30, 6, 14, 40, \"Lithera Britta\"],\n    [71, 8, 24, 26, \"Manata Poly\"], [71, 40, 12, 30, \"Ghata Manabra\"], [86, 40, 10, 34, \"Hollis Vane\"], [47, 72, 22, 20, \"Tessa Orrin\"]\n  ];\n  var HERO = [30, 8, 40, 84], SLOT = [49, 24, 17, 40];\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\", \"p1\", \"p8\", \"p4\", \"p1\", \"p4\"];\n  var els = { tiles: [], lbls: [] };\n\n  function clamp(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }\n  function expo(p) { return p <= 0 ? 0 : p >= 1 ? 1 : p < 0.5 ? Math.pow(2, 20 * p - 10) / 2 : (2 - Math.pow(2, -20 * p + 10)) / 2; }\n  function expoOut(p) { return p >= 1 ? 1 : 1 - Math.pow(2, -10 * p); }\n  function lerp(a, b, t) { return a + (b - a) * t; }\n  function hex(c) { return [parseInt(c.substr(1, 2), 16), parseInt(c.substr(3, 2), 16), parseInt(c.substr(5, 2), 16)]; }\n  function mix(a, b, t) { var x = hex(a), y = hex(b); return \"rgb(\" + Math.round(lerp(x[0], y[0], t)) + \",\" + Math.round(lerp(x[1], y[1], t)) + \",\" + Math.round(lerp(x[2], y[2], t)) + \")\"; }\n  function svgPiece(id, cls) {\n    var s = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n    s.setAttribute(\"class\", cls); 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\", \"#efitg-\" + id);\n    s.appendChild(u);\n    return s;\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\n  function build() {\n    stage.textContent = \"\";\n    els = { tiles: [], lbls: [] };\n    var cx = 50, cy = 50;\n    // grid tiles (decorative)\n    TILES.forEach(function (t, i) {\n      var tile = el(\"div\", \"ef-itg__tile\");\n      tile.setAttribute(\"aria-hidden\", \"true\");\n      tile.style.cssText = \"left:\" + t[0] + \"%;top:\" + t[1] + \"%;width:\" + t[2] + \"%;height:\" + t[3] + \"%\";\n      var img = el(\"div\", \"ef-itg__img\");\n      img.style.background = GRADS[i % GRADS.length];\n      if (opts.art === \"puzzle\") {\n        var pc = svgPiece(PIECES[i], \"ef-itg__piece\");\n        pc.style.color = i % 3 === 0 ? opts.accent : i % 3 === 1 ? \"#fbf8f1\" : \"#c6f26b\";\n        pc.style.setProperty(\"--rot\", (i * 37 % 40 - 20) + \"deg\");\n        img.appendChild(pc);\n      }\n      var lbl = el(\"div\", \"ef-itg__lbl\"); lbl.appendChild(el(\"span\", \"\", t[4]));\n      tile.appendChild(img); tile.appendChild(lbl);\n      var mx = t[0] + t[2] / 2 - cx, my = t[1] + t[3] / 2 - cy, d = Math.hypot(mx, my) || 1;\n      tile._v = { ux: mx / d, uy: my / d, delay: clamp(d / 70) * 0.3 };\n      stage.appendChild(tile);\n      els.tiles.push(tile); els.lbls.push(lbl.firstChild);\n    });\n    // slot label\n    var slot = el(\"div\", \"ef-itg__tile\"); slot.setAttribute(\"aria-hidden\", \"true\");\n    slot.style.cssText = \"left:\" + SLOT[0] + \"%;top:\" + SLOT[1] + \"%;width:\" + SLOT[2] + \"%;height:\" + SLOT[3] + \"%\";\n    var sl = el(\"div\", \"ef-itg__lbl\"); sl.appendChild(el(\"span\", \"\", \"Featured\"));\n    slot.appendChild(sl); stage.appendChild(slot); els.slot = sl.firstChild;\n    // hero\n    var hero = el(\"div\", \"ef-itg__hero\");\n    hero.style.background = \"radial-gradient(circle at 70% 28%, rgba(230,255,85,0.5), transparent 45%), linear-gradient(165deg, #2f7d5b, #0c1e18)\";\n    hero.appendChild(svgPiece(\"p8\", \"ef-itg__piece\"));\n    stage.appendChild(hero); els.hero = hero;\n    // titles\n    var words = String(opts.title || \"\").trim().split(/\\s+/);\n    var a = words.shift() || \"\", b = words.join(\" \");\n    var big = el(\"h3\", \"ef-itg__big\"); big.appendChild(el(\"span\", \"\", a)); big.appendChild(el(\"span\", \"\", b));\n    var sm = el(\"h3\", \"ef-itg__small\"); sm.style.cssText = \"left:\" + (SLOT[0]) + \"%;top:5%\"; sm.appendChild(el(\"span\", \"\", a)); sm.appendChild(el(\"span\", \"\", b));\n    stage.appendChild(big); stage.appendChild(sm);\n    els.big = big.children; els.sm = sm.children;\n    // controls\n    var enter = el(\"button\", \"ef-itg__btn ef-itg__enter\", \"Enter\");\n    enter.type = \"button\"; enter.setAttribute(\"aria-label\", \"Enter: reveal the grid\");\n    var back = el(\"button\", \"ef-itg__btn ef-itg__back\");\n    back.type = \"button\"; back.setAttribute(\"aria-label\", \"Back to the large image\");\n    back.style.cssText = \"left:\" + (SLOT[0] + SLOT[2] + 4) + \"%;top:\" + (SLOT[1] + SLOT[3] + 18) + \"%\";\n    back.innerHTML = '<svg viewBox=\"0 0 50 9\" aria-hidden=\"true\"><path d=\"m0 4.5 5-3m-5 3 5 3m45-3h-50\"/></svg>';\n    stage.appendChild(enter); stage.appendChild(back);\n    els.enter = enter; els.back = back;\n    built = true;\n    render(prog);\n  }\n\n  function rect(r) { var w = stage.clientWidth, h = stage.clientHeight; return [r[0] / 100 * w, r[1] / 100 * h, r[2] / 100 * w, r[3] / 100 * h]; }\n\n  function render(p) {\n    if (!built) return;\n    var e = expo(p), a = rect(HERO), b = rect(SLOT), hs = els.hero.style;\n    hs.left = lerp(a[0], b[0], e) + \"px\"; hs.top = lerp(a[1], b[1], e) + \"px\";\n    hs.width = lerp(a[2], b[2], e) + \"px\"; hs.height = lerp(a[3], b[3], e) + \"px\";\n    stage.style.setProperty(\"--bg\", mix(\"#005236\", \"#fbf8f1\", e));\n    stage.style.setProperty(\"--fg\", mix(\"#fbf8f1\", \"#0c1e18\", e));\n    stage.style.setProperty(\"--acc\", opts.accent);\n    stage.dataset.open = p > 0.5 ? \"1\" : \"0\";\n    els.tiles.forEach(function (tile, i) {\n      var v = tile._v, lp = clamp((p - 0.1 - v.delay) / 0.55), mv = 1 - expoOut(lp);\n      tile.style.opacity = lp > 0 ? clamp(lp * 5) : 0;\n      tile.style.transform = \"translate(\" + (v.ux * opts.spread * mv).toFixed(1) + \"px,\" + (v.uy * opts.spread * mv).toFixed(1) + \"px)\";\n      var tl = expo(clamp((p - v.delay * 0.5) / 0.7));\n      els.lbls[i].style.transform = \"translateY(\" + ((1 - tl) * 110).toFixed(1) + \"%)\";\n    });\n    els.slot.style.transform = \"translateY(\" + ((1 - expo(clamp(p / 0.8))) * 110).toFixed(1) + \"%)\";\n    var out = expo(clamp(p / 0.6)), inn = expo(clamp((p - 0.1) / 0.7));\n    for (var k = 0; k < 2; k++) {\n      els.big[k].style.transform = \"translateY(\" + ((k ? 1 : -1) * out * 110) + \"%)\";\n      els.big[k].style.opacity = 1 - out;\n      els.sm[k].style.transform = \"translateX(\" + ((k ? 1 : -1) * (1 - inn) * 50) + \"%)\";\n      els.sm[k].style.opacity = inn;\n    }\n    els.enter.style.opacity = 1 - clamp(p / 0.4);\n    els.back.style.opacity = clamp((p - 0.3) / 0.5);\n    var open = p > 0.5;\n    els.enter.tabIndex = open ? -1 : 0; els.back.tabIndex = open ? 0 : -1;\n    els.enter.style.pointerEvents = open ? \"none\" : \"auto\";\n    els.back.style.pointerEvents = open ? \"auto\" : \"none\";\n  }\n\n  function frame(now) {\n    var dt = Math.min(0.05, (now - last) / 1000); last = now;\n    var step = dt / Math.max(0.05, opts.duration);\n    if (prog < target) prog = Math.min(target, prog + step); else prog = Math.max(target, prog - step);\n    render(prog);\n    raf = prog === target ? 0 : requestAnimationFrame(frame);\n    if (!raf) settle();\n  }\n  function settle() { if (target === 1) els.back.focus({ preventScroll: true }); else if (stage.contains(document.activeElement) || document.activeElement === document.body) els.enter.focus({ preventScroll: true }); }\n  function go(t) {\n    target = t;\n    if (reduce) { prog = t; render(prog); settle(); return; }\n    if (!raf) { last = performance.now(); raf = requestAnimationFrame(frame); }\n  }\n  function onClick(ev) {\n    if (ev.target.closest(\".ef-itg__enter\")) go(1);\n    else if (ev.target.closest(\".ef-itg__back\")) go(0);\n  }\n  function onKey(ev) { if (ev.key === \"Escape\" && target === 1) go(0); }\n  var ro = typeof ResizeObserver === \"function\" ? new ResizeObserver(function () { render(prog); }) : null;\n  if (ro) ro.observe(stage);\n  stage.addEventListener(\"click\", onClick);\n  stage.addEventListener(\"keydown\", onKey);\n\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ title: \"Siobhan O'dwaya\", accent: \"#e6ff55\", duration: 1.4, spread: 120, art: \"puzzle\" }, opts, next || {});\n    opts.duration = Math.max(0.2, Math.min(4, +opts.duration || 1.4));\n    opts.spread = Math.max(0, Math.min(400, +opts.spread || 0));\n    if (!built || prev.title !== opts.title || prev.accent !== opts.accent || prev.art !== opts.art) build(); else render(prog);\n  }\n  update(o);\n  return {\n    update: update,\n    destroy: function () {\n      if (raf) cancelAnimationFrame(raf); raf = 0;\n      if (ro) ro.disconnect();\n      stage.removeEventListener(\"click\", onClick);\n      stage.removeEventListener(\"keydown\", onKey);\n    }\n  };\n}"
  }
}