{
  "id": "letter-shuffle-menu",
  "kind": "element",
  "title": "Letter shuffle menu",
  "summary": "A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.",
  "url": "https://enrichr.dev/elements/letter-shuffle-menu.html",
  "section": "nav",
  "techniques": [
    "text-animation",
    "stagger",
    "pointer-interaction"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "technical",
    "kinetic",
    "playful"
  ],
  "intents": [
    "scramble text hover effect",
    "text decode animation menu",
    "random letters resolve to label",
    "hacker style menu hover",
    "animated navigation links"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "speed",
      "label": "Speed",
      "type": "range",
      "min": 0.5,
      "max": 3,
      "step": 0.1,
      "value": 1
    },
    {
      "key": "duration",
      "label": "Duration (ms)",
      "type": "range",
      "min": 200,
      "max": 1500,
      "step": 50,
      "value": 700
    },
    {
      "key": "charset",
      "label": "Characters",
      "type": "select",
      "options": [
        [
          "letters",
          "Letters"
        ],
        [
          "symbols",
          "Symbols"
        ],
        [
          "binary",
          "Binary"
        ]
      ],
      "value": "letters"
    }
  ],
  "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 \"Letter shuffle menu\" element to this project.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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/letter-shuffle-menu.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 \"Letter shuffle menu\" 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 \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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 \"Letter shuffle menu\" element to this codebase.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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-letter-shuffle-menu.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Letter shuffle menu 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 \"Letter shuffle menu\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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- letter-shuffle-menu.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 \"./letter-shuffle-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LetterShuffleMenu(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 \"Letter shuffle menu\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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- letter-shuffle-menu.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/LetterShuffleMenu.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./letter-shuffle-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LetterShuffleMenu(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 \"Letter shuffle menu\" element.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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), letter-shuffle-menu.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 \"Letter shuffle menu\" element. No packages, no server code.\n\nThis is the \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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 letter-shuffle-menu.js and then main.js), style.css (the CSS below), letter-shuffle-menu.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 \"Letter shuffle menu\" 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 \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.json\n\nWhat it does: Each menu link holds two spans: a visually hidden one with the real label, and an aria-hidden one that is animated. When a shuffle starts, a requestAnimationFrame loop runs for the set duration. On every frame it rebuilds the visible text, replacing each letter with a random character from the chosen set until that letter's settle point passes, with letters on the left settling first. At the end it writes the true label. On mount the same routine runs on each item with a delay of 140 ms times its index, which creates the stagger. Hover and focus restart it.\nAccessibility: Screen readers read the hidden real label, never the scrambled text. Keyboard focus triggers the same animation as hover and shows an underline, and links keep normal focus order. With reduced motion on, the labels show at once and nothing scrambles. The links here use a placeholder href and prevent navigation, so replace those with real URLs.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Speed: range 0.5 to 3, step 0.1, default 1\n- Duration (ms): range 200 to 1500, step 50, default 700\n- Characters: select (Letters / Symbols / Binary), default letters\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/letter-shuffle-menu.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 \"Letter shuffle menu\" 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 \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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 LetterShuffleMenu.\n2. Paste the JavaScript below into a separate code file named letter-shuffle-menu.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 \"./letter-shuffle-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function LetterShuffleMenu(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(LetterShuffleMenu, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  speed: { type: ControlType.Number, title: \"Speed\", min: 0.5, max: 3, step: 0.1, defaultValue: 1 },\n  duration: { type: ControlType.Number, title: \"Duration\", min: 200, max: 1500, step: 50, defaultValue: 700 },\n  charset: { type: ControlType.Enum, title: \"Characters\", options: [\"letters\",\"symbols\",\"binary\"], optionTitles: [\"Letters\",\"Symbols\",\"Binary\"], defaultValue: \"letters\" },\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 \"Letter shuffle menu\" 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 \"Letter shuffle menu\" element from the Enrichr Library: A menu whose items scramble through random characters and resolve letter by letter into the real label, on load and on hover or focus.\nPage: https://enrichr.dev/elements/letter-shuffle-menu.html\nMachine-readable spec: https://enrichr.dev/elements/letter-shuffle-menu.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-letter-shuffle-menu\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-letter-shuffle-menu\"), { ...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": "Screen readers read the hidden real label, never the scrambled text. Keyboard focus triggers the same animation as hover and shows an underline, and links keep normal focus order. With reduced motion on, the labels show at once and nothing scrambles. The links here use a placeholder href and prevent navigation, so replace those with real URLs.",
  "performance": "Only the item being shuffled runs a requestAnimationFrame loop, and it stops itself when done. It writes a short text string per frame and no layout-affecting styles, and a monospace face keeps the width steady so nothing jumps. destroy() cancels all frames and timers and removes every listener.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-lsm\">\n  <div class=\"ef-lsm__wrap\"><nav class=\"ef-lsm__nav\" aria-label=\"Demo menu\"><ul class=\"ef-lsm__list\"></ul></nav></div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-lsm { width: 100%; }\n.ef-lsm__wrap { box-sizing: border-box; width: 100%; min-height: 18rem; padding: 1.6rem; border-radius: 1rem; display: flex; align-items: center; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; overflow: hidden; }\n.ef-lsm__nav { width: 100%; }\n.ef-lsm__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; counter-reset: lsm; }\n.ef-lsm__item { counter-increment: lsm; }\n.ef-lsm__link { position: relative; display: flex; align-items: baseline; gap: 0.9rem; padding: 0.15rem 0; color: var(--ef-ink, #fbf8f1); text-decoration: none; outline: none; font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-transform: uppercase; }\n.ef-lsm__link::before { content: counter(lsm, decimal-leading-zero); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ef-acc, #e6ff55); opacity: 0.7; }\n.ef-lsm__txt { display: inline-block; white-space: pre; font-family: ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace; transition: color 200ms; }\n.ef-lsm__link:hover .ef-lsm__txt, .ef-lsm__link:focus-visible .ef-lsm__txt, .ef-lsm__link.is-live .ef-lsm__txt { color: var(--ef-acc, #e6ff55); }\n.ef-lsm__link:focus-visible { box-shadow: 0 2px 0 0 var(--ef-acc, #e6ff55); }\n.ef-lsm__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@media (prefers-reduced-motion: reduce) { .ef-lsm__txt { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Letter shuffle menu: each item scrambles through random characters, then resolves letter by letter into its real label.\n// Runs on mount (staggered by item), and again on hover or keyboard focus. The real label is always in a visually hidden node for\n// screen readers; the scrambling text is aria-hidden. Reduced motion shows labels immediately with no scrambling.\n// mount(root, { background, accent, speed (0.5-3), duration (ms, 200-1500), charset (\"letters\"|\"symbols\"|\"binary\") })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-lsm__wrap\");\n  var list = root.querySelector(\".ef-lsm__list\");\n  var LABELS = [\"Work\", \"Studio\", \"Journal\", \"About\", \"Contact\"];\n  var SETS = { letters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", symbols: \"#$%&*+<>?/=~^\", binary: \"01\" };\n  var opts = {}, items = [], offs = [], timers = [];\n\n  function stop(it) { if (it.raf) cancelAnimationFrame(it.raf); it.raf = 0; it.run = 0; }\n  function clear() {\n    offs.forEach(function (f) { f(); }); offs = [];\n    timers.forEach(function (t) { clearTimeout(t); }); timers = [];\n    items.forEach(stop);\n    items = [];\n  }\n  function shuffle(it) {\n    stop(it);\n    var label = it.label;\n    if (reduce) { it.txt.textContent = label; return; }\n    var set = SETS[opts.charset] || SETS.letters;\n    var start = performance.now();\n    var dur = opts.duration / opts.speed;\n    var id = ++it.id;\n    it.run = id;\n    function frame(now) {\n      if (it.run !== id) return;\n      var t = Math.min(1, (now - start) / dur);\n      var out = \"\";\n      for (var i = 0; i < label.length; i++) {\n        var settle = ((i + 1) / label.length) * 0.85; // left letters resolve first\n        out += t >= settle ? label.charAt(i) : set.charAt(Math.floor(Math.random() * set.length));\n      }\n      it.txt.textContent = t >= 1 ? label : out;\n      if (t < 1) it.raf = requestAnimationFrame(frame); else { it.raf = 0; it.run = 0; }\n    }\n    it.raf = requestAnimationFrame(frame);\n  }\n  function build() {\n    clear();\n    list.textContent = \"\";\n    LABELS.forEach(function (label, i) {\n      var li = document.createElement(\"li\"); li.className = \"ef-lsm__item\";\n      var a = document.createElement(\"a\"); a.className = \"ef-lsm__link\"; a.href = \"#\";\n      var sr = document.createElement(\"span\"); sr.className = \"ef-lsm__sr\"; sr.textContent = label;\n      var txt = document.createElement(\"span\"); txt.className = \"ef-lsm__txt\"; txt.setAttribute(\"aria-hidden\", \"true\"); txt.textContent = label;\n      a.appendChild(sr); a.appendChild(txt); li.appendChild(a); list.appendChild(li);\n      var it = { label: label, txt: txt, raf: 0, run: 0, id: 0 };\n      items.push(it);\n      function go() { a.classList.add(\"is-live\"); shuffle(it); }\n      function off() { a.classList.remove(\"is-live\"); }\n      function ck(e) { e.preventDefault(); }\n      a.addEventListener(\"pointerenter\", go);\n      a.addEventListener(\"focus\", go);\n      a.addEventListener(\"pointerleave\", off);\n      a.addEventListener(\"blur\", off);\n      a.addEventListener(\"click\", ck);\n      offs.push(function () {\n        a.removeEventListener(\"pointerenter\", go); a.removeEventListener(\"focus\", go);\n        a.removeEventListener(\"pointerleave\", off); a.removeEventListener(\"blur\", off); a.removeEventListener(\"click\", ck);\n      });\n      if (!reduce) {\n        txt.textContent = \"\";\n        timers.push(setTimeout(function () { shuffle(it); }, (i * 140) / opts.speed));\n      }\n    });\n  }\n  function update(next) {\n    var first = !items.length;\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", speed: 1, duration: 700, charset: \"letters\" }, opts, next || {});\n    opts.speed = Math.max(0.5, Math.min(3, Number(opts.speed) || 1));\n    opts.duration = Math.max(200, Math.min(1500, Number(opts.duration) || 700));\n    wrap.style.background = opts.background;\n    wrap.style.setProperty(\"--ef-acc\", opts.accent);\n    if (first) build();\n    else if (prev.charset !== opts.charset) items.forEach(shuffle); // replay so the new character set is visible\n  }\n  update(o);\n  return { update: update, destroy: clear };\n}"
  }
}