> ## Documentation Index
> Fetch the complete documentation index at: https://docs.framelane.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Motion Examples

> Request bodies for element and character motion presets.

Motion presets are set via the `motion` array on `video`, `image`, and `text` elements. Only fields that differ from their defaults are shown (`easing` defaults to `"ease_in_out"`, `reversed` defaults to `false`).

<Warning>
  For **text** and **image** elements, `duration` is required — the API returns `422` if it is missing. **`video` and `audio` elements have no `duration` field** — use `out_point` to control clip length.
</Warning>

## Fade in

Fade the element in over 0.5 seconds at the start. Text is visible from **1 s** to **5 s** over video. `time` on the motion object is **absolute timeline seconds** — the same clock as the element's own `time`. Match it to the element's `time` for entrances, and set it to `element time + duration − motion duration` for exits.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "id": "vid1",
      "source_url": "https://cdn.example.com/clip.mp4",
      "time": 0,
      "in_point": 0,
      "out_point": 10
    },
    {
      "type": "text",
      "id": "t1",
      "text": "Hello",
      "font_size": 72,
      "time": 1,
      "duration": 4,
      "x": "50%",
      "y": "50%",
      "motion": [
        { "type": "fade", "time": 1, "duration": 0.5 }
      ]
    }
  ]
}
```

## Fade out (reversed)

Use `"reversed": true` to play the exit variant of any motion preset. Text visible from **0 s** to **6 s**; the fade-out runs during the last second of that window.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "id": "vid1",
      "source_url": "https://cdn.example.com/clip.mp4",
      "time": 0,
      "in_point": 0,
      "out_point": 10
    },
    {
      "type": "text",
      "id": "t1",
      "text": "Goodbye",
      "font_size": 72,
      "time": 0,
      "duration": 6,
      "x": "50%",
      "y": "50%",
      "motion": [
        { "type": "fade", "time": 5, "duration": 1, "reversed": true, "easing": "ease_out" }
      ]
    }
  ]
}
```

## Position in (slide)

Text slides in at **2 s**, stays for **3 s**, anchored on the left side of the frame.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "id": "vid1",
      "source_url": "https://cdn.example.com/clip.mp4",
      "time": 0,
      "in_point": 0,
      "out_point": 10
    },
    {
      "type": "text",
      "id": "t1",
      "text": "SLIDE",
      "font_size": 72,
      "time": 2,
      "duration": 3,
      "x": "20%",
      "y": "50%",
      "motion": [
        { "type": "slide_right", "time": 2, "duration": 0.8 }
      ]
    }
  ]
}
```

## Ken Burns (video / image)

Slow pan and zoom on footage.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "source_url": "https://cdn.example.com/photo.mp4",
      "volume": 0,
      "motion": [
        { "type": "ken_burns_in", "time": 0, "duration": 10 }
      ]
    }
  ]
}
```

## Looping animation

Continuous motion while the element is visible. Text visible from **1 s** to **7 s**; set the loop preset `duration` to match the element's `duration`.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "id": "vid1",
      "source_url": "https://cdn.example.com/clip.mp4",
      "time": 0,
      "in_point": 0,
      "out_point": 10
    },
    {
      "type": "text",
      "id": "t1",
      "text": "ALERT",
      "font_size": 96,
      "time": 1,
      "duration": 6,
      "x": "50%",
      "y": "30%",
      "text_color": "#ff0000",
      "motion": [
        { "type": "loop_wiggle", "time": 1, "duration": 6 }
      ]
    }
  ]
}
```

## Per-character animation (text only)

Animate each character individually with `"scope": "character"`. Only supported on `text` elements. Text visible from **0.5 s** to **4.5 s**.

Supported types: `fade`, `slide_up`, `slide_down`, `slide_left`, `slide_right`, `zoom_in`, `bounce`, `bounce_motion`, `blend`.

```json theme={null}
{
  "width": 1920,
  "height": 1080,
  "duration": 10,
  "elements": [
    {
      "type": "video",
      "id": "vid1",
      "source_url": "https://cdn.example.com/clip.mp4",
      "time": 0,
      "in_point": 0,
      "out_point": 10
    },
    {
      "type": "text",
      "id": "t1",
      "text": "WAVE",
      "font_size": 96,
      "time": 0.5,
      "duration": 4,
      "x": "50%",
      "y": "60%",
      "motion": [
        {
          "type": "bounce",
          "time": 0.5,
          "duration": 1,
          "scope": "character",
          "delay": 0.05
        }
      ]
    }
  ]
}
```

## All motion types

Types marked **both** have an exit variant — add `"reversed": true` to play the exit. Types marked **exit only** set `reversed` automatically and never need it in the request.

### Opacity

| `type` | Direction                        | Description        |
| ------ | -------------------------------- | ------------------ |
| `fade` | both — `reversed: true` for exit | Fade in / fade out |

### Position

| `type`        | Direction                        | Description                               |
| ------------- | -------------------------------- | ----------------------------------------- |
| `slide_up`    | both — `reversed: true` for exit | Slide in from below / out upward          |
| `slide_down`  | both — `reversed: true` for exit | Slide in from above / out downward        |
| `slide_left`  | both — `reversed: true` for exit | Slide in from the right / out to the left |
| `slide_right` | both — `reversed: true` for exit | Slide in from the left / out to the right |

### Scale & bounce

| `type`     | Direction                        | Description                  |
| ---------- | -------------------------------- | ---------------------------- |
| `zoom_in`  | entrance only                    | Scale up into view           |
| `zoom_out` | exit only — auto-reversed        | Scale down out of view       |
| `bounce`   | both — `reversed: true` for exit | Bouncy scale entrance / exit |

### Wipe

| `type`       | Direction                        | Description                              |
| ------------ | -------------------------------- | ---------------------------------------- |
| `wipe_left`  | both — `reversed: true` for exit | Wipe reveal from right / conceal to left |
| `wipe_right` | both — `reversed: true` for exit | Wipe reveal from left / conceal to right |
| `wipe_up`    | both — `reversed: true` for exit | Wipe reveal from bottom / conceal upward |
| `wipe_down`  | both — `reversed: true` for exit | Wipe reveal from top / conceal downward  |

### Rotation

| `type`       | Direction                        | Description                         |
| ------------ | -------------------------------- | ----------------------------------- |
| `rotate_cw`  | both — `reversed: true` for exit | Clockwise rotation in / out         |
| `rotate_ccw` | both — `reversed: true` for exit | Counter-clockwise rotation in / out |

### Ken Burns (video / image only)

| `type`             | Direction     | Description      |
| ------------------ | ------------- | ---------------- |
| `ken_burns_in`     | entrance only | Slow zoom in     |
| `ken_burns_out`    | entrance only | Slow zoom out    |
| `ken_burns_in_out` | entrance only | Zoom in then out |

### Looping

| `type`               | Description                                   |
| -------------------- | --------------------------------------------- |
| `loop_wiggle`        | Quick shake — like AE's `wiggle()` expression |
| `loop_rotate`        | Continuous rotation                           |
| `loop_rotate_smooth` | Smooth continuous rotation                    |
| `loop_3d_spin`       | 3D spin                                       |
| `loop_3d_sway`       | 3D sway                                       |
