{
  "schemaVersion": 1,
  "id": "glitch-text",
  "version": "1.0.0",
  "status": "published",
  "kind": "text",
  "title": "Glitch Text",
  "summary": "A title that glitches like a failing signal: red and cyan channels tear apart, slices jump sideways and a scan line sweeps. Loops perfectly.",
  "description": "A title that glitches like a failing signal. Most of the time it sits steady with a faint red-and-cyan fringe; in short bursts the colour channels tear apart, horizontal slices of the text jump sideways, a scan line sweeps down and the letters flicker. Bursts fall on fixed steps of the loop and every random choice is seeded, so the glitch is identical every time and the last frame is the first. Type the words, choose the colours (rgb, acid, amber or mono), how violent the bursts are, how many steps per loop, the seed and the backdrop colour.",
  "role": "Text scene (Canvas 2D): the cyberpunk, VHS and tech-horror title.",
  "collections": [
    "kinetic-text",
    "hypnotic-loops"
  ],
  "tags": [
    "glitch",
    "glitch text",
    "rgb split",
    "chromatic aberration",
    "cyberpunk",
    "vhs",
    "signal",
    "distortion",
    "title",
    "text animation"
  ],
  "synonyms": [
    "glitch effect",
    "digital distortion text",
    "chromatic split",
    "corrupted text",
    "tv static title",
    "datamosh title"
  ],
  "useCases": [
    "A cyberpunk, gaming or tech-horror title",
    "A music video or trailer intro",
    "A transition-style title for a glitchy edit"
  ],
  "featured": null,
  "publishedAt": "2026-10-08",
  "implementation": {
    "target": "canvas2d",
    "runtime": "browser",
    "language": "javascript",
    "module": "esm",
    "entry": "src/glitch-text.js",
    "exports": [
      {
        "name": "createGlitchText",
        "signature": "createGlitchText({ text?, theme?, intensity?, steps?, seed?, maxWidth?, fontFamily? }) => { draw(ctx, info, width, height) }",
        "description": "Canvas 2D text layer; info.progress (0 to 1 over the loop) sets the step; draws on top of the canvas."
      },
      {
        "name": "THEMES",
        "signature": "THEMES: { rgb, acid, amber, mono }",
        "description": "Channel colours."
      }
    ],
    "reusable": [
      "src/glitch-text.js"
    ],
    "demo": "demo.js",
    "harness": "index.html"
  },
  "dependencies": [
    {
      "id": "apw-runtime",
      "version": "1.0.0",
      "scope": "demo",
      "reason": "Demo harness. The reusable source has no dependencies."
    }
  ],
  "params": [
    {
      "key": "text",
      "label": "Text",
      "type": "text",
      "default": "SIGNAL LOST",
      "maxLength": 20,
      "sensitive": true
    },
    {
      "key": "theme",
      "label": "Colours",
      "type": "select",
      "default": "rgb",
      "options": [
        {
          "value": "rgb",
          "label": "Red and cyan"
        },
        {
          "value": "acid",
          "label": "Acid"
        },
        {
          "value": "amber",
          "label": "Amber and blue"
        },
        {
          "value": "mono",
          "label": "Mono"
        }
      ]
    },
    {
      "key": "intensity",
      "label": "Intensity",
      "type": "number",
      "min": 0.3,
      "max": 2,
      "step": 0.1,
      "default": 1
    },
    {
      "key": "steps",
      "label": "Steps per loop",
      "type": "integer",
      "min": 24,
      "max": 120,
      "step": 4,
      "default": 60
    },
    {
      "key": "seed",
      "label": "Seed",
      "type": "integer",
      "min": 1,
      "max": 999,
      "step": 1,
      "default": 5
    },
    {
      "key": "background",
      "label": "Backdrop",
      "type": "color",
      "default": "#07080c"
    }
  ],
  "presets": [
    {
      "id": "default",
      "label": "Red and cyan",
      "params": {}
    },
    {
      "id": "acid",
      "label": "Acid, violent",
      "params": {
        "theme": "acid",
        "intensity": 1.8,
        "text": "SYSTEM FAILURE",
        "background": "#0a0612"
      }
    },
    {
      "id": "amber",
      "label": "Amber, calm",
      "params": {
        "theme": "amber",
        "intensity": 0.6,
        "text": "TRANSMISSION",
        "background": "#0c0905"
      }
    },
    {
      "id": "mono",
      "label": "Mono, fast",
      "params": {
        "theme": "mono",
        "steps": 112,
        "text": "NO SIGNAL",
        "background": "#0a0a0c"
      }
    }
  ],
  "output": {
    "width": 1080,
    "height": 1080,
    "fps": 30,
    "durationSeconds": 6,
    "posterSeconds": 2.1,
    "alpha": false,
    "motion": "procedural",
    "loop": {
      "seamless": true,
      "cycleSeconds": 6,
      "method": "Glitch steps are a whole number per loop and each step's burst, slices and flicker come from a seeded hash of the step, so the last frame meets the first."
    },
    "seed": {
      "param": "seed",
      "behavior": "Seed decides which steps burst and how: same seed, same glitches."
    }
  },
  "composition": {
    "inputs": "Canvas 2D context, info.progress (0 to 1 over the loop), width, height.",
    "outputs": "Draws the text and scan lines on top of the canvas; does not clear it.",
    "coordinates": "Centred; the line is scaled to 80% of the width; offsets scale with the smaller side of the canvas.",
    "lighting": "The channels are blended additively, so overlaps brighten like light.",
    "timing": "Pure function of info.progress; every random value is a hash of the step number.",
    "compatibleWith": [
      "kinetic-title",
      "gradient-background"
    ],
    "notes": [
      "Bursts come in runs of one to four steps so that they read as glitches rather than noise.",
      "Text is treated as private: it is not stored in shared packs unless you choose to include it."
    ]
  },
  "reuse": [
    "Gaming title: Red and cyan.",
    "Hacker scene: Acid, violent.",
    "Vintage broadcast: Amber, calm."
  ],
  "integration": {
    "newProject": "Create the glitch once, then each frame draw your backdrop and call glitch.draw(ctx, { progress }, width, height).",
    "existingProject": "Copy src/glitch-text.js. Call draw on your existing 2D canvas after the rest of the frame."
  },
  "performance": {
    "notes": "Up to nine text draws and a few hundred scan-line rectangles per frame; about 2 ms.",
    "limits": "One line only; best under about 16 characters."
  },
  "limitations": [
    "System fonts differ between computers; pass fontFamily and load the font first for identical renders.",
    "Rapid flicker can be uncomfortable for some viewers; lower the intensity for sensitive audiences."
  ],
  "license": {
    "spdx": "MIT",
    "notice": "Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.",
    "thirdParty": []
  },
  "provenance": "Original code written for AI Pixel Wizard in October 2026, to the catalog quality bar (docs/QUALITY.md).",
  "changelog": [
    {
      "version": "1.0.0",
      "date": "2026-10-08",
      "notes": "Initial release."
    }
  ]
}
