# Before / after slider: Frame element for AI agents

> Then vs now on your own shot (F031, restyled): a cream divider with a green round handle sweeps in; everything left of it turns black and white, with mono BEFORE / AFTER labels either side of the handle.

Canonical page: https://agentframes.ai/elements/masthead/before-after/
Markdown: https://agentframes.ai/elements/masthead/before-after.md

## Overview

- Name: Before / after slider (`beforeAfter`), an element: one HyperFrames block per size
- Part of: the [Masthead](https://agentframes.ai/packs/masthead.md) pack (28 of 64). Available only through the All-access subscription.
- Category: Frame
- Purpose: Then vs now on your own shot (F031, restyled): a cream divider with a green round handle sweeps in; everything left of it turns black and white, with mono BEFORE / AFTER labels either side of the handle.
- Pack: [Masthead](https://agentframes.ai/packs/masthead.md), included in All-access (from $14/month billed annually ($168/year), or $19 monthly); this pack is Coming soon
- Subscribe: POST https://agentframes.ai/api/checkout/subscribe with interval=month or interval=year (optional currency=USD|GBP|EUR|AUD|CAD; 303 redirect to Stripe checkout; a human pays there). Then download any pack with the subscriber key: https://agentframes.ai/account.md
- Aspects: 16:9 (native), 9:16 (native), 4:5 (native), 1:1 (native)
- Canvases: works on none; avoid none
- Typical duration: 4.5s
- Speaker-safe: yes (can sit beside a speaker)
- Preview video (watermarked): https://agentframes.ai/media/masthead/before-after.mp4
- Poster: https://agentframes.ai/media/masthead/before-after.jpg
- Licence: [AgentFrames Licence](https://agentframes.ai/licence.md)

## Paste this into Claude Code

```text
Use the AgentFrames Masthead pack. Add a `beforeAfter` beat to plan.json on a `k` canvas with slots `before`, `after`, `split` and `at` from my script. Then run validate → build → qa and show me qa/contact.jpg.
```

## Variables

| Variable | Type | Label | Description | Default |
|---|---|---|---|---|
| `before` | string | before | {"type":"string","maxLength":12} | before |
| `after` | string | after | {"type":"string","maxLength":12} | after |
| `split` | number | split | {"type":"number","minimum":0.2,"maximum":0.8} | 0.5 |
| `at` | string | at | JSON string. {"type":"object","description":"optional land times in block seconds: {sweep}","properties":{"sweep":{"type":"number","minimum":0}}} |  |

## What your agent can change

**Before / after slider**. Native 1920×1080, 4.5s at 30fps. Sits over the creator's footage (transparent outside its own parts).

Then vs now on your own shot (F031, restyled): a cream divider with a green round handle sweeps in; everything left of it turns black and white, with mono BEFORE / AFTER labels either side of the handle.

**Motion.** The divider sweeps in from the right (0.7 s, in-out), overshoots 8% and settles at `split`; the labels typeset. Outro: the divider sweeps back out to the right (0.3 s).
**Why it moves.** change: the difference is shown on the same frame.

### Mount

Copy every manifest file into your project (plus `af-masthead-runtime`). Mount with a unique host id, `data-composition-id="af-masthead-before-after-16x9"`,
`data-composition-src="compositions/af-masthead-before-after-16x9.html"`, `data-duration="4.5"` and `data-variable-values`.
Use the variant whose size matches your project (16x9, 9x16, 4x5, 1x1): each is laid out natively, never scaled.
Over live footage set `backdrop` to `""` (the default still is only there so the block reads on its own).

### Content slots

Nested slots are JSON strings. Every slot is checked against `constraints.json` and measured against the layout before anything
draws; the block stops with a message naming the slot and the fix (text is fitted to at most 75% of its design size, never cut).

- `before`: {"type":"string","maxLength":12}
- `after`: {"type":"string","maxLength":12}
- `split`: {"type":"number","minimum":0.2,"maximum":0.8}
- `at`: {"type":"object","description":"optional land times in block seconds: {sweep}","properties":{"sweep":{"type":"number","minimum":0}}}

- Works over live footage: the black-and-white side is a backdrop filter on whatever is under the block.

### Brand and layout

Brand variables (defaults from the pack's `brand.json`): `creator`, `handle`, `channel`, `tagline`, `series`, `url`, `colourway`, `accent`, `monogram`, `logo`, `avatar`, `keyword`, `ctaFollow`, `ctaLink`, `ctaCode`. `colourway` is forest, oxblood or ink;
`accent` (hex) recolours the gold serif voice and falls back if it would not read on the slab (4.5:1).
Layout: `backdrop`, `speakerFocus` (crop of the speaker), `capTop` (px; 0 = upper chest with clear air under the chin for a centred 16:9 master),
`zoneTop` / `zoneEnd` (px; 0 = the free zone below the captions; footage with big headroom sets them to the band above the head).

### Example

```json
{
  "before": "before",
  "after": "after",
  "split": 0.5
}
```

## FAQ

### What can my AI agent change in Before / after slider?

Your agent fills the `before`, `after`, `split` and `at` slots through the block's data-variable-values (or the starter project's variables). Motion, timing, palette, fonts and the internal layout are protected, so the result keeps the Masthead look.

### Which aspect ratios does Before / after slider support?

Before / after slider is designed natively for 16:9, 9:16, 4:5 and 1:1. A typical beat lasts 4.5s.

### How do I get Before / after slider?

Before / after slider is included in the Masthead pack, which is part of the AgentFrames All-access subscription along with 63 other templates in this pack and every other pack on the store. You get the full source, the editing contracts and the agent instructions.

## More in Masthead

- [Picture dive (B-roll frame)](https://agentframes.ai/elements/masthead/picture-dive.md): Show the thing without leaving your voice: a photo in a card with a cream rim floats into the headroom and keeps diving in, with a mono file-name chip under it ("NOTEBOOK.JPG").
- [File drop (upload)](https://agentframes.ai/elements/masthead/file-drop.md): The sample's drop zone: a green card with a dashed cream zone and a down arrow; a white file chip flies in and lands, the dashes light gold, and the upload counts up with a gold bar.
- [Contact sheet (full frame)](https://agentframes.ai/elements/masthead/contact-sheet.md): The sample's contact sheet: a serif-caps title on the green page, a grid of numbered frames, a rose grease-pencil loop round the keeper and a rose cross and "cut" on the reject.
- [Three-up columns (F033)](https://agentframes.ai/elements/masthead/three-up.md): Three ways side by side: the frame splits into three tall columns of B-roll that open upward one after another, each with a mono label.

## Community

Coming soon.
