# Before / After: Frame element for AI agents

> Styling before/after: the 'after' photo is revealed from the right behind a deep divider block that sweeps to the middle; before/after tags and a Playfair caption band

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

## Overview

- Name: Before / After (`beforeAfter`), an element: one HyperFrames block per size
- Part of: the [Lookbook](https://agentframes.ai/packs/lookbook.md) pack (4 of 46). Available only through the All-access subscription.
- Category: Frame
- Purpose: Styling before/after: the 'after' photo is revealed from the right behind a deep divider block that sweeps to the middle; before/after tags and a Playfair caption band
- Pack: [Lookbook](https://agentframes.ai/packs/lookbook.md), included in All-access (from $14/month billed annually ($168/year), or $19 monthly)
- 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: 1:1 (native), 4:5 (stage-fit), 9:16 (stage-fit), 16:9 (stage-fit)
- Canvases: works on white mat (`w`), photo well grey (`g`); avoid none
- Typical duration: 4s
- Speaker-safe: no
- Preview video (watermarked): https://agentframes.ai/media/lookbook/before-after.mp4
- Poster: https://agentframes.ai/media/lookbook/before-after.jpg
- Native 1:1 preview (watermarked): https://agentframes.ai/media/lookbook/before-after-native.mp4
- Licence: [AgentFrames Licence](https://agentframes.ai/licence.md)

## Paste this into Claude Code

```text
Use the AgentFrames Lookbook pack. Add a `beforeAfter` beat to plan.json on a `w` canvas with slots `photoA`, `photoB`, `posA`, `posB`, `before`, `after`, `caption` and `split` from my script. Then run validate → build → qa and show me qa/contact.jpg.
```

## Variables

| Variable | Type | Label | Description | Default |
|---|---|---|---|---|
| `photoA` | string | Photo A | Plain text. |  |
| `photoB` | string | Photo B | Plain text. |  |
| `posA` | string | Pos A | Plain text. | 50% 22% |
| `posB` | string | Pos B | Plain text. | 50% 22% |
| `before` | string | Before | Plain text. | before |
| `after` | string | After | Plain text. | after |
| `caption` | string | Caption | HTML allowed; mark up to TWO highlight words with <span class="lb-y">…</span>. | Same bag, <i>two ways</i> |
| `split` | number | Split | Plain text. | 0.5 |

## What your agent can change

### Surface

Styling before/after: the 'after' photo is revealed from the right behind a deep divider block that sweeps to the middle; before/after tags and a Playfair caption band. Category: `frame`. Canvases: ok `w, g`. Typical 4s; settles at 2.4s.

### Editable (fill through plan.json `slots`)

- `photoA` (string). Plain text.
- `photoB` (string). Plain text.
- `posA` (string). Plain text.
- `posB` (string). Plain text.
- `before` (string). Plain text.
- `after` (string). Plain text.
- `caption` (string). HTML allowed; mark up to TWO highlight words with <span class="lb-y">…</span>.
- `split` (number). Plain text.

Optional style/layout overrides: `way`. Use them only to fix fit, never to change the brand.

### Protected

Do not change the motion, timing, easing, bounce, the palette roles (colours come from frame.md → tokens.css), fonts, or the element's internal layout. Keep copy close to the default length (±25%) so it fits.

### Safe editing

Set values in the beat's `slots` in plan.json, run `tools/validate.mjs`, rebuild, and check `qa/contact.jpg`. Never hand-edit the generated index.html or this element's code for a single video.

## FAQ

### What can my AI agent change in Before / After?

Your agent fills the `photoA`, `photoB`, `posA`, `posB`, `before`, `after`, `caption` and `split` slots through plan.json. Motion, timing, palette, fonts and the internal layout are protected, so the result keeps the Lookbook look.

### Which aspect ratios does Before / After support?

Before / After is designed natively for 1:1 and stage-fits into 4:5, 9:16 and 16:9. A typical beat lasts 4s.

### How do I get Before / After?

Before / After is included in the Lookbook pack, which is part of the AgentFrames All-access subscription along with 45 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 Lookbook

- [Photo Frame](https://agentframes.ai/elements/lookbook/photo-frame.md): Photo in the mat: gradient ground cuts up, the photo well cuts in and settles, a caption tracks in under it and a deep rating tag breaks out of its corner
- [Split Screen](https://agentframes.ai/elements/lookbook/split-screen.md): Two looks side by side: two photo wells cut in from opposite edges, label blocks underneath, a deep 'vs' tag breaks out between them
- [Video Frame](https://agentframes.ai/elements/lookbook/video-frame.md): Selfie-video window: a 9:16 well for UGC footage cuts in on the left, a light column carries the eyebrow, Playfair title and note, the handle runs up the side, a deep day tag breaks out
- [Ad Disclosure Tag](https://agentframes.ai/elements/lookbook/ad-disclosure.md): Ad / gifted disclosure: a small deep 'ad' tag breaks in at the top left and a light plate with the partnership line cuts out of it; stays on screen

## Community

Coming soon.
