{
  "$schema": "../../schema.json",
  "id": "word-rise",
  "type": "text",
  "title": "Word rise",
  "summary": "Words rise one by one from behind a mask line.",
  "tags": [
    "text",
    "neutral",
    "editorial"
  ],
  "version": "1.0.0",
  "license": "MIT",
  "export": "wordRise",
  "signature": "wordRise(el, t, { start, each, duration, curve })",
  "params": [
    {
      "name": "start",
      "type": "number",
      "default": 0,
      "description": "start time in seconds",
      "hidden": true
    },
    {
      "name": "each",
      "type": "number",
      "default": 0.08,
      "description": "delay between items (s)",
      "min": 0,
      "max": 0.3,
      "step": 0.005,
      "group": "main"
    },
    {
      "name": "duration",
      "type": "number",
      "default": 0.5,
      "description": "length of the transition in seconds; springs use it to keep their feel",
      "min": 0.2,
      "max": 3,
      "step": 0.05,
      "group": "main"
    },
    {
      "name": "curve",
      "type": "function",
      "default": "ease.outExpo",
      "description": "easing function (from `ease`)",
      "control": "ease",
      "group": "main"
    }
  ],
  "install": {
    "kind": "code"
  },
  "files": [
    {
      "path": "moves/word-rise.js",
      "content": "import { ease, progress } from 'paper-motion';\nimport { words } from 'paper-motion/kit';\n\n/** Words rise one by one from behind a mask line. */\nexport function wordRise(el, t, { start = 0, each = 0.08, duration = 0.5, curve = ease.outExpo } = {}) {\n  words(el).forEach((w, i) => {\n    const q = curve(progress(t, start + i * each, start + i * each + duration));\n    // fully below the mask line, and hidden until it moves: tall glyphs overflow a tight line-height box\n    w.style.transform = `translateY(${(1 - q) * 125}%)`;\n    w.style.opacity = q > 0.001 ? 1 : 0;\n  });\n}\n"
    }
  ],
  "requires": {
    "engine": ">=0.2.0"
  },
  "usage": "import { wordRise } from './moves/word-rise.js';\n\ns.update((t) => wordRise(el, t, { start: 0.5 }));",
  "notes": [
    "Words rise one by one from behind a mask line."
  ],
  "preview": {
    "video": "previews/word-rise.webm",
    "poster": "previews/word-rise.jpg"
  },
  "mood": [
    "calm",
    "editorial",
    "minimal",
    "warm"
  ],
  "energy": 2,
  "role": "text",
  "when": [
    "the neutral default for titles",
    "words should arrive one by one with weight"
  ]
}