{
  "id": "infinite-snap-cards",
  "kind": "element",
  "title": "Infinite snap cards",
  "summary": "A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.",
  "url": "https://enrichr.dev/elements/infinite-snap-cards.html",
  "section": "gallery",
  "techniques": [
    "carousel",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "modern",
    "polished",
    "fluid"
  ],
  "intents": [
    "infinite scrolling cards",
    "looping vertical card stack",
    "continuous snap scroll",
    "wheel driven card carousel",
    "stacked cards scale and fade"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "count",
      "label": "Cards",
      "type": "range",
      "min": 3,
      "max": 8,
      "step": 1,
      "value": 6
    },
    {
      "key": "spread",
      "label": "Card spacing",
      "type": "range",
      "min": 0.4,
      "max": 1.1,
      "step": 0.05,
      "value": 0.75
    },
    {
      "key": "fade",
      "label": "Fade by distance",
      "type": "range",
      "min": 0.1,
      "max": 0.6,
      "step": 0.02,
      "value": 0.32
    },
    {
      "key": "sensitivity",
      "label": "Input sensitivity",
      "type": "range",
      "min": 0.3,
      "max": 2,
      "step": 0.1,
      "value": 1
    }
  ],
  "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 \"Infinite snap cards\" element to this project.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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/infinite-snap-cards.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 \"Infinite snap cards\" 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 \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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 \"Infinite snap cards\" element to this codebase.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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-infinite-snap-cards.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Infinite snap cards 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 \"Infinite snap cards\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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- infinite-snap-cards.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 \"./infinite-snap-cards\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InfiniteSnapCards(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 \"Infinite snap cards\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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- infinite-snap-cards.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/InfiniteSnapCards.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./infinite-snap-cards\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InfiniteSnapCards(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 \"Infinite snap cards\" element.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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), infinite-snap-cards.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 \"Infinite snap cards\" element. No packages, no server code.\n\nThis is the \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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 infinite-snap-cards.js and then main.js), style.css (the CSS below), infinite-snap-cards.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 \"Infinite snap cards\" 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 \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.json\n\nWhat it does: Every card has a position measured in card units and one shared scroll position, pos. For each card the script takes its offset from pos, wraps it into the range of minus half to plus half of the card count so the stack loops, then writes a translateY from that offset, a scale that shrinks with distance and an opacity that falls off with distance. Wheel, drag and arrow keys change pos. When input has been quiet for a moment the script picks the nearest whole card, including a little flick momentum, and eases pos toward it with an exponential approach, which is the continuous snap. The animation loop only runs while something is moving.\nAccessibility: The stack is one focusable group; the up and down arrow keys step a card at a time and a hidden live region announces the centred card. Wheel capture is limited to the element, so the page scrolls normally everywhere else, but because it traps vertical touch drags, leave room beside it for users to scroll past. With reduced motion the stack steps one card per wheel notch, swipe or key press with no easing. Text sits over gradients with a dark scrim; check contrast if you swap the artwork.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Cards: range 3 to 8, step 1, default 6\n- Card spacing: range 0.4 to 1.1, step 0.05, default 0.75\n- Fade by distance: range 0.1 to 0.6, step 0.02, default 0.32\n- Input sensitivity: range 0.3 to 2, step 0.1, default 1\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/infinite-snap-cards.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 \"Infinite snap cards\" 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 \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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 InfiniteSnapCards.\n2. Paste the JavaScript below into a separate code file named infinite-snap-cards.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 \"./infinite-snap-cards\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function InfiniteSnapCards(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(InfiniteSnapCards, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  count: { type: ControlType.Number, title: \"Cards\", min: 3, max: 8, step: 1, defaultValue: 6 },\n  spread: { type: ControlType.Number, title: \"Card spacing\", min: 0.4, max: 1.1, step: 0.05, defaultValue: 0.75 },\n  fade: { type: ControlType.Number, title: \"Fade by distance\", min: 0.1, max: 0.6, step: 0.02, defaultValue: 0.32 },\n  sensitivity: { type: ControlType.Number, title: \"Input sensitivity\", min: 0.3, max: 2, step: 0.1, defaultValue: 1 },\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 \"Infinite snap cards\" 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 \"Infinite snap cards\" element from the Enrichr Library: A vertical stack of cards that loops forever with wheel, drag, touch or arrow keys, easing to the nearest card and scaling and fading by distance from the centre.\nPage: https://enrichr.dev/elements/infinite-snap-cards.html\nMachine-readable spec: https://enrichr.dev/elements/infinite-snap-cards.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-infinite-snap-cards\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-infinite-snap-cards\"), { ...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 stack is one focusable group; the up and down arrow keys step a card at a time and a hidden live region announces the centred card. Wheel capture is limited to the element, so the page scrolls normally everywhere else, but because it traps vertical touch drags, leave room beside it for users to scroll past. With reduced motion the stack steps one card per wheel notch, swipe or key press with no easing. Text sits over gradients with a dark scrim; check contrast if you swap the artwork.",
  "performance": "Each frame writes a transform and opacity on at most eight cards, and nothing else is animated. The loop stops as soon as the stack settles, and a ResizeObserver handles re-measuring. Cards far from the centre are hidden with visibility so they cost nothing to paint.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-isc\">\n  <div class=\"ef-isc__wrap\" tabindex=\"0\" role=\"group\" aria-roledescription=\"carousel\" aria-label=\"Infinite card stack. Use the up and down arrow keys, the mouse wheel or drag to move.\">\n    <div class=\"ef-isc__stage\"></div>\n    <div class=\"ef-isc__live\" aria-live=\"polite\"></div>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-isc { width: 100%; }\n.ef-isc__wrap { position: relative; box-sizing: border-box; width: 100%; height: 24rem; overflow: hidden; border-radius: 1rem; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; overscroll-behavior: contain; }\n.ef-isc__wrap.is-drag { cursor: grabbing; }\n.ef-isc__wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--ef-acc, #e6ff55); }\n.ef-isc__stage { position: absolute; inset: 0; }\n.ef-isc__card { position: absolute; left: 50%; top: 50%; width: min(86%, 24rem); height: 8.5rem; box-sizing: border-box; border-radius: 0.9rem; overflow: hidden; color: #fbf8f1; transform: translate3d(-50%, -50%, 0); will-change: transform, opacity; box-shadow: 0 14px 24px -14px rgba(0, 0, 0, 0.7); }\n.ef-isc__card.is-active { box-shadow: 0 0 0 2px var(--ef-acc, #e6ff55), 0 18px 30px -14px rgba(0, 0, 0, 0.75); }\n.ef-isc__art { position: absolute; inset: 0; }\n.ef-isc__art::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.05) 70%); }\n.ef-isc__n { position: absolute; top: 0.8rem; right: 1rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; opacity: 0.85; }\n.ef-isc__txt { position: absolute; left: 1.1rem; bottom: 1rem; right: 1.1rem; pointer-events: none; }\n.ef-isc__t { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }\n.ef-isc__s { display: block; margin-top: 0.25rem; font-size: 0.74rem; letter-spacing: 0.05em; opacity: 0.8; }\n.ef-isc__live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@media (prefers-reduced-motion: reduce) { .ef-isc__card { will-change: auto; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Infinite snap cards: a vertical stack that loops forever. Wheel (only while the pointer is over it), drag, touch and the arrow keys move it;\n// when input stops it eases to the nearest card. Cards scale and fade by their distance from the centre. Reduced motion steps one card at a time with no easing.\n// mount(root, { background, accent, count (3-8), spread (0.4-1.1), fade (0.1-0.6), sensitivity (0.3-2) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-isc__wrap\");\n  var stage = root.querySelector(\".ef-isc__stage\");\n  var live = root.querySelector(\".ef-isc__live\");\n  var opts = {}, cards = [], offs = [], raf = 0, last = 0;\n  var pos = 0, target = null, vel = 0, step = 100, idle = 0, drag = null, acc = 0, shown = -1;\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\"]];\n\n  function art(i, a) {\n    var c = \"#fbf8f1\", d = \"#0c1e18\", p = i % 6;\n    if (p === 0) return \"radial-gradient(circle at 78% 35%, \" + a + \" 0 16%, transparent 17%), linear-gradient(160deg, #005236, \" + d + \")\";\n    if (p === 1) return \"conic-gradient(from 210deg at 70% 60%, #005236, \" + a + \", \" + c + \", #005236)\";\n    if (p === 2) return \"repeating-linear-gradient(120deg, #005236 0 12px, \" + d + \" 12px 24px)\";\n    if (p === 3) return \"radial-gradient(circle at 74% 40%, \" + a + \" 0 14%, transparent 15%), radial-gradient(circle at 88% 66%, \" + c + \" 0 12%, transparent 13%), linear-gradient(200deg, #0a6b46, \" + d + \")\";\n    if (p === 4) return \"linear-gradient(190deg, #005236, \" + a + \")\";\n    return \"radial-gradient(circle, \" + a + \" 0 2.5px, transparent 3px) 0 0 / 16px 16px, linear-gradient(145deg, #005236, \" + d + \")\";\n  }\n  function wrapIdx(i) { var n = cards.length; return ((i % n) + n) % n; }\n  function render() {\n    var n = cards.length;\n    for (var i = 0; i < n; i++) {\n      var d = i - pos;\n      d -= n * Math.round(d / n);\n      var ad = Math.abs(d);\n      var sc = Math.max(0.5, 1 - ad * 0.13);\n      var op = Math.max(0, 1 - ad * opts.fade);\n      var el = cards[i];\n      el.style.transform = \"translate3d(-50%, calc(-50% + \" + (d * step).toFixed(2) + \"px), 0) scale(\" + sc.toFixed(3) + \")\";\n      el.style.opacity = op.toFixed(3);\n      el.style.zIndex = String(100 - Math.round(ad * 10));\n      el.style.visibility = op <= 0.01 ? \"hidden\" : \"visible\";\n    }\n    var a = wrapIdx(Math.round(pos));\n    if (a !== shown) {\n      shown = a;\n      for (var j = 0; j < n; j++) cards[j].classList.toggle(\"is-active\", j === a);\n      live.textContent = DATA[a % DATA.length][0] + \", \" + (a + 1) + \" of \" + n;\n    }\n  }\n  function measure() {\n    var h = cards[0] ? cards[0].offsetHeight : 136;\n    step = Math.max(24, h * opts.spread);\n    render();\n  }\n  function run() { if (!raf) { last = performance.now(); raf = requestAnimationFrame(tick); } }\n  function tick(t) {\n    raf = 0;\n    var dt = Math.min(0.05, (t - last) / 1000); last = t;\n    if (target !== null && !drag) {\n      pos += (target - pos) * (1 - Math.exp(-dt * 11));\n      if (Math.abs(target - pos) < 0.0008) { pos = target; target = null; }\n    }\n    render();\n    if (target !== null || drag) run();\n  }\n  function release() {\n    clearTimeout(idle); idle = 0;\n    if (reduce) { pos = Math.round(pos); render(); return; }\n    target = Math.round(pos + Math.max(-3, Math.min(3, vel)) * 0.25);\n    vel = 0;\n    run();\n  }\n  function goTo(t) {\n    if (reduce) { pos = t; target = null; render(); return; }\n    target = t; run();\n  }\n  function onWheel(e) {\n    e.preventDefault();\n    var dy = e.deltaY * (e.deltaMode === 1 ? 32 : e.deltaMode === 2 ? 400 : 1);\n    if (reduce) {\n      acc += dy;\n      if (Math.abs(acc) >= 80) { pos = Math.round(pos) + (acc > 0 ? 1 : -1); acc = 0; render(); }\n      return;\n    }\n    var dp = dy / 260 * opts.sensitivity;\n    pos += dp; vel = dp * 8; target = null;\n    run();\n    clearTimeout(idle);\n    idle = setTimeout(release, 110);\n  }\n  function onDown(e) {\n    if (e.pointerType === \"mouse\" && e.button !== 0) return;\n    drag = { y: e.clientY, t: performance.now(), moved: 0, total: 0, id: e.pointerId };\n    try { wrap.setPointerCapture(e.pointerId); } catch (x) {}\n    wrap.classList.add(\"is-drag\");\n    target = null; vel = 0;\n  }\n  function onMove(e) {\n    if (!drag || e.pointerId !== drag.id) return;\n    var dy = e.clientY - drag.y, now = performance.now(), dtm = Math.max(1, now - drag.t);\n    drag.y = e.clientY; drag.t = now; drag.moved += Math.abs(dy); drag.total += dy;\n    if (reduce) return;\n    var dp = -dy / step * opts.sensitivity;\n    pos += dp;\n    vel = vel * 0.6 + (dp / dtm * 1000) * 0.4;\n    run();\n  }\n  function onUp(e) {\n    if (!drag || e.pointerId !== drag.id) return;\n    var d = drag; drag = null;\n    wrap.classList.remove(\"is-drag\");\n    try { wrap.releasePointerCapture(e.pointerId); } catch (x) {}\n    if (d.moved < 5 && e.type === \"pointerup\") {\n      var el = e.target && e.target.closest ? e.target.closest(\".ef-isc__card\") : null;\n      var i = el ? cards.indexOf(el) : -1;\n      if (i >= 0) { var dd = i - pos; dd -= cards.length * Math.round(dd / cards.length); goTo(Math.round(pos + dd)); return; }\n    }\n    if (reduce) {\n      if (Math.abs(d.total) > step / 3) pos = Math.round(pos) + (d.total < 0 ? 1 : -1);\n      render();\n      return;\n    }\n    release();\n  }\n  function onKey(e) {\n    var k = e.key, dir = 0;\n    if (k === \"ArrowDown\" || k === \"ArrowRight\") dir = 1;\n    else if (k === \"ArrowUp\" || k === \"ArrowLeft\") dir = -1;\n    else return;\n    e.preventDefault();\n    goTo(Math.round(target !== null ? target : pos) + dir);\n  }\n  function clear() {\n    offs.forEach(function (f) { f(); }); offs = [];\n    if (raf) cancelAnimationFrame(raf);\n    raf = 0;\n    clearTimeout(idle); idle = 0;\n  }\n  function build() {\n    stage.textContent = \"\";\n    cards = [];\n    for (var i = 0; i < opts.count; i++) {\n      var c = document.createElement(\"div\"); c.className = \"ef-isc__card\";\n      var bg = document.createElement(\"span\"); bg.className = \"ef-isc__art\"; bg.style.background = art(i, opts.accent);\n      var n = document.createElement(\"span\"); n.className = \"ef-isc__n\"; n.textContent = String(i + 1).padStart(2, \"0\");\n      var tx = document.createElement(\"span\"); tx.className = \"ef-isc__txt\";\n      var t = document.createElement(\"span\"); t.className = \"ef-isc__t\"; t.textContent = DATA[i % DATA.length][0];\n      var s = document.createElement(\"span\"); s.className = \"ef-isc__s\"; s.textContent = DATA[i % DATA.length][1];\n      tx.appendChild(t); tx.appendChild(s);\n      c.appendChild(bg); c.appendChild(n); c.appendChild(tx);\n      stage.appendChild(c); cards.push(c);\n    }\n    shown = -1;\n    pos = wrapIdx(Math.round(pos)); target = null;\n  }\n  function bind() {\n    wrap.addEventListener(\"wheel\", onWheel, { passive: false });\n    wrap.addEventListener(\"pointerdown\", onDown);\n    wrap.addEventListener(\"pointermove\", onMove);\n    wrap.addEventListener(\"pointerup\", onUp);\n    wrap.addEventListener(\"pointercancel\", onUp);\n    wrap.addEventListener(\"keydown\", onKey);\n    var ro = null, onR = function () { measure(); };\n    if (window.ResizeObserver) { ro = new ResizeObserver(onR); ro.observe(wrap); } else window.addEventListener(\"resize\", onR);\n    offs.push(function () {\n      wrap.removeEventListener(\"wheel\", onWheel); wrap.removeEventListener(\"pointerdown\", onDown);\n      wrap.removeEventListener(\"pointermove\", onMove); wrap.removeEventListener(\"pointerup\", onUp);\n      wrap.removeEventListener(\"pointercancel\", onUp); wrap.removeEventListener(\"keydown\", onKey);\n      if (ro) ro.disconnect(); else window.removeEventListener(\"resize\", onR);\n    });\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", count: 6, spread: 0.75, fade: 0.32, sensitivity: 1 }, opts, next || {});\n    opts.count = Math.max(3, Math.min(8, 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();\n    measure();\n  }\n  bind();\n  update(o);\n  return { update: update, destroy: function () { clear(); stage.textContent = \"\"; cards = []; } };\n}"
  }
}