{
  "id": "kinetic-type-experiments",
  "kind": "element",
  "title": "Kinetic type experiments",
  "summary": "Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.",
  "url": "https://enrichr.dev/elements/kinetic-type-experiments.html",
  "section": "text",
  "techniques": [
    "text-animation",
    "reveal",
    "stagger",
    "scroll-driven"
  ],
  "stack": [
    "Vanilla JS",
    "CSS",
    "Canvas"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "technical",
    "kinetic"
  ],
  "intents": [
    "matrix rain text reveal",
    "variable font weight animation",
    "word morph blur transition",
    "chromatic aberration text on scroll",
    "letters drop with bounce"
  ],
  "status": "tested",
  "params": [
    {
      "key": "effect",
      "label": "Study",
      "type": "select",
      "options": [
        [
          "varfont",
          "25 Variable weight"
        ],
        [
          "matrix",
          "26 Matrix formation"
        ],
        [
          "morph",
          "27 Word morph"
        ],
        [
          "chroma",
          "28 Chromatic scroll"
        ],
        [
          "gravity",
          "29 Gravity drop"
        ]
      ],
      "value": "varfont"
    },
    {
      "key": "text",
      "label": "Text",
      "type": "text",
      "value": "A LIVING AXIS"
    },
    {
      "key": "words",
      "label": "Morph words (comma separated)",
      "type": "text",
      "value": "FORM, FUNCTION"
    },
    {
      "key": "speed",
      "label": "Speed (1 = original timing)",
      "type": "range",
      "min": 0.25,
      "max": 3,
      "step": 0.05,
      "value": 1
    },
    {
      "key": "size",
      "label": "Text size (px)",
      "type": "range",
      "min": 16,
      "max": 120,
      "step": 1,
      "value": 42
    },
    {
      "key": "color",
      "label": "Text colour",
      "type": "color",
      "value": "#fbf8f1"
    },
    {
      "key": "accent",
      "label": "Accent (locked letters, colour split, label)",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "ghost",
      "label": "Second split colour",
      "type": "color",
      "value": "#e54c1e"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "label",
      "label": "Specimen label",
      "type": "select",
      "options": [
        [
          "1",
          "Show"
        ],
        [
          "0",
          "Hide"
        ]
      ],
      "value": "1"
    }
  ],
  "license": "Free to use in personal and client projects during the preview. Final licence terms will be published here before any paid tier starts; ask before reselling the code as a collection.",
  "contract": "function mount(root, opts) -> { update(partialOpts), destroy() }; root must contain the element markup",
  "exports": {
    "claude": "Add the \"Kinetic type experiments\" element to this project.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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/kinetic-type-experiments.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 \"Kinetic type experiments\" 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 \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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 \"Kinetic type experiments\" element to this codebase.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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-kinetic-type-experiments.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Kinetic type experiments 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 \"Kinetic type experiments\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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- kinetic-type-experiments.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 \"./kinetic-type-experiments\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function KineticTypeExperiments(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 \"Kinetic type experiments\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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- kinetic-type-experiments.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/KineticTypeExperiments.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./kinetic-type-experiments\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function KineticTypeExperiments(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 \"Kinetic type experiments\" element.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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), kinetic-type-experiments.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 \"Kinetic type experiments\" element. No packages, no server code.\n\nThis is the \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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 kinetic-type-experiments.js and then main.js), style.css (the CSS below), kinetic-type-experiments.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 \"Kinetic type experiments\" 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 \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.json\n\nWhat it does: Variable weight animates font-variation-settings between weight 300 and 900 on a 4 s ease-in-out loop (the brand font's axis stops at 800). Matrix formation draws on a canvas, 560 by 150 pixels for a short word and wider for a longer one: each frame lays the background over the last at 35% so trails fade, drops one 22 px glyph per column, and once a column's drop reaches row four the matching letter of your word locks there in the accent colour, every other column. It steps 60 times a second on a clock, whatever the screen's refresh rate. Word morph stacks two words and swaps them every 2.2 s, each fading and blurring 6 px over 1 s; with more than two words it steps through them. Chromatic scroll measures how far the element's middle is from the middle of the screen and splits two coloured text-shadows apart by up to 8 px each way, closing at the centre. Gravity drop drops each letter 160 px with a fall, an 8 px overshoot and a 4 px bounce over 0.7 s, start times spread over 420 ms. Matrix and gravity play when about a third of the element is on screen and again each time it comes back; replay() plays them on demand.\nAccessibility: The text or the morph words are visually hidden text for screen readers; the matrix canvas has a label naming the word. With prefers-reduced-motion each study shows a still frame: the matrix as its locked word on a clean field, no colour split, the first morph word and the dropped letters already in place. Nothing needs keyboard input.\n\nTunable settings:\n- Study: select (25 Variable weight / 26 Matrix formation / 27 Word morph / 28 Chromatic scroll / 29 Gravity drop), default varfont\n- Text: text, default A LIVING AXIS\n- Morph words (comma separated): text, default FORM, FUNCTION\n- Speed (1 = original timing): range 0.25 to 3, step 0.05, default 1\n- Text size (px): range 16 to 120, step 1, default 42\n- Text colour: color, default #fbf8f1\n- Accent (locked letters, colour split, label): color, default #e6ff55\n- Second split colour: color, default #e54c1e\n- Background: color, default #0c1e18\n- Specimen label: select (Show / Hide), default 1\n\nCurrent settings:\n{{SETTINGS}}\n\nFor the developer: Element contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nIn Figma:\n- Draw the resting state as a frame and the end state as a second frame; link them with Smart Animate to show the motion in a prototype.\n- Put the settings above in the frame's notes or Dev Mode annotations so the developer matches them.\n- Link https://enrichr.dev/elements/kinetic-type-experiments.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 \"Kinetic type experiments\" 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 \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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 KineticTypeExperiments.\n2. Paste the JavaScript below into a separate code file named kinetic-type-experiments.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 \"./kinetic-type-experiments\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function KineticTypeExperiments(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(KineticTypeExperiments, {\n  effect: { type: ControlType.Enum, title: \"Study\", options: [\"varfont\",\"matrix\",\"morph\",\"chroma\",\"gravity\"], optionTitles: [\"25 Variable weight\",\"26 Matrix formation\",\"27 Word morph\",\"28 Chromatic scroll\",\"29 Gravity drop\"], defaultValue: \"varfont\" },\n  text: { type: ControlType.String, title: \"Text\", defaultValue: \"A LIVING AXIS\" },\n  words: { type: ControlType.String, title: \"Morph words (comma separated)\", defaultValue: \"FORM, FUNCTION\" },\n  speed: { type: ControlType.Number, title: \"Speed\", min: 0.25, max: 3, step: 0.05, defaultValue: 1 },\n  size: { type: ControlType.Number, title: \"Text size\", min: 16, max: 120, step: 1, defaultValue: 42 },\n  color: { type: ControlType.Color, title: \"Text colour\", defaultValue: \"#fbf8f1\" },\n  accent: { type: ControlType.Color, title: \"Accent (locked letters, colour split, label)\", defaultValue: \"#e6ff55\" },\n  ghost: { type: ControlType.Color, title: \"Second split colour\", defaultValue: \"#e54c1e\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\n  label: { type: ControlType.Enum, title: \"Specimen label\", options: [\"1\",\"0\"], optionTitles: [\"Show\",\"Hide\"], defaultValue: \"1\" },\n})\n```\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "webflow": "Add the \"Kinetic type experiments\" 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 \"Kinetic type experiments\" element from the Enrichr Library: Five experimental text studies: a breathing variable weight, matrix rain that locks into your word, a blurred word morph, a scroll-linked colour split and a gravity drop.\nPage: https://enrichr.dev/elements/kinetic-type-experiments.html\nMachine-readable spec: https://enrichr.dev/elements/kinetic-type-experiments.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-kinetic-type-experiments\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-kinetic-type-experiments\"), { ...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 text or the morph words are visually hidden text for screen readers; the matrix canvas has a label naming the word. With prefers-reduced-motion each study shows a still frame: the matrix as its locked word on a clean field, no colour split, the first morph word and the dropped letters already in place. Nothing needs keyboard input.",
  "performance": "Only the matrix runs script per frame, about 25 to 40 glyphs on a small canvas, on a clock that pauses off screen and in hidden tabs; its pixel ratio is capped at 2. The other studies are CSS animations and transitions, and the scroll listener is passive and idle off screen.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/KwWbBLp",
  "source": {
    "markup": "<div class=\"ef-ktx\" data-fx=\"varfont\" data-label=\"1\">\n  <div class=\"ef-ktx__head\">\n    <span class=\"ef-ktx__num\" aria-hidden=\"true\">25</span>\n    <span class=\"ef-ktx__meta\"><span class=\"ef-ktx__name\">Variable weight</span><span class=\"ef-ktx__desc\">One font, breathing between its thinnest and heaviest self.</span></span>\n    <span class=\"ef-ktx__tag\">continuous</span>\n  </div>\n  <div class=\"ef-ktx__stage\"><span class=\"ef-ktx__demo\">A LIVING AXIS</span></div>\n  <span class=\"ef-ktx__hint\" aria-hidden=\"true\" hidden>scroll the page</span>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-ktx {\n  --ef-ktx-k: 1; --ef-ktx-size: 42;\n  --ef-ktx-fg: #fbf8f1; --ef-ktx-fg-rgb: 251, 248, 241; --ef-ktx-muted: #9ca39b;\n  --ef-ktx-bg: #0c1e18; --ef-ktx-bg-rgb: 12, 30, 24; --ef-ktx-top: #17281f;\n  --ef-ktx-acc: #e6ff55; --ef-ktx-acc-rgb: 230, 255, 85; --ef-ktx-ghost-rgb: 229, 76, 30;\n  --ef-ktx-fs: min(calc(var(--ef-ktx-size) * 1px), max(1.5rem, 9cqw));\n  position: relative; box-sizing: border-box; width: 100%; min-height: 24rem; overflow: hidden; border-radius: 1rem;\n  display: flex; flex-direction: column; container-type: inline-size;\n  color: var(--ef-ktx-fg); font-family: 'Instrument Sans', system-ui, sans-serif;\n  background: radial-gradient(ellipse at 50% 120%, rgba(var(--ef-ktx-acc-rgb), .1), transparent 60%), linear-gradient(180deg, var(--ef-ktx-top), var(--ef-ktx-bg));\n  border: 1px solid rgba(var(--ef-ktx-acc-rgb), .2);\n  box-shadow: inset 0 1px 0 rgba(var(--ef-ktx-fg-rgb), .05);\n}\n.ef-ktx *, .ef-ktx *::before, .ef-ktx *::after { box-sizing: border-box; }\n\n/* specimen label */\n.ef-ktx .ef-ktx__head { position: relative; z-index: 2; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem 0; }\n.ef-ktx[data-label=\"0\"] .ef-ktx__head, .ef-ktx[data-label=\"0\"] .ef-ktx__hint { display: none; }\n.ef-ktx .ef-ktx__num {\n  flex-shrink: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;\n  font: 600 .78rem/1 'Fira Code', ui-monospace, monospace; color: var(--ef-ktx-bg); background: var(--ef-ktx-acc);\n  box-shadow: 0 0 0 1px rgba(var(--ef-ktx-acc-rgb), .4), 0 4px 14px -4px rgba(var(--ef-ktx-acc-rgb), .55);\n}\n.ef-ktx .ef-ktx__meta { display: block; min-width: 0; text-align: left; }\n.ef-ktx .ef-ktx__name { display: block; margin: 0 0 .15rem; font: 600 1.1rem/1.2 'Parkinsans', 'Space Grotesk', sans-serif; letter-spacing: .01em; color: var(--ef-ktx-fg); opacity: 1; }\n.ef-ktx .ef-ktx__desc { display: block; margin: 0; font-size: .84rem; line-height: 1.45; color: var(--ef-ktx-muted); opacity: 1; }\n.ef-ktx.is-narrow .ef-ktx__desc { display: none; }\n.ef-ktx .ef-ktx__hint {\n  position: absolute; z-index: 2; bottom: .9rem; right: .9rem; padding: .3rem .6rem; border-radius: 2px;\n  font: .68rem/1.2 'Fira Code', ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ef-ktx-fg);\n  background: rgba(var(--ef-ktx-bg-rgb), .65); border: 1px solid rgba(var(--ef-ktx-acc-rgb), .3);\n  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); pointer-events: none;\n}\n\n/* stage and type */\n.ef-ktx .ef-ktx__stage { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem 3rem; min-height: 12rem; }\n.ef-ktx .ef-ktx__sr { 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-ktx .ef-ktx__demo {\n  display: inline-block; margin: 0; white-space: pre-wrap; color: var(--ef-ktx-fg); opacity: 1;\n  font-family: 'Parkinsans', 'Space Grotesk', sans-serif; font-weight: 500; font-size: var(--ef-ktx-fs); letter-spacing: .01em; line-height: 1.2;\n}\n.ef-ktx .ef-ktx__w { display: inline-block; white-space: nowrap; }\n.ef-ktx .ef-ktx__ch { display: inline-block; will-change: transform, opacity, filter; }\n.ef-ktx .ef-ktx__tag {\n  margin-left: auto; align-self: center; white-space: nowrap; padding: .3rem .6rem; border-radius: 20px;\n  font: .62rem/1.2 'Fira Code', ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase;\n  color: rgba(var(--ef-ktx-acc-rgb), .85); border: 1px solid rgba(var(--ef-ktx-acc-rgb), .35); background: rgba(var(--ef-ktx-acc-rgb), .06);\n}\n.ef-ktx .ef-ktx__tag[hidden], .ef-ktx .ef-ktx__hint[hidden], .ef-ktx.is-narrow .ef-ktx__tag { display: none; }\n\n/* 25 variable weight (the font's weight axis runs 300 to 800, so the peak holds at 800) */\n.ef-ktx[data-fx=\"varfont\"] .ef-ktx__demo { font-variation-settings: \"wght\" 340, \"opsz\" 30; }\n.ef-ktx[data-fx=\"varfont\"].is-in .ef-ktx__demo { animation: ef-ktx-wght calc(4s * var(--ef-ktx-k)) ease-in-out infinite; }\n@keyframes ef-ktx-wght {\n  0%, 100% { font-variation-settings: \"wght\" 300, \"opsz\" 20; }\n  50% { font-variation-settings: \"wght\" 900, \"opsz\" 100; }\n}\n\n/* 26 matrix formation */\n.ef-ktx .ef-ktx__rain { display: block; max-width: 100%; height: auto; }\n\n/* 27 word morph */\n.ef-ktx .ef-ktx__morph { position: relative; display: inline-block; min-width: 1px; }\n.ef-ktx .ef-ktx__morph .ef-ktx__demo { position: relative; white-space: nowrap; transition: opacity calc(1s * var(--ef-ktx-k)) ease, filter calc(1s * var(--ef-ktx-k)) ease; }\n.ef-ktx .ef-ktx__morph .ef-ktx__a { opacity: 1; filter: blur(0); }\n.ef-ktx .ef-ktx__morph .ef-ktx__b { position: absolute; left: 0; top: 0; opacity: 0; filter: blur(6px); }\n.ef-ktx .ef-ktx__morph.is-swap .ef-ktx__a { opacity: 0; filter: blur(6px); }\n.ef-ktx .ef-ktx__morph.is-swap .ef-ktx__b { opacity: 1; filter: blur(0); }\n\n/* 28 chromatic scroll */\n.ef-ktx[data-fx=\"chroma\"] .ef-ktx__demo { transition: text-shadow calc(.12s * var(--ef-ktx-k)) linear; }\n\n/* 29 gravity drop (160px, 8px and 4px at the default 42px size) */\n.ef-ktx[data-fx=\"gravity\"] .ef-ktx__ch { opacity: 0; transform: translateY(-3.81em); }\n.ef-ktx[data-fx=\"gravity\"].is-in .ef-ktx__ch { animation: ef-ktx-drop calc(.7s * var(--ef-ktx-k)) cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: calc(var(--d, 0ms) * var(--ef-ktx-k)); }\n@keyframes ef-ktx-drop {\n  0% { opacity: 0; transform: translateY(-3.81em); }\n  60% { opacity: 1; transform: translateY(.19em); }\n  80% { transform: translateY(-.095em); }\n  100% { opacity: 1; transform: translateY(0); }\n}\n\n/* off screen and reduced motion */\n.ef-ktx.is-paused * { animation-play-state: paused !important; }\n.ef-ktx.is-reduced *, .ef-ktx.is-reduced *::before, .ef-ktx.is-reduced *::after { transition: none !important; animation: none !important; }\n.ef-ktx.is-reduced[data-fx=\"gravity\"] .ef-ktx__ch { opacity: 1; transform: none; }\n@media (prefers-reduced-motion: reduce) {\n  .ef-ktx *, .ef-ktx *::before, .ef-ktx *::after { transition: none !important; animation: none !important; }\n}",
    "js": "// Enrichr Library · https://enrichr.dev\n// Kinetic type experiments: the five experimental studies from a kinetic type specimen book, one at a time (pick it with\n// effect). Variable weight: the word breathes between its thinnest and heaviest weight on a 4 s ease-in-out loop (the\n// font's axis tops out at 800). Matrix formation: a canvas of 22 px glyph rain, one row per frame at 60 frames a second,\n// each frame laid over the last at 35% so trails fade; the letters of the word lock in, every other column, on row four as\n// their column's drop reaches it. Word morph: two words swap every 2.2 s, each fading and blurring 6 px over 1 s.\n// Chromatic scroll: two coloured shadows split up to 8 px either side the further the element sits from the middle of the\n// screen, and close up at the centre. Gravity drop: letters fall 160 px, overshoot 8 px, bounce back 4 px and settle over\n// 0.7 s, start times spread over 420 ms. Matrix and gravity play when the element comes into view and again each time it\n// returns; replay() plays them on demand. Speed scales every duration. Reduced motion shows a still, finished frame of\n// each (the matrix as its locked word, no colour split). Loops pause off screen and in hidden tabs.\n// mount(root, { effect (varfont | matrix | morph | chroma | gravity), text, words (morph words, comma separated),\n//               speed (1 = original timing), size (px), color, accent, ghost (second split colour), background,\n//               label (1 shows the specimen label and hint, 0 hides them) })\nfunction mount(root, o) {\n  var reduce = !!(window.matchMedia && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches);\n  var box = root.querySelector(\".ef-ktx\");\n  var numEl = box.querySelector(\".ef-ktx__num\"), nameEl = box.querySelector(\".ef-ktx__name\");\n  var descEl = box.querySelector(\".ef-ktx__desc\"), tagEl = box.querySelector(\".ef-ktx__tag\"), hintEl = box.querySelector(\".ef-ktx__hint\");\n  var stage = box.querySelector(\".ef-ktx__stage\");\n  var CHARS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ#%&*+-/<>[]{}01\";\n  var AUTO = \"auto · repeats on view\", LOOP = \"continuous\";\n  var FX = {\n    varfont: [\"25\", \"Variable weight\", \"One font, breathing between its thinnest and heaviest self.\", LOOP, \"\"],\n    matrix: [\"26\", \"Matrix formation\", \"A field of falling characters locks into the word.\", AUTO, \"\"],\n    morph: [\"27\", \"Word morph\", \"One word dissolves as another takes its place.\", LOOP, \"\"],\n    chroma: [\"28\", \"Chromatic scroll\", \"Colour channels split apart near the edges of view, resolve at centre.\", \"\", \"scroll the page\"],\n    gravity: [\"29\", \"Gravity drop\", \"Letters fall, overshoot, and settle under their own weight.\", AUTO, \"\"]\n  };\n  var opts = {}, fx = \"\", text = \"\", demo = null, inView = false, visible = true, io = null, ro = null, destroyed = false;\n  var timers = [], clock = 0, last = 0, raf = 0, rain = null, words = [];\n  var fg = [251, 248, 241], bg = [12, 30, 24], ac = [230, 255, 85], gh = [229, 76, 30];\n\n  function num(v, d) { v = Number(v); return isFinite(v) ? v : d; }\n  function rgb(h, d) { var m = /^#?([0-9a-f]{6})$/i.exec(String(h || \"\")); var v = parseInt(m ? m[1] : d, 16); return [v >> 16, (v >> 8) & 255, v & 255]; }\n  function mix(a, b, t) { return \"rgb(\" + [0, 1, 2].map(function (i) { return Math.round(a[i] + (b[i] - a[i]) * t); }).join(\",\") + \")\"; }\n  function rgba(c, a) { return \"rgba(\" + c[0] + \",\" + c[1] + \",\" + c[2] + \",\" + a + \")\"; }\n  function randInt(a, b) { return Math.floor(Math.random() * (b - a + 1)) + a; }\n  function make(tag, cls, txt) { var e = document.createElement(tag); if (cls) e.className = cls; if (txt != null) e.textContent = txt; return e; }\n\n  // one clock for the morph timer and the matrix frames: it only runs on screen in a visible tab, scaled by speed\n  function tick(now) {\n    raf = 0;\n    var dt = Math.min(50, Math.max(0, now - last)); last = now;\n    if (visible && !document.hidden) {\n      clock += dt * opts.speed;\n      var list = timers.slice();\n      for (var i = 0; i < list.length; i++) {\n        var t = list[i], n = 0;\n        while (!t.dead && t.at <= clock && n++ < 4) { if (t.every) t.at += t.every; else t.dead = true; t.fn(t); }\n      }\n      timers = timers.filter(function (t) { return !t.dead; });\n    }\n    if (timers.length && !destroyed && visible) raf = requestAnimationFrame(tick);\n  }\n  function kick() { if (!raf && !destroyed && timers.length) { last = performance.now(); raf = requestAnimationFrame(tick); } }\n  function every(ms, fn) { var t = { at: clock + ms, every: ms, fn: fn }; timers.push(t); kick(); return t; }\n  function stopTimers() { timers.forEach(function (t) { t.dead = true; }); timers = []; }\n\n  // ---- 26 matrix formation: the original's maths on a canvas sized to fit the word (560 x 150 for short words) ----\n  function matrixSetup() {\n    var letters = Array.from(text), len = letters.length, cols = 25;\n    while (Math.floor(cols / 2 - len * 1.1 / 2) + (len - 1) * 2 > cols - 1) cols++;\n    var W = cols * 22 + 10, H = 150, dpr = Math.min(window.devicePixelRatio || 1, 2);\n    var c = make(\"canvas\", \"ef-ktx__rain\");\n    c.setAttribute(\"role\", \"img\"); c.setAttribute(\"aria-label\", \"Falling characters that lock into the word \" + text);\n    c.width = Math.round(W * dpr); c.height = Math.round(H * dpr); c.style.width = W + \"px\";\n    var ctx = c.getContext(\"2d\"); ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    rain = { c: c, ctx: ctx, W: W, H: H, cols: cols, letters: letters, drops: [], locked: [] };\n    return c;\n  }\n  function matrixReset() {\n    var r = rain, fs = 22;\n    r.drops = []; r.locked = [];\n    for (var c = 0; c < r.cols; c++) { r.drops.push(-randInt(0, 20)); r.locked.push(null); }\n    var startCol = Math.floor(r.cols / 2 - r.letters.length * 1.1 / 2);\n    for (var i = 0; i < r.letters.length; i++) {\n      var col = startCol + i * 2;\n      if (col >= 0 && col < r.cols) r.locked[col] = { ch: r.letters[i], row: 4 };\n    }\n    r.ctx.fillStyle = \"rgb(\" + bg + \")\"; r.ctx.fillRect(0, 0, r.W, r.H);\n    r.ctx.font = fs + \"px 'Fira Code', ui-monospace, monospace\";\n  }\n  function matrixFrame() {\n    var r = rain, fs = 22, ctx = r.ctx;\n    ctx.fillStyle = rgba(bg, 0.35);\n    ctx.fillRect(0, 0, r.W, r.H);\n    for (var c = 0; c < r.cols; c++) {\n      var x = c * fs, target = r.locked[c];\n      if (target && r.drops[c] >= target.row) {\n        ctx.fillStyle = \"rgb(\" + ac + \")\";\n        ctx.fillText(target.ch, x, target.row * fs);\n      } else {\n        ctx.fillStyle = rgba(fg, 0.55);\n        ctx.fillText(CHARS[randInt(0, CHARS.length - 1)], x, r.drops[c] * fs);\n        r.drops[c]++;\n        if (r.drops[c] * fs > r.H) r.drops[c] = 0;\n      }\n    }\n  }\n  function matrixStill() {\n    var r = rain, fs = 22, ctx = r.ctx;\n    matrixReset();\n    ctx.fillStyle = \"rgb(\" + ac + \")\";\n    r.locked.forEach(function (t, c) { if (t) ctx.fillText(t.ch, c * fs, t.row * fs); });\n  }\n\n  function chroma() {\n    if (fx !== \"chroma\" || !visible || reduce || !demo) return;\n    var r = box.getBoundingClientRect(), vh = window.innerHeight || document.documentElement.clientHeight;\n    var offset = Math.max(-1, Math.min(1, (r.top + r.height / 2 - vh / 2) / (vh / 2)));\n    var mag = Math.abs(offset) * 8;\n    demo.style.textShadow = offset * mag + \"px 0 \" + rgba(gh, 0.7) + \", \" + -offset * mag + \"px 0 \" + rgba(ac, 0.7);\n  }\n\n  function build() {\n    stopTimers();\n    fx = FX[opts.effect] ? opts.effect : \"varfont\";\n    var f = FX[fx];\n    box.setAttribute(\"data-fx\", fx);\n    box.classList.remove(\"is-in\");\n    numEl.textContent = f[0]; nameEl.textContent = f[1]; descEl.textContent = f[2];\n    tagEl.textContent = f[3]; tagEl.hidden = !f[3]; hintEl.textContent = f[4]; hintEl.hidden = !f[4];\n    text = String(opts.text == null ? \"\" : opts.text).replace(/\\s+/g, \" \").trim() || \"A LIVING AXIS\";\n    words = String(opts.words || \"\").split(\",\").map(function (w) { return w.trim(); }).filter(Boolean);\n    if (!words.length) words = [\"FORM\", \"FUNCTION\"];\n    stage.textContent = \"\"; rain = null; demo = null;\n    if (fx !== \"matrix\") stage.appendChild(make(\"span\", \"ef-ktx__sr\", fx === \"morph\" ? words.join(\", \") : text));\n    if (fx === \"matrix\") stage.appendChild(matrixSetup());\n    else if (fx === \"morph\") {\n      var wrap = make(\"span\", \"ef-ktx__morph\"); wrap.setAttribute(\"aria-hidden\", \"true\");\n      wrap.appendChild(make(\"span\", \"ef-ktx__demo ef-ktx__a\", words[0]));\n      wrap.appendChild(make(\"span\", \"ef-ktx__demo ef-ktx__b\", words[1 % words.length]));\n      stage.appendChild(wrap);\n    } else {\n      demo = make(\"span\", \"ef-ktx__demo\"); demo.setAttribute(\"aria-hidden\", \"true\");\n      if (fx === \"gravity\") {\n        var chars = Array.from(text), len = Math.max(chars.length - 1, 1), word = null;\n        chars.forEach(function (ch, i) {\n          if (/\\s/.test(ch)) { word = null; demo.appendChild(document.createTextNode(\" \")); return; }\n          if (!word) { word = make(\"span\", \"ef-ktx__w\"); demo.appendChild(word); }\n          var s = make(\"span\", \"ef-ktx__ch\", ch);\n          s.style.setProperty(\"--d\", (i / len * 420).toFixed(0) + \"ms\");\n          word.appendChild(s);\n        });\n      } else demo.textContent = text;\n      stage.appendChild(demo);\n    }\n    if (reduce) { box.classList.add(\"is-in\"); if (rain) matrixStill(); return; }\n    if (fx === \"morph\") startMorph();\n    if (fx === \"chroma\") chroma();\n    if (inView) play();\n  }\n  function startMorph() {\n    var wrap = stage.querySelector(\".ef-ktx__morph\"), a = wrap.firstChild, b = wrap.lastChild, cur = 0, onB = false;\n    every(2200, function () {\n      var next = (cur + 1) % words.length;\n      (onB ? a : b).textContent = words[next]; // the incoming word; with two words it is already there\n      onB = !onB; cur = next;\n      wrap.classList.toggle(\"is-swap\", onB);\n    });\n  }\n  function play() {\n    if (reduce || destroyed) return;\n    box.classList.remove(\"is-in\");\n    void box.offsetWidth; // commit the start state so the drop runs again\n    box.classList.add(\"is-in\");\n    if (rain) {\n      stopTimers();\n      matrixReset();\n      matrixFrame();\n      every(1000 / 60, matrixFrame);\n    }\n  }\n  function replay() { if (fx === \"morph\") build(); else play(); }\n\n  function paint() {\n    fg = rgb(opts.color, \"fbf8f1\"); bg = rgb(opts.background, \"0c1e18\"); ac = rgb(opts.accent, \"e6ff55\"); gh = rgb(opts.ghost, \"e54c1e\");\n    var s = box.style;\n    s.setProperty(\"--ef-ktx-fg\", \"rgb(\" + fg + \")\"); s.setProperty(\"--ef-ktx-fg-rgb\", fg.join(\",\"));\n    s.setProperty(\"--ef-ktx-bg\", \"rgb(\" + bg + \")\"); s.setProperty(\"--ef-ktx-bg-rgb\", bg.join(\",\"));\n    s.setProperty(\"--ef-ktx-top\", mix(bg, fg, 0.045)); s.setProperty(\"--ef-ktx-muted\", mix(bg, fg, 0.62));\n    s.setProperty(\"--ef-ktx-acc\", \"rgb(\" + ac + \")\"); s.setProperty(\"--ef-ktx-acc-rgb\", ac.join(\",\"));\n    s.setProperty(\"--ef-ktx-ghost-rgb\", gh.join(\",\"));\n    s.setProperty(\"--ef-ktx-k\", String(1 / opts.speed));\n    s.setProperty(\"--ef-ktx-size\", String(opts.size));\n    box.setAttribute(\"data-label\", opts.label ? \"1\" : \"0\");\n    box.classList.toggle(\"is-reduced\", reduce);\n  }\n  function update(partial) {\n    var prev = opts;\n    opts = Object.assign({ effect: \"varfont\", text: \"A LIVING AXIS\", words: \"FORM, FUNCTION\", speed: 1, size: 42, color: \"#fbf8f1\", accent: \"#e6ff55\", ghost: \"#e54c1e\", background: \"#0c1e18\", label: 1 }, opts, partial || {});\n    opts.speed = Math.min(5, Math.max(0.1, num(opts.speed, 1)));\n    opts.size = Math.max(10, num(opts.size, 42));\n    opts.label = !(opts.label === 0 || opts.label === \"0\" || opts.label === false || opts.label === \"off\");\n    paint();\n    if (destroyed) return;\n    if (!fx || prev.effect !== opts.effect || prev.text !== opts.text || prev.words !== opts.words) build();\n    else { chroma(); if (rain && reduce) matrixStill(); }\n  }\n\n  update(o);\n  window.addEventListener(\"scroll\", chroma, { passive: true });\n  window.addEventListener(\"resize\", chroma);\n  if (\"IntersectionObserver\" in window) {\n    io = new IntersectionObserver(function (es) {\n      es.forEach(function (e) {\n        visible = e.isIntersecting;\n        box.classList.toggle(\"is-paused\", !visible);\n        var vh = e.rootBounds ? e.rootBounds.height : window.innerHeight;\n        if (e.isIntersecting && (e.intersectionRatio >= 0.35 || e.boundingClientRect.height > vh * 0.8)) {\n          if (!inView) { inView = true; play(); }\n        } else if (!e.isIntersecting && inView) { inView = false; if (!reduce) box.classList.remove(\"is-in\"); }\n        if (visible) { kick(); chroma(); }\n      });\n    }, { threshold: [0, 0.35] });\n    io.observe(box);\n  } else { inView = true; play(); }\n  if (\"ResizeObserver\" in window) {\n    ro = new ResizeObserver(function () { if (destroyed) return; box.classList.toggle(\"is-narrow\", box.clientWidth < 520); chroma(); });\n    ro.observe(box);\n  }\n  function onVis() { if (!document.hidden) kick(); }\n  document.addEventListener(\"visibilitychange\", onVis);\n  return {\n    update: update,\n    replay: replay,\n    destroy: function () {\n      destroyed = true; stopTimers(); cancelAnimationFrame(raf); raf = 0;\n      window.removeEventListener(\"scroll\", chroma);\n      window.removeEventListener(\"resize\", chroma);\n      document.removeEventListener(\"visibilitychange\", onVis);\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n    }\n  };\n}"
  }
}