{
  "id": "blur-title-slider",
  "kind": "element",
  "title": "Blur title slider",
  "summary": "A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.",
  "url": "https://enrichr.dev/elements/blur-title-slider.html",
  "section": "gallery",
  "techniques": [
    "carousel",
    "text-animation",
    "stagger",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "editorial",
    "fluid"
  ],
  "intents": [
    "image slider with blurred neighbours",
    "big title slider animation",
    "vertical photo carousel with text roll",
    "fullscreen gallery slider",
    "slider with custom cursor ring"
  ],
  "status": "tested",
  "params": [
    {
      "key": "titles",
      "label": "Slide titles (comma separated)",
      "type": "text",
      "value": "Bloom, Ember, Trail, Rest"
    },
    {
      "key": "delay",
      "label": "Autoplay delay (s, 0 is off)",
      "type": "range",
      "min": 0,
      "max": 10,
      "step": 0.5,
      "value": 4
    },
    {
      "key": "duration",
      "label": "Slide duration (s)",
      "type": "range",
      "min": 0.4,
      "max": 3,
      "step": 0.1,
      "value": 1.2
    },
    {
      "key": "label",
      "label": "Corner label",
      "type": "text",
      "value": "Enrichr Library — Nr. 02"
    },
    {
      "key": "colour1",
      "label": "Slide 1 background",
      "type": "color",
      "value": "#126e45"
    },
    {
      "key": "colour2",
      "label": "Slide 2 background",
      "type": "color",
      "value": "#e54c1e"
    },
    {
      "key": "colour3",
      "label": "Slide 3 background",
      "type": "color",
      "value": "#085e3d"
    },
    {
      "key": "colour4",
      "label": "Slide 4 background",
      "type": "color",
      "value": "#005236"
    },
    {
      "key": "ink",
      "label": "Text",
      "type": "color",
      "value": "#fbf8f1"
    }
  ],
  "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 \"Blur title slider\" element to this project.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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/blur-title-slider.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 \"Blur title slider\" 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 \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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 \"Blur title slider\" element to this codebase.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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-blur-title-slider.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Blur title slider 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 \"Blur title slider\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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- blur-title-slider.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 \"./blur-title-slider\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function BlurTitleSlider(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 \"Blur title slider\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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- blur-title-slider.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/BlurTitleSlider.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./blur-title-slider\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function BlurTitleSlider(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 \"Blur title slider\" element.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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), blur-title-slider.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 \"Blur title slider\" element. No packages, no server code.\n\nThis is the \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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 blur-title-slider.js and then main.js), style.css (the CSS below), blur-title-slider.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 \"Blur title slider\" 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 \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.json\n\nWhat it does: Three photos are on stage at once, each in one of five fixed spots measured from the height of the photo area: hidden above, tilted and blurred above, sharp in the middle, small and blurred below, hidden below. Every spot sets x, y, turn, scale, blur and opacity. On a change a new photo enters at the hidden spot on the side it comes from, every photo moves one spot along over 1.2 seconds on a power3 in-out curve, and the photo that falls into a hidden spot is removed. At the same moment the background colour blends to the next slide's colour on a power2 in-out curve, and the title letters roll: the old ones slide up and out, the new ones slide up from below, each 0.04 seconds after the one before, over 1 second on an expo in-out curve. A ring with a plus follows the pointer; each move starts a new 0.5 second power3 glide from where it is, as gsap.quickTo does. Wheel, swipe and the arrow keys change slides (wheel and swipe at most once every 1.8 seconds), a click goes forward, and it advances on its own every 4 seconds.\nAccessibility: The slider is a focusable region with a label that explains the arrow keys; a hidden live region announces each new slide by number and title. The title is one aria-label while its letter spans are hidden, and the photos are decorative. Autoplay stops while the slider has keyboard focus, off screen and in hidden tabs. With prefers-reduced-motion slides change instantly and autoplay is off.\n\nTunable settings:\n- Slide titles (comma separated): text, default Bloom, Ember, Trail, Rest\n- Autoplay delay (s, 0 is off): range 0 to 10, step 0.5, default 4\n- Slide duration (s): range 0.4 to 3, step 0.1, default 1.2\n- Corner label: text, default Enrichr Library — Nr. 02\n- Slide 1 background: color, default #126e45\n- Slide 2 background: color, default #e54c1e\n- Slide 3 background: color, default #085e3d\n- Slide 4 background: color, default #005236\n- Text: color, default #fbf8f1\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/blur-title-slider.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 \"Blur title slider\" 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 \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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 BlurTitleSlider.\n2. Paste the JavaScript below into a separate code file named blur-title-slider.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 \"./blur-title-slider\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function BlurTitleSlider(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(BlurTitleSlider, {\n  titles: { type: ControlType.String, title: \"Slide titles (comma separated)\", defaultValue: \"Bloom, Ember, Trail, Rest\" },\n  delay: { type: ControlType.Number, title: \"Autoplay delay\", min: 0, max: 10, step: 0.5, defaultValue: 4 },\n  duration: { type: ControlType.Number, title: \"Slide duration\", min: 0.4, max: 3, step: 0.1, defaultValue: 1.2 },\n  label: { type: ControlType.String, title: \"Corner label\", defaultValue: \"Enrichr Library — Nr. 02\" },\n  colour1: { type: ControlType.Color, title: \"Slide 1 background\", defaultValue: \"#126e45\" },\n  colour2: { type: ControlType.Color, title: \"Slide 2 background\", defaultValue: \"#e54c1e\" },\n  colour3: { type: ControlType.Color, title: \"Slide 3 background\", defaultValue: \"#085e3d\" },\n  colour4: { type: ControlType.Color, title: \"Slide 4 background\", defaultValue: \"#005236\" },\n  ink: { type: ControlType.Color, title: \"Text\", defaultValue: \"#fbf8f1\" },\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 \"Blur title slider\" 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 \"Blur title slider\" element from the Enrichr Library: A big title and a column of tilted, blurred photos that slide one place along a curve on each change, while the title letters roll over and the background colour blends.\nPage: https://enrichr.dev/elements/blur-title-slider.html\nMachine-readable spec: https://enrichr.dev/elements/blur-title-slider.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-blur-title-slider\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-blur-title-slider\"), { ...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 slider is a focusable region with a label that explains the arrow keys; a hidden live region announces each new slide by number and title. The title is one aria-label while its letter spans are hidden, and the photos are decorative. Autoplay stops while the slider has keyboard focus, off screen and in hidden tabs. With prefers-reduced-motion slides change instantly and autoplay is off.",
  "performance": "Moving a photo is a transform, an opacity and a blur filter on one element; at most four photos exist at a time. The blur is the expensive part, so only three photos carry it and only during a change or at rest in their spot. Nothing runs between changes except the pointer ring.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/LEWMBgz",
  "source": {
    "markup": "<div class=\"ef-bts\" tabindex=\"0\" role=\"region\" aria-roledescription=\"carousel\" aria-label=\"Photo slider. Use the arrow keys, scroll or click to change the slide\">\n  <div class=\"ef-bts__header\">\n    <span class=\"ef-bts__mark\" aria-hidden=\"true\"><svg viewBox=\"0 0 50 50\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m34.213 25.361 c0 2.655 1.381 4.808 3.086 4.808 0.781 0 1.494 -0.452 2.038 -1.198 0.267 -0.366 0.688 -0.589 1.142 -0.589 h0.054 c0.774 0 1.401 0.627 1.401 1.401 v10.65 h-10.651 c-0.774 0 -1.401 0.627 -1.401 1.401 v0.054 c0 0.453 0.222 0.874 0.589 1.141 0.746 0.544 1.198 1.257 1.198 2.038 0 1.705 -2.152 3.086 -4.808 3.086 -2.655 0 -4.808 -1.381 -4.808 -3.086 0 -0.781 0.452 -1.494 1.198 -2.038 0.366 -0.267 0.589 -0.688 0.589 -1.142 v-0.054 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-10.65 v-10.651 c0 -0.774 -0.627 -1.401 -1.401 -1.401 h-0.054 c-0.453 0 -0.875 0.222 -1.142 0.589 -0.543 0.746 -1.257 1.198 -2.038 1.198 -1.705 0 -3.086 -2.152 -3.086 -4.808 0 -2.655 1.381 -4.808 3.086 -4.808 0.781 0 1.495 0.452 2.038 1.198 0.267 0.366 0.688 0.589 1.141 0.589 h0.054 c0.774 0 1.401 -0.627 1.401 -1.401 v-10.65 h10.65 c0.774 0 1.401 -0.627 1.401 -1.401 v-0.054 c0 -0.453 -0.222 -0.875 -0.589 -1.142 -0.746 -0.543 -1.198 -1.257 -1.198 -2.038 0 -1.705 2.152 -3.086 4.808 -3.086 2.655 0 4.808 1.381 4.808 3.086 0 0.781 -0.452 1.495 -1.198 2.038 -0.366 0.267 -0.589 0.688 -0.589 1.141 v0.054 c0 0.774 0.627 1.401 1.401 1.401 h10.65 v10.65 c0 0.774 -0.627 1.401 -1.401 1.401 h-0.053 c-0.453 0 -0.874 -0.222 -1.141 -0.589 -0.544 -0.746 -1.257 -1.198 -2.038 -1.198 -1.705 0 -3.086 2.152 -3.086 4.808 z\"/></svg></span>\n    <span class=\"ef-bts__label\"></span>\n  </div>\n  <div class=\"ef-bts__body\">\n    <div class=\"ef-bts__left\">\n      <h2 class=\"ef-bts__title\"></h2>\n      <div class=\"ef-bts__footer\">\n        <p class=\"ef-bts__desc\">A Library element<br>by Enrichr — motion<br>for the web</p>\n        <p class=\"ef-bts__loc\">Built in plain JavaScript<br>and curiosity.</p>\n      </div>\n    </div>\n    <div class=\"ef-bts__right\"><div class=\"ef-bts__images\"></div></div>\n  </div>\n  <p class=\"ef-bts__live\" aria-live=\"polite\"></p>\n  <div class=\"ef-bts__cursor\" aria-hidden=\"true\">+</div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-bts { --ef-bts-ink: #fbf8f1; position: relative; flex: 1 0 auto; width: 100%; height: 100%; min-height: 30rem; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; border-radius: 1rem; background: #005236; color: var(--ef-bts-ink); font-family: \"Instrument Sans\", system-ui, sans-serif; -webkit-font-smoothing: antialiased; container-type: inline-size; outline: none; touch-action: pan-y; }\n.ef-bts:focus-visible { box-shadow: inset 0 0 0 3px #e6ff55; }\n@media (pointer: fine) { .ef-bts { cursor: none; } }\n.ef-bts *, .ef-bts *::before, .ef-bts *::after { box-sizing: border-box; }\n.ef-bts__header { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; flex-shrink: 0; }\n.ef-bts__mark { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ef-bts-ink) 40%, transparent); color: color-mix(in srgb, var(--ef-bts-ink) 80%, transparent); }\n.ef-bts__mark svg { width: 22px; height: 22px; display: block; }\n.ef-bts__label { display: none; font-size: 11px; letter-spacing: 1.5px; color: color-mix(in srgb, var(--ef-bts-ink) 70%, transparent); text-transform: uppercase; }\n.ef-bts__body { flex: 1; display: flex; flex-direction: column; padding: 0 32px 40px; min-height: 0; position: relative; }\n.ef-bts__left { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; z-index: 4; }\n.ef-bts .ef-bts__title { margin: auto 0; padding: 0; font-family: \"Parkinsans\", \"Space Grotesk\", sans-serif; font-size: clamp(4rem, 15cqi, 12.5rem); font-weight: 700; color: var(--ef-bts-ink); opacity: 1; line-height: 1.15; letter-spacing: -0.02em; overflow: hidden; position: relative; white-space: nowrap; text-transform: none; }\n.ef-bts__line { white-space: nowrap; }\n.ef-bts__ch { display: inline-block; will-change: transform; }\n.ef-bts__footer { flex-shrink: 0; margin-top: 32px; }\n.ef-bts .ef-bts__desc, .ef-bts .ef-bts__loc { margin: 0; font-size: 10px; letter-spacing: 1.2px; color: var(--ef-bts-ink); opacity: 0.6; line-height: 1.6; text-transform: uppercase; max-width: none; }\n.ef-bts .ef-bts__loc { margin-top: 12px; }\n.ef-bts__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-bts__cursor { position: absolute; top: 0; left: 0; width: 80px; height: 80px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ef-bts-ink) 30%, transparent); display: flex; align-items: center; justify-content: center; pointer-events: none; will-change: transform; z-index: 10; color: color-mix(in srgb, var(--ef-bts-ink) 60%, transparent); font-size: 24px; font-weight: 400; line-height: 1; opacity: 0; }\n.ef-bts__right { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; pointer-events: none; }\n.ef-bts__images { position: absolute; inset: 0; }\n.ef-bts__slide { position: absolute; top: 50%; left: 50%; width: 55%; aspect-ratio: 1.4; overflow: hidden; will-change: transform, filter, opacity; contain: layout style; }\n.ef-bts__slide img { display: block; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.9); }\n@container (min-width: 768px) {\n  .ef-bts__header { padding: 40px 56px; }\n  .ef-bts__label { display: flex; }\n  .ef-bts__body { padding: 0 56px 56px; }\n  .ef-bts__footer { margin-top: 48px; }\n  .ef-bts__slide { width: 60%; }\n  .ef-bts__cursor { width: 88px; height: 88px; }\n}\n@container (min-width: 1024px) {\n  .ef-bts__body { flex-direction: row; }\n  .ef-bts__left { width: 55%; flex-shrink: 0; z-index: auto; }\n  .ef-bts__right { position: relative; top: auto; left: auto; width: auto; height: auto; flex: 1; min-height: 0; pointer-events: auto; }\n  .ef-bts__slide { width: 68%; }\n}\n@media (prefers-reduced-motion: reduce) { .ef-bts__slide, .ef-bts__ch { will-change: auto; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Blur title slider: a big title and a column of three photos. The photo in front is sharp; the ones above and below are\n// tilted, scaled and blurred. On each change the photos slide one place along five fixed spots (x, y, turn, scale, blur and\n// opacity per spot) over 1.2 s on a power3 in-out curve, a new photo enters from the hidden spot, the background colour\n// blends over 1.2 s, and the title letters roll out and the new ones roll in, 0.04 s apart, on an expo in-out curve.\n// It advances every 4 s on its own, and on the mouse wheel, a swipe, a click or the arrow keys. A round \"+\" ring follows\n// the pointer with a 0.5 s power3 lag. Reduced motion swaps slides instantly and turns autoplay off. Autoplay stops off\n// screen, in hidden tabs and while the slider has keyboard focus.\n// mount(root, { titles (comma separated, one per photo), delay (autoplay seconds, 0 = off), duration (seconds), label,\n//               colour1, colour2, colour3, colour4 (background per slide, repeating), ink (text colour) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var el = root.querySelector(\".ef-bts\");\n  var titleEl = root.querySelector(\".ef-bts__title\");\n  var imagesEl = root.querySelector(\".ef-bts__images\");\n  var labelEl = root.querySelector(\".ef-bts__label\");\n  var liveEl = root.querySelector(\".ef-bts__live\");\n  var cursorEl = root.querySelector(\".ef-bts__cursor\");\n  var PHOTOS = [\"/img/library/corgi-2.jpg\", \"/img/library/corgi-1.jpg\", \"/img/library/corgi-3.jpg\", \"/img/library/corgi-4.jpg\", \"/img/library/corgi-6.jpg\", \"/img/library/corgi-5.jpg\"];\n  // The five spots a photo can sit in, from the hidden one above to the hidden one below (from the original pen).\n  var SPOTS = [\n    { x: -0.35, y: -0.95, rot: -30, s: 1.35, b: 16, o: 0 },\n    { x: -0.18, y: -0.5, rot: -15, s: 1.15, b: 8, o: 0.55 },\n    { x: 0, y: 0, rot: 0, s: 1, b: 0, o: 1 },\n    { x: -0.06, y: 0.5, rot: 15, s: 0.75, b: 6, o: 0.55 },\n    { x: -0.12, y: 0.95, rot: 30, s: 0.55, b: 14, o: 0 }\n  ];\n  var opts = {}, slides = [], current = 0, animating = false, slideEls = [], currentLine = null, bg = [0, 82, 54];\n  var tweens = [], raf = 0, autoId = 0, visible = true, focused = false, destroyed = false, io = null, ro = null, offs = [];\n  var lastWheel = -1e9, lastTouch = -1e9, touchX = 0, touchY = 0;\n  var cur = { x: 0, y: 0, fx: 0, fy: 0, tx: 0, ty: 0, t0: 0, on: false, op: 0, opFrom: 0, opTo: 0, opT0: 0, placed: false };\n\n  // GSAP eases, written out\n  function power(n, p, kind) { return kind === \"in\" ? Math.pow(p, n) : kind === \"out\" ? 1 - Math.pow(1 - p, n) : p < 0.5 ? Math.pow(2 * p, n) / 2 : 1 - Math.pow(2 * (1 - p), n) / 2; }\n  function p3io(p) { return power(4, p, \"inout\"); } // power3.inOut\n  function p2io(p) { return power(3, p, \"inout\"); } // power2.inOut\n  function p3o(p) { return power(4, p, \"out\"); }    // power3.out\n  function p1o(p) { return power(2, p, \"out\"); }    // power1.out, GSAP's default\n  function expoIn(p) { return p ? Math.pow(2, 10 * (p - 1)) : 0; }\n  function expoIO(p) { return p < 0.5 ? expoIn(p * 2) / 2 : 1 - expoIn((1 - p) * 2) / 2; }\n  function hex(h, d) { var m = /^#?([0-9a-f]{6})$/i.exec(h || \"\"); var v = parseInt(m ? m[1] : d, 16); return [v >> 16, (v >> 8) & 255, v & 255]; }\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function mod(n) { var t = slides.length; return (n % t + t) % t; }\n  function now() { return performance.now(); }\n\n  // a tiny tween runner: each tween calls f(eased progress) from its start time until it ends\n  function tween(dur, delay, ease, f, done) {\n    var t = { s: now() + delay * 1000, d: Math.max(1, dur * 1000), e: ease, f: f, done: done };\n    tweens.push(t); kick(); return t;\n  }\n  function kick() { if (!raf && !destroyed) raf = requestAnimationFrame(tick); }\n  function tick() {\n    raf = 0;\n    var n = now(), list = tweens.slice();\n    for (var i = 0; i < list.length; i++) {\n      var t = list[i];\n      if (n < t.s) continue;\n      var p = Math.min(1, (n - t.s) / t.d);\n      t.f(t.e(p));\n      if (p >= 1) { tweens.splice(tweens.indexOf(t), 1); if (t.done) t.done(); }\n    }\n    var moving = cursorStep(n);\n    if (tweens.length || moving) kick();\n  }\n\n  // pointer ring: every move starts a fresh 0.5 s power3.out glide from where the ring is (gsap.quickTo)\n  function cursorStep(n) {\n    if (!cur.placed) return false;\n    var p = Math.min(1, (n - cur.t0) / 500), e = p3o(p);\n    cur.x = cur.fx + (cur.tx - cur.fx) * e; cur.y = cur.fy + (cur.ty - cur.fy) * e;\n    var q = Math.min(1, (n - cur.opT0) / 300);\n    cur.op = cur.opFrom + (cur.opTo - cur.opFrom) * p1o(q);\n    cursorEl.style.transform = \"translate(\" + cur.x.toFixed(1) + \"px,\" + cur.y.toFixed(1) + \"px) translate(-50%,-50%)\";\n    cursorEl.style.opacity = cur.op.toFixed(3);\n    return p < 1 || q < 1;\n  }\n  function fadeCursor(to) { cur.opFrom = cur.op; cur.opTo = to; cur.opT0 = now(); }\n  function onMove(e) {\n    if (e.pointerType && e.pointerType !== \"mouse\") return;\n    var r = el.getBoundingClientRect(), x = e.clientX - r.left, y = e.clientY - r.top;\n    if (!cur.placed) { cur.x = x; cur.y = y; cur.placed = true; }\n    if (!cur.on) { cur.on = true; fadeCursor(1); }\n    cur.fx = cur.x; cur.fy = cur.y; cur.tx = x; cur.ty = y; cur.t0 = now();\n    if (reduce) { cur.fx = cur.x = x; cur.fy = cur.y = y; }\n    kick();\n  }\n  function onLeave() { if (cur.on) { cur.on = false; fadeCursor(0); kick(); } }\n\n  function chars(text) {\n    var line = document.createElement(\"div\"); line.className = \"ef-bts__line\"; line.setAttribute(\"aria-hidden\", \"true\");\n    Array.prototype.forEach.call(text, function (ch) {\n      var s = document.createElement(\"span\"); s.className = \"ef-bts__ch\"; s.textContent = ch === \" \" ? \" \" : ch; line.appendChild(s);\n    });\n    return line;\n  }\n  function setTitle(text) {\n    titleEl.textContent = \"\"; titleEl.style.height = \"\";\n    currentLine = chars(text); titleEl.appendChild(currentLine);\n    titleEl.setAttribute(\"aria-label\", text);\n  }\n  function announce(i) { liveEl.textContent = \"Slide \" + (i + 1) + \" of \" + slides.length + \": \" + slides[i].name; }\n\n  function animateTitle(text, dir, dur, stagger) {\n    var h = titleEl.offsetHeight, oldLine = currentLine, oldChars = [].slice.call(oldLine.children);\n    titleEl.style.height = h + \"px\";\n    oldLine.style.cssText = \"position:absolute;top:0;left:0;width:100%\";\n    var newLine = chars(text); newLine.style.cssText = \"position:absolute;top:0;left:0;width:100%\";\n    titleEl.appendChild(newLine); titleEl.setAttribute(\"aria-label\", text);\n    var newChars = [].slice.call(newLine.children);\n    newChars.forEach(function (c) { c.style.transform = \"translateY(\" + h * dir + \"px)\"; });\n    var count = Math.max(oldChars.length, newChars.length), left = oldChars.length + newChars.length;\n    function fin() {\n      if (--left > 0) return;\n      oldLine.remove(); newLine.style.cssText = \"\";\n      newChars.forEach(function (c) { c.style.transform = \"\"; });\n      titleEl.style.height = \"\"; currentLine = newLine;\n    }\n    oldChars.forEach(function (c, i) { tween(dur, i * stagger, expoIO, function (e) { c.style.transform = \"translateY(\" + (-h * dir * e).toFixed(2) + \"px)\"; }, fin); });\n    newChars.forEach(function (c, i) { tween(dur, i * stagger, expoIO, function (e) { c.style.transform = \"translateY(\" + (h * dir * (1 - e)).toFixed(2) + \"px)\"; }, fin); });\n    if (!left) fin();\n    return dur + Math.max(0, count - 1) * stagger;\n  }\n\n  function props(step) {\n    var h = imagesEl.offsetHeight, a = Math.abs(step), p = SPOTS[Math.max(0, Math.min(4, step + 2))];\n    return { x: p.x * h, y: p.y * h, rot: p.rot, s: p.s, b: p.b, o: p.o, z: a === 0 ? 3 : a === 1 ? 2 : 1 };\n  }\n  function paint(s) {\n    var q = s.p;\n    s.el.style.transform = \"translate(-50%,-50%) translate(\" + q.x.toFixed(2) + \"px,\" + q.y.toFixed(2) + \"px) rotate(\" + q.rot.toFixed(3) + \"deg) scale(\" + q.s.toFixed(4) + \")\";\n    s.el.style.filter = \"blur(\" + q.b.toFixed(2) + \"px)\";\n    s.el.style.opacity = q.o.toFixed(3);\n  }\n  function makeSlide(idx, step) {\n    var div = document.createElement(\"div\"); div.className = \"ef-bts__slide\";\n    var img = document.createElement(\"img\"); img.src = slides[idx].image; img.alt = \"\"; img.width = 600; img.height = 420; img.decoding = \"async\";\n    div.appendChild(img); imagesEl.appendChild(div);\n    var s = { el: div, step: step, p: props(step) };\n    div.style.zIndex = s.p.z;\n    div.setAttribute(\"aria-hidden\", \"true\");\n    paint(s); return s;\n  }\n  function buildCarousel() {\n    imagesEl.textContent = \"\"; slideEls = [];\n    if (!imagesEl.offsetHeight) return;\n    for (var step = -1; step <= 1; step++) slideEls.push(makeSlide(mod(current + step), step));\n  }\n  function animateCarousel(dir, dur) {\n    if (!imagesEl.offsetHeight) return 0;\n    var shift = dir === 1 ? -1 : 1, enter = dir === 1 ? 2 : -2;\n    slideEls.push(makeSlide(mod(current + 2 * dir), enter));\n    var left = slideEls.length;\n    slideEls.forEach(function (s) {\n      s.step += shift;\n      var from = s.p, to = props(s.step);\n      s.el.style.zIndex = to.z;\n      tween(dur, 0, p3io, function (e) {\n        s.p = { x: from.x + (to.x - from.x) * e, y: from.y + (to.y - from.y) * e, rot: from.rot + (to.rot - from.rot) * e, s: from.s + (to.s - from.s) * e, b: from.b + (to.b - from.b) * e, o: from.o + (to.o - from.o) * e };\n        paint(s);\n      }, function () {\n        if (--left > 0) return;\n        slideEls = slideEls.filter(function (q) { if (Math.abs(q.step) >= 2) { q.el.remove(); return false; } return true; });\n      });\n    });\n    return dur;\n  }\n  function setBg(c) { bg = c; el.style.backgroundColor = \"rgb(\" + c.map(Math.round).join(\",\") + \")\"; }\n\n  function go(dir) {\n    if (animating || slides.length < 2) return;\n    animating = true;\n    startAuto();\n    var next = mod(current + dir), dur = reduce ? 0.01 : opts.duration, stagger = reduce ? 0 : 0.04;\n    var from = bg.slice(), to = hex(slides[next].color, \"005236\");\n    tween(dur, 0, p2io, function (e) { setBg([from[0] + (to[0] - from[0]) * e, from[1] + (to[1] - from[1]) * e, from[2] + (to[2] - from[2]) * e]); });\n    var tTitle = animateTitle(slides[next].name, dir, reduce ? 0.01 : opts.duration / 1.2, stagger);\n    var tCar = animateCarousel(dir, dur);\n    var total = Math.max(dur, tTitle, tCar);\n    tween(total, 0, function (p) { return p; }, function () {}, function () { current = next; animating = false; });\n    announce(next);\n  }\n  function startAuto() {\n    stopAuto();\n    if (reduce || !opts.delay || !visible || focused || document.hidden) return;\n    autoId = setInterval(function () { if (!animating) go(1); }, opts.delay * 1000);\n  }\n  function stopAuto() { if (autoId) { clearInterval(autoId); autoId = 0; } }\n\n  function on(t, type, f, opt) { t.addEventListener(type, f, opt); offs.push(function () { t.removeEventListener(type, f, opt); }); }\n  on(el, \"wheel\", function (e) {\n    var n = now(); if (n - lastWheel < 1800) return; lastWheel = n;\n    if (animating) return;\n    go(e.deltaY > 0 ? 1 : -1);\n  }, { passive: true });\n  on(el, \"touchstart\", function (e) { touchX = e.touches[0].clientX; touchY = e.touches[0].clientY; }, { passive: true });\n  on(el, \"touchend\", function (e) {\n    var dx = touchX - e.changedTouches[0].clientX, dy = touchY - e.changedTouches[0].clientY, d = Math.abs(dx) > Math.abs(dy) ? dx : dy;\n    if (Math.abs(d) < 40) return;\n    var n = now(); if (n - lastTouch < 1800) return; lastTouch = n;\n    if (animating) return;\n    go(d > 0 ? 1 : -1);\n  }, { passive: true });\n  on(el, \"keydown\", function (e) {\n    var k = e.key;\n    if (k === \"ArrowDown\" || k === \"ArrowRight\") { e.preventDefault(); if (!animating) go(1); }\n    else if (k === \"ArrowUp\" || k === \"ArrowLeft\") { e.preventDefault(); if (!animating) go(-1); }\n  });\n  on(el, \"click\", function (e) { if (e.pointerType !== \"touch\" && !animating) go(1); });\n  on(el, \"pointermove\", onMove, { passive: true });\n  on(el, \"pointerleave\", onLeave);\n  on(el, \"focusin\", function () { focused = true; stopAuto(); });\n  on(el, \"focusout\", function (e) { if (!el.contains(e.relatedTarget)) { focused = false; startAuto(); } });\n  on(document, \"visibilitychange\", function () { if (document.hidden) stopAuto(); else startAuto(); });\n\n  function build() {\n    var names = String(opts.titles).split(\",\").map(function (s) { return s.trim(); }).filter(Boolean).slice(0, 12);\n    if (names.length < 2) names = names.concat([\"Bloom\", \"Ember\"]).slice(0, Math.max(2, names.length));\n    var cols = [opts.colour1, opts.colour2, opts.colour3, opts.colour4];\n    slides = names.map(function (n, i) { return { name: n, color: cols[i % 4], image: PHOTOS[i % PHOTOS.length] }; });\n    current = Math.min(current, slides.length - 1);\n    tweens = []; animating = false;\n    setTitle(slides[current].name);\n    setBg(hex(slides[current].color, \"005236\"));\n    buildCarousel();\n  }\n  function update(next) {\n    opts = Object.assign({ titles: \"Bloom, Ember, Trail, Rest\", delay: 4, duration: 1.2, label: \"Enrichr Library — Nr. 02\", colour1: \"#126e45\", colour2: \"#e54c1e\", colour3: \"#085e3d\", colour4: \"#005236\", ink: \"#fbf8f1\" }, opts, next || {});\n    opts.delay = Math.max(0, num(opts.delay, 4)); opts.duration = Math.max(0.2, num(opts.duration, 1.2));\n    el.style.setProperty(\"--ef-bts-ink\", opts.ink);\n    labelEl.textContent = opts.label;\n    var key = [opts.titles, opts.colour1, opts.colour2, opts.colour3, opts.colour4].join(\"|\");\n    if (key !== update.key) { update.key = key; build(); }\n    startAuto();\n  }\n\n  update(o);\n  slides.forEach(function (s) { var i = new Image(); i.src = s.image; });\n  if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; if (visible) startAuto(); else stopAuto(); }); io.observe(el); }\n  if (\"ResizeObserver\" in window) {\n    ro = new ResizeObserver(function () {\n      if (destroyed || animating) return;\n      if (!slideEls.length) { buildCarousel(); return; }\n      slideEls.forEach(function (s) { s.p = props(s.step); paint(s); });\n    });\n    ro.observe(imagesEl);\n  }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; stopAuto(); cancelAnimationFrame(raf); tweens = [];\n      offs.forEach(function (f) { f(); }); offs = [];\n      if (io) io.disconnect(); if (ro) ro.disconnect();\n    }\n  };\n}"
  }
}