{
  "id": "honeycomb-pulse-grid",
  "kind": "element",
  "title": "Honeycomb pulse grid",
  "summary": "A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.",
  "url": "https://enrichr.dev/elements/honeycomb-pulse-grid.html",
  "section": "background",
  "techniques": [
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "Canvas"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "energetic"
  ],
  "intents": [
    "honeycomb background animation",
    "hexagon grid pulse",
    "animated hex pattern background",
    "glowing honeycomb hero",
    "hexagon wave background"
  ],
  "status": "tested",
  "params": [
    {
      "key": "palette",
      "label": "Palette",
      "type": "select",
      "options": [
        [
          "enrichr",
          "Enrichr (green to lime)"
        ],
        [
          "lime",
          "Lime and cream"
        ],
        [
          "ember",
          "Ember"
        ],
        [
          "violet",
          "Violet"
        ],
        [
          "cream",
          "Green on cream"
        ]
      ],
      "value": "enrichr"
    },
    {
      "key": "radius",
      "label": "Cell radius (px)",
      "type": "range",
      "min": 16,
      "max": 90,
      "step": 1,
      "value": 36
    },
    {
      "key": "gap",
      "label": "Wall gap (px)",
      "type": "range",
      "min": 0,
      "max": 20,
      "step": 1,
      "value": 4
    },
    {
      "key": "rounding",
      "label": "Corner rounding (px)",
      "type": "range",
      "min": 0,
      "max": 18,
      "step": 1,
      "value": 4
    },
    {
      "key": "pointy",
      "label": "Orientation",
      "type": "select",
      "options": [
        [
          "1",
          "Pointy top"
        ],
        [
          "0",
          "Flat top"
        ]
      ],
      "value": "1"
    },
    {
      "key": "fill",
      "label": "Fill",
      "type": "select",
      "options": [
        [
          "solid",
          "Solid hexagons"
        ],
        [
          "dualRing",
          "Ring with inner hexagon"
        ],
        [
          "wireframe",
          "Outline"
        ],
        [
          "dotMatrix",
          "Outline with centre dot"
        ]
      ],
      "value": "solid"
    },
    {
      "key": "motion",
      "label": "Motion",
      "type": "select",
      "options": [
        [
          "radial",
          "Wave from the centre"
        ],
        [
          "linear",
          "Diagonal wave"
        ],
        [
          "shimmer",
          "Shimmer"
        ],
        [
          "breathe",
          "Breathing"
        ],
        [
          "mouse",
          "Click ripples only"
        ]
      ],
      "value": "radial"
    },
    {
      "key": "speed",
      "label": "Speed",
      "type": "range",
      "min": 0.1,
      "max": 3,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "depth",
      "label": "Scale pulse depth (%)",
      "type": "range",
      "min": 0,
      "max": 60,
      "step": 1,
      "value": 25
    },
    {
      "key": "glow",
      "label": "Glow (px)",
      "type": "range",
      "min": 0,
      "max": 35,
      "step": 1,
      "value": 12
    },
    {
      "key": "hover",
      "label": "Pointer glow",
      "type": "select",
      "options": [
        [
          "1",
          "On"
        ],
        [
          "0",
          "Off"
        ]
      ],
      "value": "1"
    },
    {
      "key": "primary",
      "label": "Cells",
      "type": "color",
      "value": "#1a7a4c"
    },
    {
      "key": "secondary",
      "label": "Wave crest",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "border",
      "label": "Cell border",
      "type": "color",
      "value": "#003d28"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    }
  ],
  "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 \"Honeycomb pulse grid\" element to this project.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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/honeycomb-pulse-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 \"Honeycomb pulse grid\" 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 \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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 \"Honeycomb pulse grid\" element to this codebase.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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-honeycomb-pulse-grid.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Honeycomb pulse grid 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 \"Honeycomb pulse grid\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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- honeycomb-pulse-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 \"./honeycomb-pulse-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HoneycombPulseGrid(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 \"Honeycomb pulse grid\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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- honeycomb-pulse-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/HoneycombPulseGrid.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./honeycomb-pulse-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HoneycombPulseGrid(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 \"Honeycomb pulse grid\" element.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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), honeycomb-pulse-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 \"Honeycomb pulse grid\" element. No packages, no server code.\n\nThis is the \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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 honeycomb-pulse-grid.js and then main.js), style.css (the CSS below), honeycomb-pulse-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 \"Honeycomb pulse grid\" 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 \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-grid.json\n\nWhat it does: Rounded hexagons are laid out in offset rows (or columns for flat tops), one cell past every edge. A clock adds 0.016 times the speed per frame at 60 frames a second. Each cell's wave value is the sine of (distance from the centre times 0.012 minus clock times 3) for the centre wave, the sine of ((x plus y) times 0.008 minus clock times 3) for the diagonal wave, a per-cell phase for the shimmer, or one sine for the whole grid when breathing. The cell is drawn at 1 plus wave times the depth, so crests overlap their neighbours and troughs open dark gaps, and the same wave slides its colour from the cell colour toward the crest colour. Cells within 180 pixels of the pointer grow by up to 25% and brighten. A click starts a ring that grows 8 pixels a frame and fades by 0.015 a frame; cells within 60 pixels of the ring swell by up to 35%. Each cell glows in its own colour: the silhouettes are drawn to a half-size layer, blurred once with the same Gaussian a canvas shadow uses, laid under the grid, and the cells are drawn sharp on top in the original order. Cells lit by the pointer or a ring keep their own wider shadow.\nAccessibility: The canvas is decorative and has a text label. With prefers-reduced-motion it draws one still frame of the wave and ignores the pointer and clicks. At the default speed each wave takes about two seconds to pass, a slow swell with no flashing. Click ripples are a pointer extra; nothing needs the keyboard.\n\nTunable settings:\n- Palette: select (Enrichr (green to lime) / Lime and cream / Ember / Violet / Green on cream), default enrichr\n- Cell radius (px): range 16 to 90, step 1, default 36\n- Wall gap (px): range 0 to 20, step 1, default 4\n- Corner rounding (px): range 0 to 18, step 1, default 4\n- Orientation: select (Pointy top / Flat top), default 1\n- Fill: select (Solid hexagons / Ring with inner hexagon / Outline / Outline with centre dot), default solid\n- Motion: select (Wave from the centre / Diagonal wave / Shimmer / Breathing / Click ripples only), default radial\n- Speed: range 0.1 to 3, step 0.1, default 1\n- Scale pulse depth (%): range 0 to 60, step 1, default 25\n- Glow (px): range 0 to 35, step 1, default 12\n- Pointer glow: select (On / Off), default 1\n- Cells: color, default #1a7a4c\n- Wave crest: color, default #e6ff55\n- Cell border: color, default #003d28\n- Background: color, default #0c1e18\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/honeycomb-pulse-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 \"Honeycomb pulse grid\" 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 \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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 HoneycombPulseGrid.\n2. Paste the JavaScript below into a separate code file named honeycomb-pulse-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 \"./honeycomb-pulse-grid\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HoneycombPulseGrid(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(HoneycombPulseGrid, {\n  palette: { type: ControlType.Enum, title: \"Palette\", options: [\"enrichr\",\"lime\",\"ember\",\"violet\",\"cream\"], optionTitles: [\"Enrichr (green to lime)\",\"Lime and cream\",\"Ember\",\"Violet\",\"Green on cream\"], defaultValue: \"enrichr\" },\n  radius: { type: ControlType.Number, title: \"Cell radius\", min: 16, max: 90, step: 1, defaultValue: 36 },\n  gap: { type: ControlType.Number, title: \"Wall gap\", min: 0, max: 20, step: 1, defaultValue: 4 },\n  rounding: { type: ControlType.Number, title: \"Corner rounding\", min: 0, max: 18, step: 1, defaultValue: 4 },\n  pointy: { type: ControlType.Enum, title: \"Orientation\", options: [\"1\",\"0\"], optionTitles: [\"Pointy top\",\"Flat top\"], defaultValue: \"1\" },\n  fill: { type: ControlType.Enum, title: \"Fill\", options: [\"solid\",\"dualRing\",\"wireframe\",\"dotMatrix\"], optionTitles: [\"Solid hexagons\",\"Ring with inner hexagon\",\"Outline\",\"Outline with centre dot\"], defaultValue: \"solid\" },\n  motion: { type: ControlType.Enum, title: \"Motion\", options: [\"radial\",\"linear\",\"shimmer\",\"breathe\",\"mouse\"], optionTitles: [\"Wave from the centre\",\"Diagonal wave\",\"Shimmer\",\"Breathing\",\"Click ripples only\"], defaultValue: \"radial\" },\n  speed: { type: ControlType.Number, title: \"Speed\", min: 0.1, max: 3, step: 0.1, defaultValue: 1 },\n  depth: { type: ControlType.Number, title: \"Scale pulse depth\", min: 0, max: 60, step: 1, defaultValue: 25 },\n  glow: { type: ControlType.Number, title: \"Glow\", min: 0, max: 35, step: 1, defaultValue: 12 },\n  hover: { type: ControlType.Enum, title: \"Pointer glow\", options: [\"1\",\"0\"], optionTitles: [\"On\",\"Off\"], defaultValue: \"1\" },\n  primary: { type: ControlType.Color, title: \"Cells\", defaultValue: \"#1a7a4c\" },\n  secondary: { type: ControlType.Color, title: \"Wave crest\", defaultValue: \"#e6ff55\" },\n  border: { type: ControlType.Color, title: \"Cell border\", defaultValue: \"#003d28\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\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 \"Honeycomb pulse grid\" 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 \"Honeycomb pulse grid\" element from the Enrichr Library: A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre, with a pointer glow and click ripples.\nPage: https://enrichr.dev/elements/honeycomb-pulse-grid.html\nMachine-readable spec: https://enrichr.dev/elements/honeycomb-pulse-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-honeycomb-pulse-grid\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-honeycomb-pulse-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": "The canvas is decorative and has a text label. With prefers-reduced-motion it draws one still frame of the wave and ignores the pointer and clicks. At the default speed each wave takes about two seconds to pass, a slow swell with no flashing. Click ripples are a pointer extra; nothing needs the keyboard.",
  "performance": "The original gave every cell its own canvas shadow, one blur per cell per frame, and ran at about 21 frames a second at 1280 by 720 in a GPU test. This version blurs all the silhouettes once per frame on a half-size layer and held 60 in the same test. Only cells lit by the pointer or a ring keep their own shadow, and Glow 0 skips the blur entirely. Browsers without canvas filters fall back to per-cell shadows. The pixel ratio is capped at 2 and the loop pauses off screen or in a hidden tab.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/yyMGqQN",
  "source": {
    "markup": "<div class=\"ef-hcp\"><canvas class=\"ef-hcp__c\" role=\"img\" aria-label=\"A honeycomb of glowing hexagons that swell and shrink in a wave rolling out from the centre\"></canvas></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-hcp { position: relative; width: 100%; min-height: 24rem; overflow: hidden; border-radius: 1rem; background: #0c1e18; touch-action: pan-y; }\n.ef-hcp .ef-hcp__c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Honeycomb pulse grid: a canvas honeycomb of rounded hexagons that swell and shrink in a wave. Each cell's scale is\n// 1 + wave x depth, where the wave is sin(distance from centre x 0.012 - time x 3) for the radial ripple (or a diagonal\n// sweep, a per-cell shimmer, or one breath for the whole grid), and the same wave slides each cell's colour from the\n// primary toward the secondary. Cells near the pointer grow and brighten, and a click sends out a ring that pushes cells\n// up as it passes, fading as it spreads. Cells glow in their own colour. The clock runs at the original's pace (0.016 per\n// frame at 60 fps, times speed), made frame-rate independent.\n// The glow: the original gave every cell its own canvas shadow, which costs one blur per cell per frame. Here each cell's\n// silhouette goes onto a half-resolution layer, that layer is blurred once (the same Gaussian a shadow uses) and stretched\n// under the grid, and the cells are then drawn sharp on top in the original order. Only cells lit by the pointer or a ring,\n// whose glow is wider, keep their own shadow. Browsers without canvas filters fall back to a shadow on every cell.\n// Reduced motion draws one still frame of the wave and ignores the pointer. The loop pauses off screen and in hidden tabs.\n// mount(root, { palette, radius (cell radius, px), gap (px), rounding (px), pointy (1 pointy top, 0 flat top),\n//               fill (solid, dualRing, wireframe, dotMatrix), motion (radial, linear, shimmer, breathe, mouse), speed,\n//               depth (scale pulse, %), glow (px), hover (1 on, 0 off), primary, secondary, border, background })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-hcp\");\n  var canvas = root.querySelector(\".ef-hcp__c\");\n  var ctx = canvas.getContext(\"2d\");\n  var layer = document.createElement(\"canvas\"), lctx = layer.getContext(\"2d\"); // silhouettes, half resolution\n  var soft = document.createElement(\"canvas\"), sctx = soft.getContext(\"2d\"); // the same, blurred\n  var canFilter = (function () { try { sctx.filter = \"blur(1px)\"; var ok = sctx.filter === \"blur(1px)\"; sctx.filter = \"none\"; return ok; } catch (e) { return false; } })();\n  var PALETTES = {\n    enrichr: { primary: \"#1a7a4c\", secondary: \"#e6ff55\", border: \"#003d28\", background: \"#0c1e18\" },\n    lime: { primary: \"#d2eb3c\", secondary: \"#fbf8f1\", border: \"#085e3d\", background: \"#0c1e18\" },\n    ember: { primary: \"#e54c1e\", secondary: \"#fbf8f1\", border: \"#050d0a\", background: \"#0c1e18\" },\n    violet: { primary: \"#4b1a9a\", secondary: \"#fbf8f1\", border: \"#050d0a\", background: \"#0c1e18\" },\n    cream: { primary: \"#005236\", secondary: \"#e6ff55\", border: \"#fbf8f1\", background: \"#fbf8f1\" }\n  };\n  var COLOR_KEYS = [\"primary\", \"secondary\", \"border\", \"background\"];\n  var DEF = { palette: \"enrichr\", radius: 36, gap: 4, rounding: 4, pointy: 1, fill: \"solid\", motion: \"radial\", speed: 1, depth: 25, glow: 12, hover: 1,\n    primary: \"#1a7a4c\", secondary: \"#e6ff55\", border: \"#003d28\", background: \"#0c1e18\" };\n\n  var opts = {}, col = {}, custom = {}, mounted = false;\n  var raf = 0, visible = true, io = null, ro = null, destroyed = false, last = 0, time = 0;\n  var W = 0, H = 0, dpr = 1, ripples = [], lit = [], mouse = { x: -1000, y: -1000, active: false };\n  var pts = [{}, {}, {}, {}, {}, {}];\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function rgb(h) { var m = /^#?([0-9a-f]{6})$/i.exec(h || \"\"); var v = parseInt(m ? m[1] : \"000000\", 16); return [v >> 16, (v >> 8) & 255, v & 255]; }\n  function mixColor(a, b, f) {\n    f = Math.max(0, Math.min(1, f));\n    return \"rgb(\" + Math.round(a[0] + f * (b[0] - a[0])) + \", \" + Math.round(a[1] + f * (b[1] - a[1])) + \", \" + Math.round(a[2] + f * (b[2] - a[2])) + \")\";\n  }\n\n  // a hexagon with each corner cut back by the rounding and bridged with a quadratic curve, as in the original\n  function hexPath(g, cx, cy, radius, corner, pointy) {\n    var off = pointy ? Math.PI / 6 : 0, i;\n    for (i = 0; i < 6; i++) { var a = Math.PI / 3 * i + off; pts[i].x = cx + radius * Math.cos(a); pts[i].y = cy + radius * Math.sin(a); }\n    g.beginPath();\n    if (corner <= 0) {\n      g.moveTo(pts[0].x, pts[0].y);\n      for (i = 1; i < 6; i++) g.lineTo(pts[i].x, pts[i].y);\n      g.closePath();\n      return;\n    }\n    for (i = 0; i < 6; i++) {\n      var p1 = pts[i], p2 = pts[(i + 1) % 6], p0 = pts[(i + 5) % 6];\n      var v1x = p0.x - p1.x, v1y = p0.y - p1.y, v2x = p2.x - p1.x, v2y = p2.y - p1.y;\n      var l1 = Math.hypot(v1x, v1y), l2 = Math.hypot(v2x, v2y), r = Math.min(corner, l1 / 2, l2 / 2);\n      var ax = p1.x + v1x / l1 * r, ay = p1.y + v1y / l1 * r;\n      if (i === 0) g.moveTo(ax, ay); else g.lineTo(ax, ay);\n      g.quadraticCurveTo(p1.x, p1.y, p1.x + v2x / l2 * r, p1.y + v2y / l2 * r);\n    }\n    g.closePath();\n  }\n\n  // one cell in the chosen fill mode. With mono set, every part is painted in the cell colour: that is the silhouette a\n  // canvas shadow would cast (the original's shadow colour is the cell colour for the fill, stroke and inner parts alike).\n  function cell(g, cx, cy, dR, dRound, color, mono) {\n    var pointy = opts.pointy, fill = opts.fill;\n    if (fill === \"dualRing\") {\n      hexPath(g, cx, cy, dR, dRound, pointy);\n      g.strokeStyle = color; g.lineWidth = 3; g.stroke();\n      hexPath(g, cx, cy, dR * 0.5, dRound * 0.5, pointy);\n      g.fillStyle = mono ? color : col.secondary; g.fill();\n    } else if (fill === \"wireframe\") {\n      hexPath(g, cx, cy, dR, dRound, pointy);\n      g.strokeStyle = color; g.lineWidth = 2; g.stroke();\n    } else if (fill === \"dotMatrix\") {\n      hexPath(g, cx, cy, dR, dRound, pointy);\n      g.strokeStyle = mono ? color : col.border; g.lineWidth = 1; g.stroke();\n      g.beginPath(); g.arc(cx, cy, Math.max(2, dR * 0.25), 0, Math.PI * 2);\n      g.fillStyle = color; g.fill();\n    } else {\n      hexPath(g, cx, cy, dR, dRound, pointy);\n      g.fillStyle = color; g.fill();\n      if (col.border.toLowerCase() !== col.background.toLowerCase()) { g.strokeStyle = mono ? color : col.border; g.lineWidth = 1.5; g.stroke(); }\n    }\n  }\n\n  function draw() {\n    var cX = W / 2, cY = H / 2, R = opts.radius, gap = opts.gap, pointy = opts.pointy, motion = opts.motion, amp = opts.depth / 100;\n    var c1 = rgb(col.primary), c2 = rgb(col.secondary), live = !reduce && opts.hover && mouse.active, glow = opts.glow;\n    var hs = pointy ? Math.sqrt(3) * R + gap : 1.5 * R + gap * 0.866;\n    var vs = pointy ? 1.5 * R + gap * 0.866 : Math.sqrt(3) * R + gap;\n    var cols = Math.ceil(W / hs) + 3, rows = Math.ceil(H / vs) + 3;\n    var useLayer = canFilter && glow > 0, n = 0, i;\n    ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    ctx.shadowBlur = 0;\n    ctx.fillStyle = col.background;\n    ctx.fillRect(0, 0, W, H);\n    if (useLayer) { lctx.setTransform(1, 0, 0, 1, 0, 0); lctx.clearRect(0, 0, layer.width, layer.height); lctx.setTransform(layer.width / W, 0, 0, layer.height / H, 0, 0); }\n    for (var r = -1; r < rows; r++) {\n      for (var c = -1; c < cols; c++) {\n        var cx, cy;\n        if (pointy) { cx = c * hs + (r % 2 !== 0 ? hs / 2 : 0); cy = r * vs; }\n        else { cx = c * hs; cy = r * vs + (c % 2 !== 0 ? vs / 2 : 0); }\n        var wave = 0;\n        if (motion === \"radial\") wave = Math.sin(Math.hypot(cx - cX, cy - cY) * 0.012 - time * 3);\n        else if (motion === \"linear\") wave = Math.sin((cx + cy) * 0.008 - time * 3);\n        else if (motion === \"shimmer\") wave = Math.sin((c * 17 + r * 31) * 0.5 + time * 4);\n        else if (motion === \"breathe\") wave = Math.sin(time * 2);\n        var scale = 1 + wave * amp, boost = 0;\n        if (live) {\n          var dm = Math.hypot(cx - mouse.x, cy - mouse.y);\n          if (dm < 180) { boost = Math.pow(1 - dm / 180, 2); scale += boost * 0.25; }\n        }\n        for (var k = 0; k < ripples.length; k++) {\n          var rp = ripples[k], diff = Math.abs(Math.hypot(cx - rp.x, cy - rp.y) - rp.radius);\n          if (diff < 60) { var rf = (1 - diff / 60) * rp.alpha; scale += rf * 0.35; boost = Math.max(boost, rf); }\n        }\n        scale = Math.max(0.1, scale);\n        var dR = R * scale, dRound = opts.rounding * scale;\n        var color = mixColor(c1, c2, (wave + 1) / 2 * 0.8 + boost * 0.5);\n        if (!useLayer) {\n          // no canvas filters: the original's way, a shadow on every cell\n          if (glow > 0) { ctx.shadowColor = color; ctx.shadowBlur = glow * (0.5 + boost) * dpr; }\n          cell(ctx, cx, cy, dR, dRound, color, false);\n          continue;\n        }\n        // cells the pointer or a ring lights up get their own, wider shadow below; the rest glow through the shared layer\n        if (boost <= 0) cell(lctx, cx, cy, dR, dRound, color, true);\n        lit[n++] = cx; lit[n++] = cy; lit[n++] = dR; lit[n++] = dRound; lit[n++] = color; lit[n++] = boost;\n      }\n    }\n    if (useLayer) {\n      // the silhouettes, blurred by the Gaussian a canvas shadow of glow x 0.5 uses (sigma = blur / 2, in layer pixels),\n      // stretched to full size, then every cell sharp on top in the original order\n      sctx.setTransform(1, 0, 0, 1, 0, 0);\n      sctx.clearRect(0, 0, soft.width, soft.height);\n      sctx.filter = \"blur(\" + (glow * 0.5 / 2 * layer.width / W) + \"px)\";\n      sctx.drawImage(layer, 0, 0);\n      sctx.filter = \"none\";\n      ctx.setTransform(1, 0, 0, 1, 0, 0);\n      ctx.drawImage(soft, 0, 0, canvas.width, canvas.height);\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      for (i = 0; i < n; i += 6) {\n        if (lit[i + 5] > 0) { ctx.shadowColor = lit[i + 4]; ctx.shadowBlur = glow * (0.5 + lit[i + 5]) * dpr; }\n        else ctx.shadowBlur = 0;\n        cell(ctx, lit[i], lit[i + 1], lit[i + 2], lit[i + 3], lit[i + 4], false);\n      }\n    }\n    ctx.shadowBlur = 0;\n  }\n\n  function loop(now) {\n    raf = requestAnimationFrame(loop);\n    var dt = Math.min(0.05, (now - last) / 1000 || 0); last = now;\n    if (!visible || document.hidden) return;\n    var f = dt * 60; // the original steps once per frame at 60 fps\n    time += 0.016 * opts.speed * f;\n    for (var i = ripples.length - 1; i >= 0; i--) {\n      var rp = ripples[i];\n      rp.radius += 8 * opts.speed * f;\n      rp.alpha -= 0.015 * f;\n      if (rp.alpha <= 0 || rp.radius > Math.max(W, H) * 1.2) ripples.splice(i, 1);\n    }\n    draw();\n  }\n\n  function size() {\n    var w = Math.max(1, wrap.clientWidth), h = Math.max(1, wrap.clientHeight), nd = Math.min(window.devicePixelRatio || 1, 2);\n    if (w === W && h === H && nd === dpr) return;\n    W = w; H = h; dpr = nd;\n    canvas.width = Math.round(W * dpr); canvas.height = Math.round(H * dpr);\n    soft.width = layer.width = Math.max(1, Math.round(W * dpr / 2)); soft.height = layer.height = Math.max(1, Math.round(H * dpr / 2));\n    draw();\n  }\n\n  function point(e) { var r = wrap.getBoundingClientRect(); return { x: e.clientX - r.left, y: e.clientY - r.top }; }\n  function onMove(e) { var p = point(e); mouse.x = p.x; mouse.y = p.y; mouse.active = true; }\n  function onLeave() { mouse.active = false; }\n  function onClick(e) { if (reduce) return; var p = point(e); ripples.push({ x: p.x, y: p.y, radius: 0, alpha: 1 }); }\n\n  function update(partial) {\n    partial = partial || {};\n    opts = Object.assign({}, DEF, opts, partial);\n    opts.radius = Math.max(4, num(opts.radius, 36)); opts.gap = Math.max(0, num(opts.gap, 4)); opts.rounding = Math.max(0, num(opts.rounding, 4));\n    opts.pointy = String(opts.pointy) === \"1\" || opts.pointy === true; opts.hover = String(opts.hover) === \"1\" || opts.hover === true;\n    opts.speed = Math.max(0, num(opts.speed, 1)); opts.depth = num(opts.depth, 25); opts.glow = Math.max(0, num(opts.glow, 12));\n    // colours: the palette sets all four; a colour you pick yourself wins for that role\n    if (!mounted) { COLOR_KEYS.forEach(function (k) { custom[k] = partial[k] != null && String(partial[k]).toLowerCase() !== DEF[k]; }); }\n    else {\n      if (\"palette\" in partial) custom = {};\n      COLOR_KEYS.forEach(function (k) { if (k in partial) custom[k] = true; });\n    }\n    var pal = PALETTES[opts.palette] || PALETTES.enrichr;\n    COLOR_KEYS.forEach(function (k) { col[k] = custom[k] ? String(opts[k]) : pal[k]; });\n    wrap.style.background = col.background;\n    if (destroyed || !mounted) return;\n    draw();\n  }\n\n  update(o);\n  mounted = true;\n  size();\n  wrap.addEventListener(\"pointermove\", onMove);\n  wrap.addEventListener(\"pointerleave\", onLeave);\n  wrap.addEventListener(\"pointercancel\", onLeave);\n  wrap.addEventListener(\"click\", onClick);\n  if (!reduce) {\n    if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(wrap); }\n    last = performance.now(); raf = requestAnimationFrame(loop);\n  }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) size(); }); ro.observe(wrap); }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf);\n      wrap.removeEventListener(\"pointermove\", onMove);\n      wrap.removeEventListener(\"pointerleave\", onLeave);\n      wrap.removeEventListener(\"pointercancel\", onLeave);\n      wrap.removeEventListener(\"click\", onClick);\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n      ripples = []; lit = [];\n      layer.width = layer.height = soft.width = soft.height = 0;\n    }\n  };\n}"
  }
}