{
  "id": "radial-arc-gallery",
  "kind": "element",
  "title": "Radial arc gallery",
  "summary": "Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.",
  "url": "https://enrichr.dev/elements/radial-arc-gallery.html",
  "section": "gallery",
  "techniques": [
    "carousel"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "cinematic",
    "modern"
  ],
  "intents": [
    "radial image carousel",
    "circular photo gallery",
    "rotating wheel of cards",
    "arc carousel with arrows",
    "autoplay photo wheel"
  ],
  "status": "tested",
  "params": [
    {
      "key": "interval",
      "label": "Autoplay every (s, 0 is off)",
      "type": "range",
      "min": 0,
      "max": 10,
      "step": 0.5,
      "value": 4
    },
    {
      "key": "duration",
      "label": "Turn time (s)",
      "type": "range",
      "min": 0.3,
      "max": 3,
      "step": 0.1,
      "value": 1.4
    },
    {
      "key": "radius",
      "label": "Wheel size (% of height)",
      "type": "range",
      "min": 20,
      "max": 50,
      "step": 1,
      "value": 35
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "accent",
      "label": "Accent (focus ring)",
      "type": "color",
      "value": "#e6ff55"
    }
  ],
  "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 \"Radial arc gallery\" element to this project.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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/radial-arc-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 \"Radial arc gallery\" 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 \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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 \"Radial arc gallery\" element to this codebase.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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-radial-arc-gallery.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Radial arc gallery 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 \"Radial arc gallery\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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- radial-arc-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 \"./radial-arc-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RadialArcGallery(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 \"Radial arc gallery\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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- radial-arc-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/RadialArcGallery.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./radial-arc-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RadialArcGallery(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 \"Radial arc gallery\" element.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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), radial-arc-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 \"Radial arc gallery\" element. No packages, no server code.\n\nThis is the \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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 radial-arc-gallery.js and then main.js), style.css (the CSS below), radial-arc-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 \"Radial arc gallery\" 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 \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-gallery.json\n\nWhat it does: Six 9:16 cards sit on a circle whose centre is below the middle of the box, so only the top of the wheel shows. One angle drives everything: each card's place is its slot angle plus that offset. The card's distance from the top sets its size (1.4 at the top, down to 0.3), its fade and its stacking order, and cards that fade to nothing are hidden. A turn tweens the offset by one slot over 1.4 seconds on a power2 in-out curve, the same curve GSAP uses, with plain requestAnimationFrame; the fade also eases through a short CSS transition. Autoplay turns it every 4 seconds. Clicking a card turns it to the top the short way round in 1 second. Card size follows the width of the box and the wheel follows its height.\nAccessibility: The gallery is a labelled carousel region. Previous and Next are real buttons with labels. The wheel itself takes focus, and Left, Right, Home and End turn it. The photo that reaches the top is announced in a polite live region, and the other cards are hidden from assistive technology. Autoplay pauses on hover and on focus and stops for good once you steer it. With prefers-reduced-motion there is no autoplay and each turn jumps straight to its place.\n\nTunable settings:\n- Autoplay every (s, 0 is off): range 0 to 10, step 0.5, default 4\n- Turn time (s): range 0.3 to 3, step 0.1, default 1.4\n- Wheel size (% of height): range 20 to 50, step 1, default 35\n- Background: color, default #0c1e18\n- Accent (focus ring): color, default #e6ff55\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/radial-arc-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 \"Radial arc gallery\" 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 \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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 RadialArcGallery.\n2. Paste the JavaScript below into a separate code file named radial-arc-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 \"./radial-arc-gallery\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function RadialArcGallery(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(RadialArcGallery, {\n  interval: { type: ControlType.Number, title: \"Autoplay every\", min: 0, max: 10, step: 0.5, defaultValue: 4 },\n  duration: { type: ControlType.Number, title: \"Turn time\", min: 0.3, max: 3, step: 0.1, defaultValue: 1.4 },\n  radius: { type: ControlType.Number, title: \"Wheel size\", min: 20, max: 50, step: 1, defaultValue: 35 },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\n  accent: { type: ControlType.Color, title: \"Accent (focus ring)\", defaultValue: \"#e6ff55\" },\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 \"Radial arc gallery\" 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 \"Radial arc gallery\" element from the Enrichr Library: Tall photo cards ride round the top of a big wheel, the one at the top large and bright, turning one step every few seconds or on demand.\nPage: https://enrichr.dev/elements/radial-arc-gallery.html\nMachine-readable spec: https://enrichr.dev/elements/radial-arc-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-radial-arc-gallery\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-radial-arc-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 gallery is a labelled carousel region. Previous and Next are real buttons with labels. The wheel itself takes focus, and Left, Right, Home and End turn it. The photo that reaches the top is announced in a polite live region, and the other cards are hidden from assistive technology. Autoplay pauses on hover and on focus and stops for good once you steer it. With prefers-reduced-motion there is no autoplay and each turn jumps straight to its place.",
  "performance": "A frame only writes a transform, an opacity and a z-index on six cards, so the browser composites the move without layout. The loop does nothing at rest except count autoplay time, and it pauses off screen and in hidden tabs. A ResizeObserver resizes the cards and the wheel when the box changes.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/OPprwrd",
  "source": {
    "markup": "<div class=\"ef-rag\" role=\"region\" aria-roledescription=\"carousel\" aria-label=\"Corgi photo wheel\">\n  <div class=\"ef-rag__stage\" tabindex=\"0\" aria-label=\"Photo wheel. Use the left and right arrow keys to turn it.\">\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-1.jpg\" alt=\"Corgi puppy with huge ears on an orange backdrop\" draggable=\"false\"></figure>\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-2.jpg\" alt=\"Smiling corgi in a field of purple and orange pansies\" draggable=\"false\"></figure>\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-3.jpg\" alt=\"Corgi standing on a rock in front of autumn leaves\" draggable=\"false\"></figure>\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-4.jpg\" alt=\"Corgi running down a dirt road at sunset\" style=\"object-position: 18% 50%\" draggable=\"false\"></figure>\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-5.jpg\" alt=\"Corgi resting its chin on the floor of a white studio\" style=\"object-position: 68% 50%\" draggable=\"false\"></figure>\n    <figure class=\"ef-rag__card\"><img class=\"ef-rag__img\" src=\"/img/library/corgi-6.jpg\" alt=\"Corgi with its tongue out in a white studio\" style=\"object-position: 48% 50%\" draggable=\"false\"></figure>\n  </div>\n  <button type=\"button\" class=\"ef-rag__btn ef-rag__prev\" aria-label=\"Previous photo\"><svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><polyline points=\"15 18 9 12 15 6\"/></svg></button>\n  <button type=\"button\" class=\"ef-rag__btn ef-rag__next\" aria-label=\"Next photo\"><svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><polyline points=\"9 18 15 12 9 6\"/></svg></button>\n  <p class=\"ef-rag__live\" aria-live=\"polite\" aria-atomic=\"true\"></p>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-rag { --ef-rag-bg: #0c1e18; --ef-rag-ink: #fbf8f1; --ef-rag-acc: #e6ff55; position: relative; box-sizing: border-box; width: 100%; height: 100%; min-height: 30rem; flex: 1 1 auto; overflow: hidden; border-radius: 1rem; background: var(--ef-rag-bg); color: var(--ef-rag-ink); font-family: \"Instrument Sans\", system-ui, sans-serif; }\n.ef-rag .ef-rag__stage { position: absolute; inset: 0; overflow: hidden; outline: none; border-radius: inherit; touch-action: pan-y; }\n.ef-rag .ef-rag__stage:focus-visible { box-shadow: inset 0 0 0 3px var(--ef-rag-acc); }\n.ef-rag .ef-rag__card { position: absolute; left: 0; top: 0; margin: 0; width: 192px; height: 341px; border-radius: 1.5rem; overflow: hidden; background: color-mix(in srgb, var(--ef-rag-ink) 7%, var(--ef-rag-bg)); cursor: pointer; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6); transform-origin: center center; transition: opacity 0.3s ease; will-change: transform, opacity; }\n.ef-rag .ef-rag__img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }\n.ef-rag .ef-rag__btn { position: absolute; top: 50%; z-index: 200; display: grid; place-items: center; box-sizing: content-box; width: 24px; height: 24px; margin: 0; padding: 1rem; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ef-rag-ink) 10%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--ef-rag-ink); cursor: pointer; transform: translateY(-50%); transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); }\n.ef-rag .ef-rag__prev { left: 2rem; }\n.ef-rag .ef-rag__next { right: 2rem; }\n.ef-rag .ef-rag__btn:hover { background: color-mix(in srgb, var(--ef-rag-ink) 20%, transparent); }\n.ef-rag .ef-rag__btn:focus-visible { outline: 3px solid var(--ef-rag-acc); outline-offset: 3px; }\n.ef-rag .ef-rag__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }\n.ef-rag .ef-rag__live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }\n.ef-rag.is-narrow .ef-rag__prev { left: 0.75rem; }\n.ef-rag.is-narrow .ef-rag__next { right: 0.75rem; }\n.ef-rag.is-narrow .ef-rag__btn { padding: 0.75rem; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Radial arc gallery: tall 9:16 photo cards sit on a big wheel whose centre is near the bottom of the box, so only the top\n// of the wheel shows. One angle drives everything: each card's place on the circle is its slot angle plus that offset, and\n// its distance from the top (measured the same way as the original pen) sets its size (1.4 at the top, down to 0.3), its\n// fade and its stacking. Turning tweens the offset by one slot on a power2 in-out curve (1.4 s), every 4 s on autoplay;\n// a click on a card turns it to the top in 1 s. Cards that fade to nothing are hidden. Prev and Next buttons, the arrow keys,\n// Home and End also turn it; the photo now on top is announced. Autoplay pauses on hover, on focus, off screen and in hidden\n// tabs, and stops for good once you steer it yourself. Reduced motion: no autoplay, and each turn jumps without a tween.\n// mount(root, { interval (autoplay seconds, 0 is off), duration (seconds per turn), radius (% of the box height),\n//               background, accent })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var box = root.querySelector(\".ef-rag\");\n  var stage = root.querySelector(\".ef-rag__stage\");\n  var cards = [].slice.call(root.querySelectorAll(\".ef-rag__card\"));\n  var prev = root.querySelector(\".ef-rag__prev\"), next = root.querySelector(\".ef-rag__next\");\n  var live = root.querySelector(\".ef-rag__live\");\n  var n = Math.max(1, cards.length), TAU = Math.PI * 2, STEP = TAU / n, TOP = -Math.PI / 2;\n  var opts = {}, angle = TOP, target = TOP, tw = null, raf = 0, last = 0, auto = 0;\n  var stopped = false, hover = false, focused = false, visible = true, destroyed = false;\n  var W = 1, H = 1, cw = 192, ch = 341, R = 252, cy = 0;\n  var io = null, ro = null, offs = [];\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  // GSAP power2.inOut (a cubic curve)\n  function ease(p) { return p < 0.5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2; }\n\n  function place() {\n    for (var i = 0; i < cards.length; i++) {\n      var a = i * STEP + angle;\n      var x = Math.cos(a) * R, y = Math.sin(a) * R;\n      // the pen's own angle maths: wrap to (-PI, PI], then distance from the top\n      var nm = a % TAU;\n      if (nm > Math.PI) nm -= TAU;\n      if (nm < -Math.PI) nm += TAU;\n      var dist = Math.abs(nm - TOP);\n      var s = Math.max(0.3, 1.4 - dist / (Math.PI / 1.5));\n      var op = Math.max(0, 1 - dist / (Math.PI / 1.2));\n      var st = cards[i].style;\n      st.transform = \"translate3d(\" + (W / 2 + x - cw / 2).toFixed(2) + \"px,\" + (cy + y - ch / 2).toFixed(2) + \"px,0) scale(\" + s.toFixed(4) + \")\";\n      st.opacity = op.toFixed(4);\n      st.zIndex = String(Math.floor(100 - dist * 20));\n      st.display = op > 0 ? \"block\" : \"none\";\n    }\n  }\n  function current() { return ((Math.round((TOP - target) / STEP) % n) + n) % n; }\n  function mark(say) {\n    var c = current();\n    cards.forEach(function (card, i) {\n      card.setAttribute(\"role\", \"group\");\n      card.setAttribute(\"aria-roledescription\", \"slide\");\n      card.setAttribute(\"aria-label\", (i + 1) + \" of \" + n);\n      if (i === c) card.removeAttribute(\"aria-hidden\"); else card.setAttribute(\"aria-hidden\", \"true\");\n    });\n    if (say) {\n      var img = cards[c] && cards[c].querySelector(\"img\");\n      live.textContent = \"Photo \" + (c + 1) + \" of \" + n + (img && img.alt ? \": \" + img.alt : \"\");\n    }\n  }\n  function go(to, dur, say) {\n    target = to;\n    if (reduce || dur <= 0) { tw = null; angle = to; place(); }\n    else tw = { from: angle, to: to, t: 0, d: dur };\n    mark(say);\n  }\n  // dir 1 turns the wheel clockwise (the card on the left comes up), -1 anticlockwise (the card on the right comes up)\n  function turn(dir, user) {\n    if (user) { stopped = true; auto = 0; }\n    go(target + STEP * dir, opts.duration, user);\n  }\n  function toCard(i, user) {\n    if (user) { stopped = true; auto = 0; }\n    var base = TOP - i * STEP, k = Math.round((target - base) / TAU); // nearest way round\n    go(base + k * TAU, 1, user);\n  }\n\n  function loop(now) {\n    raf = requestAnimationFrame(loop);\n    var dt = Math.min(0.1, (now - last) / 1000 || 0); last = now;\n    if (!visible || document.hidden) return;\n    if (tw) {\n      tw.t += dt;\n      var p = Math.min(1, tw.t / tw.d);\n      angle = tw.from + (tw.to - tw.from) * ease(p);\n      place();\n      if (p >= 1) tw = null;\n    }\n    if (!reduce && opts.interval > 0 && !stopped && !hover && !focused) {\n      auto += dt;\n      if (auto >= opts.interval) { auto = 0; turn(1, false); }\n    }\n  }\n\n  function size() {\n    W = Math.max(1, box.clientWidth); H = Math.max(1, box.clientHeight);\n    // card: clamp(140px, 15vw, 220px) of the box width, kept short enough for the box height; 9:16\n    cw = Math.min(Math.min(220, Math.max(140, W * 0.15)), H * 0.27); ch = cw * 16 / 9;\n    R = Math.min(400, H * opts.radius / 100);\n    // the circle centre: same place as in the pen (it sits low, so the top card is lifted by 0.8 of the radius)\n    cy = H + R * 0.2 - cw * 1.77 / 4;\n    cards.forEach(function (c) { c.style.width = cw.toFixed(2) + \"px\"; c.style.height = ch.toFixed(2) + \"px\"; });\n    box.classList.toggle(\"is-narrow\", W < 560);\n    place();\n  }\n\n  function onKey(e) {\n    var k = e.key;\n    if (k === \"ArrowRight\") { e.preventDefault(); turn(-1, true); }\n    else if (k === \"ArrowLeft\") { e.preventDefault(); turn(1, true); }\n    else if (k === \"Home\") { e.preventDefault(); toCard(0, true); }\n    else if (k === \"End\") { e.preventDefault(); toCard(n - 1, true); }\n  }\n  function onNext() { turn(-1, true); }\n  function onPrev() { turn(1, true); }\n  function onEnter(e) { if (e.pointerType === \"mouse\") hover = true; }\n  function onLeave() { hover = false; }\n  function onFocusIn() { focused = true; }\n  function onFocusOut(e) { if (!box.contains(e.relatedTarget)) focused = false; }\n  cards.forEach(function (card, i) {\n    function onClick() { toCard(i, true); }\n    card.addEventListener(\"click\", onClick);\n    offs.push(function () { card.removeEventListener(\"click\", onClick); });\n  });\n  box.addEventListener(\"keydown\", onKey);\n  next.addEventListener(\"click\", onNext);\n  prev.addEventListener(\"click\", onPrev);\n  box.addEventListener(\"pointerenter\", onEnter);\n  box.addEventListener(\"pointerleave\", onLeave);\n  box.addEventListener(\"focusin\", onFocusIn);\n  box.addEventListener(\"focusout\", onFocusOut);\n  offs.push(function () {\n    box.removeEventListener(\"keydown\", onKey); next.removeEventListener(\"click\", onNext); prev.removeEventListener(\"click\", onPrev);\n    box.removeEventListener(\"pointerenter\", onEnter); box.removeEventListener(\"pointerleave\", onLeave);\n    box.removeEventListener(\"focusin\", onFocusIn); box.removeEventListener(\"focusout\", onFocusOut);\n  });\n\n  function update(partial) {\n    opts = Object.assign({ interval: 4, duration: 1.4, radius: 35, background: \"#0c1e18\", accent: \"#e6ff55\" }, opts, partial || {});\n    opts.interval = Math.max(0, num(opts.interval, 4));\n    opts.duration = Math.max(0.1, num(opts.duration, 1.4));\n    opts.radius = Math.min(60, Math.max(10, num(opts.radius, 35)));\n    box.style.setProperty(\"--ef-rag-bg\", opts.background);\n    box.style.setProperty(\"--ef-rag-acc\", opts.accent);\n    if (destroyed) return;\n    size();\n  }\n\n  update(o);\n  mark(false);\n  if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(box); }\n  if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) size(); }); ro.observe(box); }\n  last = performance.now(); raf = requestAnimationFrame(loop);\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf);\n      offs.forEach(function (f) { f(); }); offs = [];\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n    }\n  };\n}"
  }
}