{
  "id": "scroll-text-scramble-flip",
  "kind": "element",
  "title": "Scroll text scramble and slide",
  "summary": "Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.",
  "url": "https://enrichr.dev/elements/scroll-text-scramble-flip.html",
  "section": "text",
  "techniques": [
    "text-animation",
    "scroll-driven",
    "stagger"
  ],
  "stack": [
    "Vanilla JS",
    "CSS",
    "SVG"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "kinetic",
    "technical",
    "bold"
  ],
  "intents": [
    "on scroll text motion",
    "scramble text on scroll",
    "text slides between columns on scroll",
    "scroll triggered text decode",
    "typographic scroll animation without gsap"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "label",
      "label": "Centre label",
      "type": "text",
      "value": "Enrichr"
    },
    {
      "key": "travel",
      "label": "Slide distance",
      "type": "range",
      "min": 0.2,
      "max": 1,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "scramble",
      "label": "Scramble time (x)",
      "type": "range",
      "min": 0,
      "max": 2,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "groups",
      "label": "Text groups",
      "type": "range",
      "min": 3,
      "max": 6,
      "step": 1,
      "value": 6
    }
  ],
  "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 \"Scroll text scramble and slide\" element to this project.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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/scroll-text-scramble-flip.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 \"Scroll text scramble and slide\" 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 \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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 \"Scroll text scramble and slide\" element to this codebase.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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-scroll-text-scramble-flip.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Scroll text scramble and slide 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 \"Scroll text scramble and slide\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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- scroll-text-scramble-flip.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 \"./scroll-text-scramble-flip\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollTextScrambleFlip(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 \"Scroll text scramble and slide\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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- scroll-text-scramble-flip.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/ScrollTextScrambleFlip.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./scroll-text-scramble-flip\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollTextScrambleFlip(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 \"Scroll text scramble and slide\" element.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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), scroll-text-scramble-flip.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 \"Scroll text scramble and slide\" element. No packages, no server code.\n\nThis is the \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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 scroll-text-scramble-flip.js and then main.js), style.css (the CSS below), scroll-text-scramble-flip.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 \"Scroll text scramble and slide\" 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 \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.json\n\nWhat it does: This is a vanilla port of the idea, with no GSAP, ScrollTrigger, Flip or ScrambleText. The element owns a scroll container, and on every scroll event (batched into one requestAnimationFrame) each line works out where its centre sits in the view, 0 at the top and 1 at the bottom. From 0.9 down to 0.5 an expo in-out ease moves the line from its starting column to its target column, and from 0.5 down to 0.1 the same ease moves it back, so the slide is a pure function of scroll position and reverses when you scroll back. The first time a line enters view its text is replaced by random letters that resolve left to right over a set time, driven by a small rAF loop. The real text stays in a visually hidden span so screen readers never hear the noise.\nAccessibility: The scroller is focusable and scrolls with the arrow keys, Page Up and Page Down. Each line keeps its real text in a visually hidden span while the scrambling copy is aria-hidden. With prefers-reduced-motion the lines are static and nothing scrambles or slides. The blinking cursor line is decorative and stops under reduced motion. Keep line text short so scrambling is not distracting.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Centre label: text, default Enrichr\n- Slide distance: range 0.2 to 1, step 0.05, default 1\n- Scramble time (x): range 0 to 2, step 0.1, default 1\n- Text groups: range 3 to 6, step 1, default 6\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/scroll-text-scramble-flip.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 \"Scroll text scramble and slide\" 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 \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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 ScrollTextScrambleFlip.\n2. Paste the JavaScript below into a separate code file named scroll-text-scramble-flip.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 \"./scroll-text-scramble-flip\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ScrollTextScrambleFlip(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(ScrollTextScrambleFlip, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  label: { type: ControlType.String, title: \"Centre label\", defaultValue: \"Enrichr\" },\n  travel: { type: ControlType.Number, title: \"Slide distance\", min: 0.2, max: 1, step: 0.05, defaultValue: 1 },\n  scramble: { type: ControlType.Number, title: \"Scramble time\", min: 0, max: 2, step: 0.1, defaultValue: 1 },\n  groups: { type: ControlType.Number, title: \"Text groups\", min: 3, max: 6, step: 1, defaultValue: 6 },\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 \"Scroll text scramble and slide\" 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 \"Scroll text scramble and slide\" element from the Enrichr Library: Uppercase text lines slide sideways between two columns as you scroll, then scramble into place the first time they enter view, with Enrichr puzzle pieces drifting behind.\nPage: https://enrichr.dev/elements/scroll-text-scramble-flip.html\nMachine-readable spec: https://enrichr.dev/elements/scroll-text-scramble-flip.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-scroll-text-scramble-flip\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-scroll-text-scramble-flip\"), { ...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 scroller is focusable and scrolls with the arrow keys, Page Up and Page Down. Each line keeps its real text in a visually hidden span while the scrambling copy is aria-hidden. With prefers-reduced-motion the lines are static and nothing scrambles or slides. The blinking cursor line is decorative and stops under reduced motion. Keep line text short so scrambling is not distracting.",
  "performance": "Scroll handling is batched into one rAF per frame and only writes transform and opacity on the lines. Scramble runs a single rAF loop that stops when no line is mid scramble. Positions are measured once and on resize, so scrolling does no layout reads beyond scrollTop and clientHeight.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-stm\">\n  <div class=\"ef-stm__wrap\">\n    <svg class=\"ef-stm__piece ef-stm__piece--a\" viewBox=\"1513.7 166.86 322.3 503.06\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M1528.7 564.5v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5 7.8 8.7 19.7 13.7 32.7 11.9 16.8-2.2 30.1-15.9 32-32.7 2.5-22.5-15.1-41.5-37.1-41.5-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.5-14.5-14.5v-111.6h111.6c8.1 0 14.5-6.5 14.5-14.5 0-4.1-1.8-8.1-4.9-10.9-7.6-6.8-12.3-16.6-12.3-27.6 0-22 19-39.6 41.5-37.1 16.8 1.8 30.5 15.2 32.8 32 1.7 12.9-3.3 24.8-12 32.7-3.1 2.8-5 6.7-5 10.9 0 8 6.5 14.5 14.5 14.5h111.6v111.6c0 8-6.4 14.5-14.5 14.5-4.2 0-8.1-1.9-10.9-5-7.9-8.7-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.5 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5v111.6h-111.6c-8 0-14.5 6.5-14.5 14.5 0 4.2 1.9 8.1 5 10.9 7.5 6.8 12.3 16.7 12.3 27.7 0 22-19 39.5-41.6 37.1-16.8-1.9-30.5-15.3-32.7-32-1.7-13 3.3-24.9 11.9-32.7 3.1-2.9 5-6.8 5-11 0-8-6.4-14.5-14.5-14.5z\"/></svg>\n    <svg class=\"ef-stm__piece ef-stm__piece--b\" viewBox=\"1513.7 1453.9 322.3 322.3\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M1821 1761.2h-292.3v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5.1 7.8 8.6 19.7 13.6 32.7 11.9 16.8-2.3 30.1-16 32-32.7 2.5-22.6-15.1-41.6-37.1-41.6-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.4-14.5-14.4v-111.7h292.3v111.7c0 8-6.4 14.4-14.5 14.4-4.2 0-8.1-1.8-10.9-5-7.9-8.6-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.6 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5z\"/></svg>\n    <div class=\"ef-stm__label\" aria-hidden=\"true\"></div>\n    <div class=\"ef-stm__scroller\" tabindex=\"0\" role=\"region\" aria-label=\"Scroll to slide and scramble the text lines\">\n      <div class=\"ef-stm__content\"></div>\n    </div>\n    <div class=\"ef-stm__hint\" aria-hidden=\"true\">Scroll</div>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/ScrollTextMotion (MIT) — Copyright (c) 2009 - 2025 [Codrops](https://codrops.com) */\n.ef-stm { width: 100%; }\n.ef-stm__wrap { --ef-acc: #e6ff55; position: relative; box-sizing: border-box; width: 100%; height: 24rem; border-radius: 1rem; overflow: hidden; color: #fbf8f1; font-family: ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace; }\n.ef-stm__scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; outline: none; scrollbar-width: thin; scrollbar-color: var(--ef-acc) transparent; }\n.ef-stm__scroller:focus-visible { box-shadow: inset 0 0 0 2px var(--ef-acc); }\n.ef-stm__content { padding: 22rem 1.2rem 14rem; }\n.ef-stm__group { display: flex; flex-direction: column; margin-bottom: 9rem; }\n.ef-stm__el { display: block; align-self: flex-start; white-space: nowrap; text-transform: uppercase; font-size: 1.35rem; line-height: 1.25; letter-spacing: 0.02em; opacity: 0.55; will-change: transform, opacity; }\n.ef-stm__el--xl { font-size: clamp(4rem, 26vw, 8.5rem); line-height: 0.95; font-weight: 700; color: var(--ef-acc); opacity: 1; }\n.ef-stm__el--cursor { animation: ef-stm-blink 0.7s linear infinite; color: var(--ef-acc); }\n.ef-stm__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.ef-stm__label { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: clamp(2.2rem, 11vw, 4rem); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ef-acc); opacity: 0.9; pointer-events: none; transition: opacity 400ms; }\n.ef-stm__label.is-away { opacity: 0.12; }\n.ef-stm__piece { position: absolute; pointer-events: none; color: var(--ef-acc); opacity: 0.13; will-change: transform; }\n.ef-stm__piece--a { right: 6%; top: 8%; width: 5.5rem; transform: rotate(8deg); }\n.ef-stm__piece--b { left: 4%; bottom: 10%; width: 5rem; transform: rotate(-10deg); opacity: 0.1; }\n.ef-stm__hint { position: absolute; left: 1.2rem; bottom: 0.9rem; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.6; pointer-events: none; }\n@keyframes ef-stm-blink { from, to { opacity: 1; } 50% { opacity: 0; } }\n@media (prefers-reduced-motion: reduce) { .ef-stm__el, .ef-stm__piece { will-change: auto; transform: none; } .ef-stm__el--cursor { animation: none; } .ef-stm__label { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/ScrollTextMotion (MIT) — Copyright (c) 2009 - 2025 [Codrops](https://codrops.com)\n// Scroll text scramble flip: lines of uppercase text sit in a scroller of their own. As each line travels from the bottom of the view to the\n// middle it slides sideways from one column to another (an expo in-out ease driven by scroll position), then slides back as it leaves at the\n// top. The first time a line enters view its letters scramble and resolve left to right. Vanilla port: no GSAP, Flip or ScrambleText; the\n// slide is a lerp from scroll position and the scramble runs on requestAnimationFrame. Reduced motion shows static text.\n// mount(root, { background, accent, label, travel (0.2-1), scramble (0-2, speed multiplier of the scramble time), groups (3-6) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-stm__wrap\");\n  var sc = root.querySelector(\".ef-stm__scroller\");\n  var content = root.querySelector(\".ef-stm__content\");\n  var labelEl = root.querySelector(\".ef-stm__label\");\n  var pieceA = root.querySelector(\".ef-stm__piece--a\");\n  var pieceB = root.querySelector(\".ef-stm__piece--b\");\n  var opts = {}, items = [], raf = 0, tickRaf = 0, scrambling = [], labelText = \"\";\n  var LETTERS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n  // a = starting column, b = column reached at the middle of the view (0 = left edge, 1 = right edge)\n  var GROUPS = [\n    { w: [\"Capture\", \"Verify\", \"Rebuild\"], a: 1, b: 0.28 },\n    { w: [\"Neural glow\", \"Data streams\", \"Spark\", \"Cold radiance\"], a: 0, b: 0.72 },\n    { w: [\"E\"], a: 0, b: 0.3, xl: true, d: 2.5 },\n    { w: [\"Rebuild complete\", \"█\"], a: 0, b: 0.72, d: 0, cursor: true },\n    { w: [\"Beacon\", \"Hidden strata\", \"Quiet signal\"], a: 0.28, b: 1 },\n    { w: [\"N\"], a: 0.72, b: 0.28, xl: true, d: 2.5 }\n  ];\n\n  function ease(t) { return t <= 0 ? 0 : t >= 1 ? 1 : t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2; }\n  function clamp(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }\n\n  function measure() {\n    var cw = content.clientWidth - parseFloat(getComputedStyle(content).paddingLeft) * 2;\n    items.forEach(function (it) {\n      it.top = it.el.offsetTop;\n      it.h = it.el.offsetHeight;\n      it.free = Math.max(0, cw - it.el.offsetWidth);\n    });\n  }\n  function setText(it, str) { it.vis.textContent = str; }\n  function startScramble(it) {\n    var dur = (it.d == null ? 1 : it.d) * opts.scramble;\n    if (reduce || dur <= 0) { setText(it, it.text); return; }\n    it.t0 = performance.now();\n    it.dur = dur * 1000;\n    if (scrambling.indexOf(it) < 0) scrambling.push(it);\n    if (!tickRaf) tickRaf = requestAnimationFrame(tick);\n  }\n  function scrambled(text, p) {\n    var n = text.length, keep = Math.floor(p * n), out = \"\";\n    for (var i = 0; i < n; i++) {\n      var c = text.charAt(i);\n      out += (i < keep || c === \" \") ? c : LETTERS.charAt(Math.floor(Math.random() * LETTERS.length));\n    }\n    return out;\n  }\n  function tick(now) {\n    tickRaf = 0;\n    for (var i = scrambling.length - 1; i >= 0; i--) {\n      var it = scrambling[i];\n      var p = clamp((now - it.t0) / it.dur);\n      setText(it, p >= 1 ? it.text : scrambled(it.text, p));\n      if (p >= 1) scrambling.splice(i, 1);\n    }\n    if (scrambling.length) tickRaf = requestAnimationFrame(tick);\n  }\n\n  function render() {\n    raf = 0;\n    var st = sc.scrollTop, vh = Math.max(1, sc.clientHeight);\n    var max = Math.max(1, sc.scrollHeight - vh), prog = st / max;\n    for (var i = 0; i < items.length; i++) {\n      var it = items[i];\n      var q = (it.top + it.h / 2 - st) / vh; // 0 = top of view, 0.5 = middle, 1 = bottom\n      var inView = q > 0.02 && q < 0.98;\n      if (inView && !it.seen) { it.seen = true; startScramble(it); }\n      else if (!inView && it.seen && (q < -0.2 || q > 1.2)) { it.seen = false; setText(it, it.text); if (it.dur) it.dur = 0; var k = scrambling.indexOf(it); if (k >= 0) scrambling.splice(k, 1); }\n      if (reduce) continue;\n      var m = ease(clamp((0.9 - q) / 0.4)) - ease(clamp((0.5 - q) / 0.4));\n      var col = it.a + (it.b - it.a) * m * opts.travel;\n      it.el.style.transform = \"translate3d(\" + (col * it.free).toFixed(1) + \"px,0,0)\";\n      if (!it.xl) it.el.style.opacity = (0.42 + 0.58 * m).toFixed(2);\n    }\n    labelEl.classList.toggle(\"is-away\", st > vh * 0.25);\n    if (!reduce) {\n      pieceA.style.transform = \"translate3d(0,\" + (-prog * 60).toFixed(1) + \"px,0) rotate(\" + (8 + prog * 40).toFixed(1) + \"deg)\";\n      pieceB.style.transform = \"translate3d(0,\" + (prog * 50).toFixed(1) + \"px,0) rotate(\" + (-10 - prog * 30).toFixed(1) + \"deg)\";\n    }\n  }\n  function queue() { if (!raf) raf = requestAnimationFrame(render); }\n\n  function build() {\n    scrambling = [];\n    content.textContent = \"\";\n    items = [];\n    GROUPS.slice(0, opts.groups).forEach(function (g) {\n      var gd = document.createElement(\"div\");\n      gd.className = \"ef-stm__group\";\n      g.w.forEach(function (txt) {\n        var el = document.createElement(\"span\");\n        el.className = \"ef-stm__el\" + (g.xl ? \" ef-stm__el--xl\" : \"\") + (g.cursor && txt === \"█\" ? \" ef-stm__el--cursor\" : \"\");\n        var vis = document.createElement(\"span\");\n        vis.setAttribute(\"aria-hidden\", \"true\");\n        vis.textContent = txt;\n        var sr = document.createElement(\"span\");\n        sr.className = \"ef-stm__sr\";\n        sr.textContent = txt === \"█\" ? \"\" : txt;\n        el.appendChild(vis); el.appendChild(sr);\n        gd.appendChild(el);\n        items.push({ el: el, vis: vis, text: txt, a: g.a, b: g.b, xl: !!g.xl, d: g.d, seen: false, top: 0, h: 0, free: 0, t0: 0, dur: 0 });\n        if (reduce) el.style.transform = \"none\";\n      });\n      content.appendChild(gd);\n    });\n    measure();\n    queue();\n  }\n  function setLabel() {\n    if (labelText === opts.label) return;\n    labelText = opts.label;\n    var it = { vis: labelEl, text: labelText, d: 1, t0: 0, dur: 0 };\n    startScramble(it);\n    if (reduce) labelEl.textContent = labelText;\n  }\n\n  function onScroll() { queue(); }\n  function onResize() { measure(); queue(); }\n  sc.addEventListener(\"scroll\", onScroll, { passive: true });\n  window.addEventListener(\"resize\", onResize);\n  var ro = null;\n  if (window.ResizeObserver) { ro = new ResizeObserver(onResize); ro.observe(sc); }\n\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", label: \"Enrichr\", travel: 1, scramble: 1, groups: 6 }, opts, next || {});\n    opts.travel = Math.max(0.2, Math.min(1, Number(opts.travel) || 1));\n    opts.scramble = Math.max(0, Math.min(2, Number(opts.scramble)));\n    if (isNaN(opts.scramble)) opts.scramble = 1;\n    opts.groups = Math.max(3, Math.min(6, Math.round(opts.groups)));\n    opts.label = String(opts.label || \"Enrichr\").slice(0, 14);\n    wrap.style.background = opts.background;\n    wrap.style.setProperty(\"--ef-acc\", opts.accent);\n    if (prev.groups !== opts.groups || !items.length) build(); else queue();\n    setLabel();\n  }\n  update(o);\n  return {\n    update: update,\n    destroy: function () {\n      sc.removeEventListener(\"scroll\", onScroll);\n      window.removeEventListener(\"resize\", onResize);\n      if (ro) ro.disconnect();\n      if (raf) cancelAnimationFrame(raf);\n      if (tickRaf) cancelAnimationFrame(tickRaf);\n      raf = 0; tickRaf = 0; scrambling = [];\n    }\n  };\n}"
  }
}