{
  "id": "hazard-stripe-warp",
  "kind": "element",
  "title": "Hazard stripe warp",
  "summary": "Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.",
  "url": "https://enrichr.dev/elements/hazard-stripe-warp.html",
  "section": "background",
  "techniques": [
    "webgl"
  ],
  "stack": [
    "Vanilla JS",
    "WebGL"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "bold",
    "energetic"
  ],
  "intents": [
    "hazard stripes background",
    "animated warning stripes",
    "wavy stripe shader background",
    "distorted stripes webgl",
    "construction tape animated background"
  ],
  "status": "tested",
  "params": [
    {
      "key": "flowSpeed",
      "label": "Stripe flow speed (per frame)",
      "type": "range",
      "min": 0,
      "max": 0.002,
      "step": 0.00001,
      "value": 0.0003
    },
    {
      "key": "waveSpeed",
      "label": "Wave speed (per frame)",
      "type": "range",
      "min": 0,
      "max": 0.01,
      "step": 0.0001,
      "value": 0.002
    },
    {
      "key": "waveIntensity",
      "label": "Wave strength",
      "type": "range",
      "min": 0,
      "max": 0.5,
      "step": 0.001,
      "value": 0.05
    },
    {
      "key": "turbIntensity",
      "label": "Turbulence strength",
      "type": "range",
      "min": 0,
      "max": 0.5,
      "step": 0.001,
      "value": 0.05
    },
    {
      "key": "turbSpeed",
      "label": "Turbulence speed",
      "type": "range",
      "min": 0,
      "max": 0.2,
      "step": 0.001,
      "value": 0.02
    },
    {
      "key": "stripeAngle",
      "label": "Stripe angle (radians)",
      "type": "range",
      "min": 0,
      "max": 6.28,
      "step": 0.01,
      "value": 0.78
    },
    {
      "key": "stripeScale",
      "label": "Stripe scale (low = bolder)",
      "type": "range",
      "min": 0.5,
      "max": 8,
      "step": 0.1,
      "value": 2
    },
    {
      "key": "stripe",
      "label": "Stripe colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "background",
      "label": "Gap colour",
      "type": "color",
      "value": "#0c1e18"
    }
  ],
  "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 \"Hazard stripe warp\" element to this project.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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/hazard-stripe-warp.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 \"Hazard stripe warp\" 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 \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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 \"Hazard stripe warp\" element to this codebase.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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-hazard-stripe-warp.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Hazard stripe warp 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 \"Hazard stripe warp\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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- hazard-stripe-warp.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 \"./hazard-stripe-warp\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HazardStripeWarp(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 \"Hazard stripe warp\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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- hazard-stripe-warp.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/HazardStripeWarp.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./hazard-stripe-warp\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HazardStripeWarp(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 \"Hazard stripe warp\" element.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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), hazard-stripe-warp.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 \"Hazard stripe warp\" element. No packages, no server code.\n\nThis is the \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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 hazard-stripe-warp.js and then main.js), style.css (the CSS below), hazard-stripe-warp.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 \"Hazard stripe warp\" 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 \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.json\n\nWhat it does: A flat grid of 128 by 128 squares (32,768 triangles, built in code) is stretched to eight times the size of the screen, so only its middle shows. The vertex shader moves every point twice: up and down by a sine of its x position plus the wave clock, then sideways by a sine of its new y position plus the turbulence clock. The fragment shader turns the grid's texture coordinates by the stripe angle, slides them by the flow clock, and colours each pixel by whether the fractional part of x plus y, times the stripe scale, is above or below one half, which gives hard edges. The flow and wave clocks step forward by their own speed every frame and the turbulence clock by 0.01, scaled to 60 frames a second. Before each clock reaches the GPU it is wrapped by its own repeat length, so the picture is the same but the numbers stay small however long the page stays open.\nAccessibility: The canvas is decorative and has a text label. With prefers-reduced-motion it draws one still frame (the state after three seconds) and never animates. Nothing flashes: at the default speeds a stripe takes many seconds to cross. Nothing here needs keyboard input.\n\nTunable settings:\n- Stripe flow speed (per frame): range 0 to 0.002, step 0.00001, default 0.0003\n- Wave speed (per frame): range 0 to 0.01, step 0.0001, default 0.002\n- Wave strength: range 0 to 0.5, step 0.001, default 0.05\n- Turbulence strength: range 0 to 0.5, step 0.001, default 0.05\n- Turbulence speed: range 0 to 0.2, step 0.001, default 0.02\n- Stripe angle (radians): range 0 to 6.28, step 0.01, default 0.78\n- Stripe scale (low = bolder): range 0.5 to 8, step 0.1, default 2\n- Stripe colour: color, default #e6ff55\n- Gap colour: color, default #0c1e18\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/hazard-stripe-warp.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 \"Hazard stripe warp\" 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 \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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 HazardStripeWarp.\n2. Paste the JavaScript below into a separate code file named hazard-stripe-warp.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 \"./hazard-stripe-warp\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function HazardStripeWarp(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(HazardStripeWarp, {\n  flowSpeed: { type: ControlType.Number, title: \"Stripe flow speed\", min: 0, max: 0.002, step: 0.00001, defaultValue: 0.0003 },\n  waveSpeed: { type: ControlType.Number, title: \"Wave speed\", min: 0, max: 0.01, step: 0.0001, defaultValue: 0.002 },\n  waveIntensity: { type: ControlType.Number, title: \"Wave strength\", min: 0, max: 0.5, step: 0.001, defaultValue: 0.05 },\n  turbIntensity: { type: ControlType.Number, title: \"Turbulence strength\", min: 0, max: 0.5, step: 0.001, defaultValue: 0.05 },\n  turbSpeed: { type: ControlType.Number, title: \"Turbulence speed\", min: 0, max: 0.2, step: 0.001, defaultValue: 0.02 },\n  stripeAngle: { type: ControlType.Number, title: \"Stripe angle\", min: 0, max: 6.28, step: 0.01, defaultValue: 0.78 },\n  stripeScale: { type: ControlType.Number, title: \"Stripe scale\", min: 0.5, max: 8, step: 0.1, defaultValue: 2 },\n  stripe: { type: ControlType.Color, title: \"Stripe colour\", defaultValue: \"#e6ff55\" },\n  background: { type: ControlType.Color, title: \"Gap colour\", defaultValue: \"#0c1e18\" },\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 \"Hazard stripe warp\" 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 \"Hazard stripe warp\" element from the Enrichr Library: Bold two-colour hazard stripes that slide sideways while the whole surface bends in a slow wave and a quicker sideways turbulence.\nPage: https://enrichr.dev/elements/hazard-stripe-warp.html\nMachine-readable spec: https://enrichr.dev/elements/hazard-stripe-warp.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-hazard-stripe-warp\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-hazard-stripe-warp\"), { ...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 canvas is decorative and has a text label. With prefers-reduced-motion it draws one still frame (the state after three seconds) and never animates. Nothing flashes: at the default speeds a stripe takes many seconds to cross. Nothing here needs keyboard input.",
  "performance": "One draw call a frame: about 16,600 points and 32,800 triangles moved on the GPU, and a fragment shader with one cosine, one sine and a fract per pixel. The pixel ratio is capped at 2, the loop pauses off screen and in hidden tabs, and destroy() frees the buffers and the WebGL context. Without WebGL a CSS repeating gradient shows the same stripes, still.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/KwWbBrK",
  "source": {
    "markup": "<div class=\"ef-hzw\"><canvas class=\"ef-hzw__c\" role=\"img\" aria-label=\"Bold lime and dark green hazard stripes that slide sideways while the whole surface bends in a slow wave\"></canvas></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-hzw { position: relative; width: 100%; min-height: 22rem; overflow: hidden; border-radius: 1rem; background: var(--ef-hzw-b, #0c1e18) repeating-linear-gradient(180deg, var(--ef-hzw-a, #e6ff55) 0 17.7%, var(--ef-hzw-b, #0c1e18) 17.7% 35.4%); }\n.ef-hzw .ef-hzw__c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Hazard stripe warp: bold two-colour stripes that slide sideways while the whole surface bends in a slow sine wave and a\n// quicker sideways turbulence. Raw WebGL1, no libraries: a 128 x 128 segment plane (indexed triangles, built here, 8 units\n// wide in clip space so only its middle shows) whose vertices are moved in the vertex shader, and a fragment shader that\n// rotates the plane's texture coordinates and draws hard-edged stripes from them.\n// Three clocks drive it, as in the original pen: the stripe flow and the wave each step forward by their own speed every\n// frame, and the turbulence clock steps by 0.01 a frame and is multiplied by the turbulence speed. Steps are scaled to\n// 60 frames a second, so the motion is the same on fast and slow screens.\n// Reduced motion draws one still frame (the state after three seconds). The loop pauses off screen and in hidden tabs.\n// Without WebGL the CSS stripe gradient stays.\n// mount(root, { flowSpeed (stripe slide per frame), waveSpeed (wave clock per frame), waveIntensity (wave height),\n//               turbIntensity (turbulence width), turbSpeed (turbulence rate), stripeAngle (radians),\n//               stripeScale (stripe count, low = bolder), stripe (stripe colour), background (gap colour) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-hzw\");\n  var canvas = root.querySelector(\".ef-hzw__c\");\n  var opts = {}, raf = 0, visible = true, io = null, ro = null, destroyed = false, last = 0;\n  var gl = null, prog = null, vb = null, ib = null, u = {}, nIdx = 0, ok = false;\n  var flowTime = 0, waveTime = 0, turbTime = 0, SEG = 128, SIZE = 8, TAU = Math.PI * 2;\n  var DEF = { flowSpeed: 0.0003, waveSpeed: 0.002, waveIntensity: 0.05, turbIntensity: 0.05, turbSpeed: 0.02, stripeAngle: 0.78, stripeScale: 2, stripe: \"#e6ff55\", background: \"#0c1e18\" };\n\n  // the original pen's two shaders, unchanged except that the colours are uniforms\n  var VS = \"attribute vec2 aPos;attribute vec2 aUv;varying vec2 vUv;\" +\n    \"uniform float uWaveTime;uniform float uTurbTime;uniform float uWaveIntensity;uniform float uTurbIntensity;uniform float uTurbSpeed;\" +\n    \"void main(){vUv=aUv;vec3 pos=vec3(aPos,0.0);\" +\n    \"pos.y+=sin(pos.x*2.0+uWaveTime*5.0)*uWaveIntensity;\" +\n    \"pos.x+=sin(pos.y*5.0+uTurbTime*uTurbSpeed*10.0)*uTurbIntensity;\" +\n    \"gl_Position=vec4(pos,1.0);}\";\n  var FS = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\nprecision highp float;\\n#else\\nprecision mediump float;\\n#endif\\n\" +\n    \"uniform float uFlowTime;uniform float uStripeAngle;uniform float uStripeScale;uniform vec3 uA;uniform vec3 uB;varying vec2 vUv;\" +\n    \"void main(){float c=cos(uStripeAngle);float s=sin(uStripeAngle);mat2 rot=mat2(c,-s,s,c);\" +\n    \"vec2 uv=(vUv-0.5)*4.0;uv=rot*uv;uv.x+=uFlowTime;\" +\n    \"float stripe=fract((uv.x+uv.y)*uStripeScale);\" +\n    \"vec3 color=stripe>0.5?uA:uB;gl_FragColor=vec4(color,1.0);}\";\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(h || \"\"); var v = parseInt(m ? m[1] : d, 16); return [(v >> 16) / 255, ((v >> 8) & 255) / 255, (v & 255) / 255]; }\n  function sh(type, src) { var s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return gl.getShaderParameter(s, gl.COMPILE_STATUS) ? s : null; }\n\n  function setup() {\n    var v = sh(gl.VERTEX_SHADER, VS), f = sh(gl.FRAGMENT_SHADER, FS);\n    if (!v || !f) return false;\n    prog = gl.createProgram(); gl.attachShader(prog, v); gl.attachShader(prog, f); gl.linkProgram(prog);\n    gl.deleteShader(v); gl.deleteShader(f);\n    if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) return false;\n    gl.useProgram(prog);\n    // the plane, laid out like a three.js PlaneGeometry(8, 8, 128, 128): rows from top to bottom, uv.y = 1 at the top\n    var n = SEG + 1, data = new Float32Array(n * n * 4), idx = new Uint16Array(SEG * SEG * 6), k = 0, ix, iy;\n    for (iy = 0; iy < n; iy++) for (ix = 0; ix < n; ix++) {\n      data[k++] = ix / SEG * SIZE - SIZE / 2; data[k++] = SIZE / 2 - iy / SEG * SIZE;\n      data[k++] = ix / SEG; data[k++] = 1 - iy / SEG;\n    }\n    k = 0;\n    for (iy = 0; iy < SEG; iy++) for (ix = 0; ix < SEG; ix++) {\n      var a = ix + n * iy, b = ix + n * (iy + 1), c = ix + 1 + n * (iy + 1), d = ix + 1 + n * iy;\n      idx[k++] = a; idx[k++] = b; idx[k++] = d; idx[k++] = b; idx[k++] = c; idx[k++] = d;\n    }\n    nIdx = k;\n    vb = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vb); gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n    ib = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ib); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, idx, gl.STATIC_DRAW);\n    var lp = gl.getAttribLocation(prog, \"aPos\"), lu = gl.getAttribLocation(prog, \"aUv\");\n    gl.enableVertexAttribArray(lp); gl.vertexAttribPointer(lp, 2, gl.FLOAT, false, 16, 0);\n    gl.enableVertexAttribArray(lu); gl.vertexAttribPointer(lu, 2, gl.FLOAT, false, 16, 8);\n    [\"uWaveTime\", \"uTurbTime\", \"uWaveIntensity\", \"uTurbIntensity\", \"uTurbSpeed\", \"uFlowTime\", \"uStripeAngle\", \"uStripeScale\", \"uA\", \"uB\"].forEach(function (key) { u[key] = gl.getUniformLocation(prog, key); });\n    return true;\n  }\n\n  function size() {\n    var dpr = Math.min(window.devicePixelRatio || 1, 2);\n    var w = Math.max(1, Math.round(wrap.clientWidth * dpr)), h = Math.max(1, Math.round(wrap.clientHeight * dpr));\n    if (canvas.width !== w || canvas.height !== h) { canvas.width = w; canvas.height = h; gl.viewport(0, 0, w, h); }\n  }\n  // the clocks are wrapped by their own period before they reach the GPU: the picture is identical, and float\n  // precision stays good however long the page is open\n  function wrapT(t, period) { return period > 0 && isFinite(period) ? t % period : t; }\n  function draw() {\n    if (!ok || destroyed || gl.isContextLost()) return;\n    size();\n    gl.uniform1f(u.uFlowTime, wrapT(flowTime, 1 / opts.stripeScale));\n    gl.uniform1f(u.uWaveTime, wrapT(waveTime, TAU / 5));\n    gl.uniform1f(u.uTurbTime, wrapT(turbTime, opts.turbSpeed > 0 ? TAU / (opts.turbSpeed * 10) : 0));\n    gl.uniform1f(u.uTurbSpeed, opts.turbSpeed);\n    gl.uniform1f(u.uWaveIntensity, opts.waveIntensity);\n    gl.uniform1f(u.uTurbIntensity, opts.turbIntensity);\n    gl.uniform1f(u.uStripeAngle, opts.stripeAngle);\n    gl.uniform1f(u.uStripeScale, opts.stripeScale);\n    gl.uniform3fv(u.uA, rgb(opts.stripe, \"e6ff55\"));\n    gl.uniform3fv(u.uB, rgb(opts.background, \"0c1e18\"));\n    gl.drawElements(gl.TRIANGLES, nIdx, gl.UNSIGNED_SHORT, 0);\n  }\n  function advance(frames) {\n    flowTime += opts.flowSpeed * frames;\n    waveTime += opts.waveSpeed * frames;\n    turbTime += 0.01 * frames;\n  }\n  function still() { flowTime = 0; waveTime = 0; turbTime = 0; advance(180); draw(); }\n\n  function loop(now) {\n    raf = requestAnimationFrame(loop);\n    var dt = Math.min(0.1, Math.max(0, (now - last) / 1000)); last = now;\n    if (!visible || document.hidden) return;\n    advance(dt * 60);\n    draw();\n  }\n\n  function update(partial) {\n    opts = Object.assign({}, DEF, opts, partial || {});\n    opts.flowSpeed = num(opts.flowSpeed, DEF.flowSpeed); opts.waveSpeed = num(opts.waveSpeed, DEF.waveSpeed);\n    opts.waveIntensity = num(opts.waveIntensity, DEF.waveIntensity); opts.turbIntensity = num(opts.turbIntensity, DEF.turbIntensity);\n    opts.turbSpeed = num(opts.turbSpeed, DEF.turbSpeed); opts.stripeAngle = num(opts.stripeAngle, DEF.stripeAngle);\n    opts.stripeScale = Math.max(0.01, num(opts.stripeScale, DEF.stripeScale));\n    wrap.style.setProperty(\"--ef-hzw-a\", opts.stripe);\n    wrap.style.setProperty(\"--ef-hzw-b\", opts.background);\n    if (destroyed) return;\n    if (reduce) still(); else draw();\n  }\n  function onLost(e) { e.preventDefault(); canvas.style.display = \"none\"; }\n\n  try { gl = canvas.getContext(\"webgl\", { antialias: false, alpha: false, powerPreference: \"low-power\" }); } catch (e) { gl = null; }\n  ok = !!gl && setup();\n  if (!ok) canvas.style.display = \"none\";\n  else canvas.addEventListener(\"webglcontextlost\", onLost);\n  update(o);\n  if (ok) {\n    if (!reduce) {\n      if (\"IntersectionObserver\" in window) { io = new IntersectionObserver(function (e) { visible = e[0].isIntersecting; }); io.observe(wrap); }\n      last = performance.now(); raf = requestAnimationFrame(loop);\n    }\n    if (\"ResizeObserver\" in window) { ro = new ResizeObserver(function () { if (!destroyed) draw(); }); ro.observe(wrap); }\n  }\n  return {\n    update: update,\n    destroy: function () {\n      destroyed = true; cancelAnimationFrame(raf);\n      if (io) io.disconnect();\n      if (ro) ro.disconnect();\n      canvas.removeEventListener(\"webglcontextlost\", onLost);\n      if (gl) {\n        var ext = gl.getExtension(\"WEBGL_lose_context\");\n        if (vb) gl.deleteBuffer(vb); if (ib) gl.deleteBuffer(ib); if (prog) gl.deleteProgram(prog);\n        if (ext) ext.loseContext();\n        gl = null;\n      }\n    }\n  };\n}"
  }
}