{
  "id": "horizontal-scroll-gallery",
  "kind": "element",
  "title": "Horizontal scroll gallery with parallax",
  "summary": "A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.",
  "url": "https://enrichr.dev/elements/horizontal-scroll-gallery.html",
  "section": "gallery",
  "techniques": [
    "scroll-driven",
    "parallax",
    "carousel"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "immersive",
    "fluid",
    "polished"
  ],
  "intents": [
    "horizontal scrolling gallery",
    "vertical scroll to horizontal gallery",
    "wheel scroll sideways cards",
    "parallax images inside cards",
    "draggable card carousel with progress bar"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "speed",
      "label": "Wheel speed",
      "type": "range",
      "min": 0.3,
      "max": 3,
      "step": 0.1,
      "value": 1.2
    },
    {
      "key": "parallax",
      "label": "Parallax (%)",
      "type": "range",
      "min": 0,
      "max": 60,
      "step": 2,
      "value": 28
    },
    {
      "key": "smooth",
      "label": "Smoothing",
      "type": "range",
      "min": 0.04,
      "max": 0.4,
      "step": 0.02,
      "value": 0.12
    },
    {
      "key": "count",
      "label": "Cards",
      "type": "range",
      "min": 3,
      "max": 10,
      "step": 1,
      "value": 7
    }
  ],
  "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 \"Horizontal scroll gallery with parallax\" element to this project.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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/horizontal-scroll-gallery.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 \"Horizontal scroll gallery with parallax\" 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 \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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 \"Horizontal scroll gallery with parallax\" element to this codebase.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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-horizontal-scroll-gallery.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Horizontal scroll gallery with parallax 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 \"Horizontal scroll gallery with parallax\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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- horizontal-scroll-gallery.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 \"./horizontal-scroll-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HorizontalScrollGallery(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 \"Horizontal scroll gallery with parallax\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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- horizontal-scroll-gallery.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/HorizontalScrollGallery.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./horizontal-scroll-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HorizontalScrollGallery(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 \"Horizontal scroll gallery with parallax\" element.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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), horizontal-scroll-gallery.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 \"Horizontal scroll gallery with parallax\" element. No packages, no server code.\n\nThis is the \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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 horizontal-scroll-gallery.js and then main.js), style.css (the CSS below), horizontal-scroll-gallery.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 \"Horizontal scroll gallery with parallax\" 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 \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.json\n\nWhat it does: The gallery is a fixed-height viewport with a wide flex track inside it. A wheel listener on the viewport adds the vertical delta to a target position, drag adds the pointer movement, and keys add fixed steps. A single requestAnimationFrame loop eases the current position toward the target and writes one translate to the track, so every card moves together. For the parallax, each card's artwork layer is wider than the card, and its offset is set from how far the card centre is from the viewport centre, so the artwork slides at a different rate than the card. The progress bar is a scaleX driven by position divided by the maximum. The loop stops as soon as the position settles, and when the gallery is already at one end the wheel event is left alone so the page keeps scrolling.\nAccessibility: The viewport is a focusable region with a label, and responds to arrow keys, Page Up and Page Down, Home, End and Space, so it works without a mouse or wheel. The progress bar is exposed as a progressbar with a live value. The wheel and keys are only captured while the gallery can still move in that direction, which avoids trapping page scroll. With reduced motion the position jumps to the target without easing and the parallax is switched off.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Wheel speed: range 0.3 to 3, step 0.1, default 1.2\n- Parallax (%): range 0 to 60, step 2, default 28\n- Smoothing: range 0.04 to 0.4, step 0.02, default 0.12\n- Cards: range 3 to 10, step 1, default 7\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/horizontal-scroll-gallery.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 \"Horizontal scroll gallery with parallax\" 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 \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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 HorizontalScrollGallery.\n2. Paste the JavaScript below into a separate code file named horizontal-scroll-gallery.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 \"./horizontal-scroll-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HorizontalScrollGallery(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(HorizontalScrollGallery, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  speed: { type: ControlType.Number, title: \"Wheel speed\", min: 0.3, max: 3, step: 0.1, defaultValue: 1.2 },\n  parallax: { type: ControlType.Number, title: \"Parallax\", min: 0, max: 60, step: 2, defaultValue: 28 },\n  smooth: { type: ControlType.Number, title: \"Smoothing\", min: 0.04, max: 0.4, step: 0.02, defaultValue: 0.12 },\n  count: { type: ControlType.Number, title: \"Cards\", min: 3, max: 10, step: 1, defaultValue: 7 },\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 \"Horizontal scroll gallery with parallax\" 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 \"Horizontal scroll gallery with parallax\" element from the Enrichr Library: A row of gradient cards that moves sideways when you scroll the wheel, drag, or use the arrow keys, with parallax artwork inside each card and a progress bar.\nPage: https://enrichr.dev/elements/horizontal-scroll-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/horizontal-scroll-gallery.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-horizontal-scroll-gallery\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-horizontal-scroll-gallery\"), { ...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 viewport is a focusable region with a label, and responds to arrow keys, Page Up and Page Down, Home, End and Space, so it works without a mouse or wheel. The progress bar is exposed as a progressbar with a live value. The wheel and keys are only captured while the gallery can still move in that direction, which avoids trapping page scroll. With reduced motion the position jumps to the target without easing and the parallax is switched off.",
  "performance": "Only transforms are animated: one translate on the track and one on each artwork layer, and the progress bar uses scaleX. Card positions are measured on resize rather than every frame. The loop runs only while the position is moving and is cancelled on destroy. Keep the card count modest if each card holds a large image.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-hsg\">\n  <div class=\"ef-hsg__wrap\">\n    <div class=\"ef-hsg__vp\" tabindex=\"0\" role=\"region\" aria-roledescription=\"gallery\" aria-label=\"Horizontal gallery. Scroll, drag, or use the arrow keys to move sideways.\"><div class=\"ef-hsg__track\"></div></div>\n    <div class=\"ef-hsg__bar\" role=\"progressbar\" aria-label=\"Gallery progress\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"><span class=\"ef-hsg__fill\"></span></div>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-hsg { width: 100%; }\n.ef-hsg__wrap { box-sizing: border-box; position: relative; width: 100%; padding: 1.2rem 0 1.4rem; border-radius: 1rem; overflow: hidden; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; color: #fbf8f1; }\n.ef-hsg__vp { position: relative; height: 17rem; overflow: hidden; cursor: grab; touch-action: pan-y; outline: none; user-select: none; -webkit-user-select: none; border-radius: 0.6rem; }\n.ef-hsg__vp.is-drag { cursor: grabbing; }\n.ef-hsg__vp:focus-visible { box-shadow: 0 0 0 2px var(--ef-acc, #e6ff55); }\n.ef-hsg__track { display: flex; align-items: stretch; gap: 1rem; height: 100%; padding: 0 1.2rem; width: max-content; will-change: transform; }\n.ef-hsg__card { position: relative; flex: 0 0 auto; width: 18rem; max-width: 80vw; height: 100%; border-radius: 0.9rem; overflow: hidden; box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.6); }\n.ef-hsg__art { position: absolute; top: 0; bottom: 0; left: -20%; width: 140%; will-change: transform; transform: translate3d(var(--px, 0px), 0, 0); }\n.ef-hsg__card::after { content: \"\"; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), transparent 35%, transparent 50%, rgba(0, 0, 0, 0.62)); }\n.ef-hsg__n { position: absolute; z-index: 1; top: 0.8rem; left: 0.95rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; opacity: 0.85; }\n.ef-hsg__txt { position: absolute; z-index: 1; left: 0.95rem; right: 0.95rem; bottom: 0.9rem; pointer-events: none; }\n.ef-hsg__t { display: block; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }\n.ef-hsg__s { display: block; margin-top: 0.25rem; font-size: 0.72rem; opacity: 0.8; letter-spacing: 0.04em; }\n.ef-hsg__bar { position: relative; height: 3px; margin: 1rem 1.2rem 0; border-radius: 2px; background: rgba(251, 248, 241, 0.18); overflow: hidden; }\n.ef-hsg__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--ef-acc, #e6ff55); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }\n@media (prefers-reduced-motion: reduce) { .ef-hsg__art { transform: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Horizontal scroll gallery: vertical wheel, drag and keys inside the element are converted into sideways movement of a row of gradient cards.\n// Each card's artwork slides at a different rate than the card (parallax) and a progress bar tracks the position. Movement eases toward a target\n// in one rAF loop that stops when settled. At either end the wheel is released so the page can keep scrolling. Reduced motion jumps without easing or parallax.\n// mount(root, { background, accent, speed (0.3-3), parallax (0-60), smooth (0.04-0.4), count (3-10) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-hsg__wrap\");\n  var vp = root.querySelector(\".ef-hsg__vp\");\n  var track = root.querySelector(\".ef-hsg__track\");\n  var bar = root.querySelector(\".ef-hsg__bar\");\n  var opts = {}, cards = [], arts = [], metrics = [], raf = 0, cur = 0, tgt = 0, max = 0, vw = 0, drag = null, ro = null, dead = false;\n  var DATA = [[\"Tidal\", \"Field notes\"], [\"Ember\", \"Studio series\"], [\"Moss\", \"Quiet objects\"], [\"Dusk\", \"Night shift\"], [\"Arch\", \"Form study\"], [\"Grain\", \"Print run\"], [\"Haze\", \"Soft light\"], [\"Loop\", \"Motion kit\"], [\"Slate\", \"Ground work\"], [\"Bloom\", \"Late season\"]];\n\n  // Enrichr puzzle-piece artwork, inline so the code stays portable. piece(i, accent) returns an aria-hidden SVG string, a different piece per card.\n  var PIECES = [[\"1513.7 1453.9 322.3 322.3\", \"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    [\"1423.36 860.8 503.07 322.3\", \"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    [\"1513.7 166.86 322.3 503.06\", \"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  var PLACE = [[52, -16, 80, 14], [-24, 34, 96, -22], [46, 26, 74, 32], [-8, -20, 84, -12], [58, 38, 92, 24], [4, 18, 78, -32]]; // left %, top %, width %, rotate deg\n  var PCOL = [[\"#2f7d5b\", 0.95], [\"#0c1e18\", 0.8], [\"ACC\", 0.9], [\"#c6f26b\", 0.85], [\"#0a6b46\", 0.95], [\"#fbf8f1\", 0.85]];\n  function piece(i, accent, sx, ox) {\n    var p = PIECES[i % 3], q = PLACE[i % 6], c = PCOL[i % 6], k = sx || 1, o = ox || 0;\n    return '<span class=\"ef-hsg__pc\" aria-hidden=\"true\" style=\"position:absolute;left:' + (o + q[0] * k).toFixed(1) + '%;top:' + q[1] + '%;width:' + (q[2] * k).toFixed(1) + '%;transform:rotate(' + q[3] + 'deg);color:' + (c[0] === \"ACC\" ? accent : c[0]) + ';opacity:' + c[1] + ';pointer-events:none\"><svg viewBox=\"' + p[0] + '\" aria-hidden=\"true\" focusable=\"false\" style=\"display:block;width:100%;height:auto\"><path fill=\"currentColor\" d=\"' + p[1] + '\"/></svg></span>';\n  }\n  function art(i, a) {\n    var c = \"#fbf8f1\", d = \"#0c1e18\", p = i % 6;\n    if (p === 0) return \"radial-gradient(circle at 60% 32%, \" + a + \" 0 14%, transparent 15%), linear-gradient(160deg, #005236, \" + d + \")\";\n    if (p === 1) return \"conic-gradient(from 210deg at 45% 65%, #005236, \" + a + \", \" + c + \", #005236)\";\n    if (p === 2) return \"repeating-linear-gradient(120deg, #005236 0 14px, \" + d + \" 14px 28px)\";\n    if (p === 3) return \"radial-gradient(circle at 36% 38%, \" + a + \" 0 15%, transparent 16%), radial-gradient(circle at 66% 62%, \" + c + \" 0 15%, transparent 16%), linear-gradient(200deg, #0a6b46, \" + d + \")\";\n    if (p === 4) return \"radial-gradient(ellipse 28% 22% at 50% 44%, \" + c + \" 0 99%, transparent 100%), linear-gradient(190deg, #005236, \" + a + \")\";\n    return \"radial-gradient(circle, \" + a + \" 0 2.5px, transparent 3px) 0 0 / 18px 18px, linear-gradient(145deg, #005236, \" + d + \")\";\n  }\n  function clamp(v) { return Math.max(0, Math.min(max, v)); }\n  function measure() {\n    vw = vp.clientWidth;\n    max = Math.max(0, track.scrollWidth - vw);\n    metrics = cards.map(function (c) { return { l: c.offsetLeft, w: c.offsetWidth }; });\n    tgt = clamp(tgt); cur = clamp(cur);\n    render();\n  }\n  function render() {\n    track.style.transform = \"translate3d(\" + (-cur).toFixed(2) + \"px,0,0)\";\n    var p = max > 0 ? cur / max : 0;\n    wrap.style.setProperty(\"--p\", p.toFixed(4));\n    bar.style.setProperty(\"--p\", p.toFixed(4));\n    bar.setAttribute(\"aria-valuenow\", String(Math.round(p * 100)));\n    if (reduce) return;\n    for (var i = 0; i < arts.length; i++) {\n      var m = metrics[i]; if (!m) continue;\n      var d = (m.l + m.w / 2 - cur - vw / 2) / (vw || 1); // about -1..1 across the viewport\n      arts[i].style.setProperty(\"--px\", (d * m.w * opts.parallax / 100).toFixed(1) + \"px\");\n    }\n  }\n  function tick() {\n    raf = 0;\n    if (dead) return;\n    var diff = tgt - cur;\n    if (reduce || Math.abs(diff) < 0.3) { cur = tgt; render(); return; }\n    cur += diff * opts.smooth;\n    render();\n    raf = requestAnimationFrame(tick);\n  }\n  function go(v) { tgt = clamp(v); if (!raf && !dead) raf = requestAnimationFrame(tick); }\n\n  function onWheel(e) {\n    var d = Math.abs(e.deltaY) >= Math.abs(e.deltaX) ? e.deltaY : e.deltaX;\n    if (e.deltaMode === 1) d *= 32;\n    if (max <= 0 || d === 0 || (d < 0 && tgt <= 0) || (d > 0 && tgt >= max)) return; // let the page scroll at the ends\n    e.preventDefault();\n    go(tgt + d * opts.speed);\n  }\n  function onDown(e) {\n    if (e.pointerType === \"mouse\" && e.button !== 0) return;\n    drag = { x: e.clientX, y: e.clientY, t: tgt, id: e.pointerId };\n    vp.classList.add(\"is-drag\");\n    try { vp.setPointerCapture(e.pointerId); } catch (_) {}\n  }\n  function onMove(e) {\n    if (!drag || e.pointerId !== drag.id) return;\n    var dx = e.clientX - drag.x, dy = e.clientY - drag.y;\n    go(drag.t - (Math.abs(dx) >= Math.abs(dy) ? dx : dy));\n  }\n  function onUp() {\n    if (!drag) return;\n    try { vp.releasePointerCapture(drag.id); } catch (_) {}\n    drag = null;\n    vp.classList.remove(\"is-drag\");\n  }\n  function onKey(e) {\n    var step = Math.max(80, vw * 0.5), k = e.key, v = null;\n    if (k === \"ArrowRight\" || k === \"ArrowDown\") v = tgt + step;\n    else if (k === \"ArrowLeft\" || k === \"ArrowUp\") v = tgt - step;\n    else if (k === \"PageDown\" || k === \" \") v = tgt + vw * 0.9;\n    else if (k === \"PageUp\") v = tgt - vw * 0.9;\n    else if (k === \"Home\") v = 0;\n    else if (k === \"End\") v = max;\n    if (v === null) return;\n    if (max <= 0 || (v < tgt && tgt <= 0) || (v > tgt && tgt >= max)) return; // at the end: let the page handle the key\n    e.preventDefault();\n    go(v);\n  }\n  vp.addEventListener(\"wheel\", onWheel, { passive: false });\n  vp.addEventListener(\"pointerdown\", onDown);\n  vp.addEventListener(\"pointermove\", onMove);\n  vp.addEventListener(\"pointerup\", onUp);\n  vp.addEventListener(\"pointercancel\", onUp);\n  vp.addEventListener(\"keydown\", onKey);\n  if (window.ResizeObserver) { ro = new ResizeObserver(measure); ro.observe(vp); } else window.addEventListener(\"resize\", measure);\n\n  function build() {\n    track.textContent = \"\"; cards = []; arts = [];\n    for (var i = 0; i < opts.count; i++) {\n      var c = document.createElement(\"div\"); c.className = \"ef-hsg__card\";\n      var a = document.createElement(\"span\"); a.className = \"ef-hsg__art\"; a.style.background = art(i, opts.accent);\n      a.insertAdjacentHTML(\"beforeend\", piece(i, opts.accent, 0.714, 14.3)); // art is 140% wide: map to the card window\n      var n = document.createElement(\"span\"); n.className = \"ef-hsg__n\"; n.textContent = String(i + 1).padStart(2, \"0\");\n      var tx = document.createElement(\"span\"); tx.className = \"ef-hsg__txt\";\n      var t = document.createElement(\"span\"); t.className = \"ef-hsg__t\"; t.textContent = DATA[i % DATA.length][0];\n      var s = document.createElement(\"span\"); s.className = \"ef-hsg__s\"; s.textContent = DATA[i % DATA.length][1];\n      tx.appendChild(t); tx.appendChild(s);\n      c.appendChild(a); c.appendChild(n); c.appendChild(tx);\n      track.appendChild(c); cards.push(c); arts.push(a);\n    }\n    measure();\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", speed: 1.2, parallax: 28, smooth: 0.12, count: 7 }, opts, next || {});\n    opts.count = Math.max(3, Math.min(10, Math.round(opts.count)));\n    wrap.style.background = opts.background;\n    wrap.style.setProperty(\"--ef-acc\", opts.accent);\n    if (prev.count !== opts.count || prev.accent !== opts.accent) build(); else render();\n  }\n  function destroy() {\n    dead = true;\n    if (raf) cancelAnimationFrame(raf);\n    raf = 0;\n    vp.removeEventListener(\"wheel\", onWheel);\n    vp.removeEventListener(\"pointerdown\", onDown);\n    vp.removeEventListener(\"pointermove\", onMove);\n    vp.removeEventListener(\"pointerup\", onUp);\n    vp.removeEventListener(\"pointercancel\", onUp);\n    vp.removeEventListener(\"keydown\", onKey);\n    if (ro) ro.disconnect(); else window.removeEventListener(\"resize\", measure);\n  }\n  update(o);\n  return { update: update, destroy: destroy };\n}"
  }
}