# Compare viewer

> Before and after on one frame: a split line you drag, labels on both sides, Split, Wipe, Side by side or Toggle, and a plain statement of the viewing transform and that this screen is not a reference.

Source: https://kwark.space/designSystem/components/compare-viewer

## Usage

### What it is
The question a colourist and a DP ask all day: *better or worse than before?* The compare viewer answers it on one frame, with both sides labelled.

### Modes
| Mode | Use |
|---|---|
| Split | Same frame, original left, graded right; drag the line |
| Wipe | Graded against a still (another clip or a reference) |
| Side by side | Two clips to match |
| Toggle | Whole frame flips between the two (⌘ D) |

### Honesty about the screen
The foot says what the viewer shows: *Rec.709 · gamma 2.4*, and when the screen is not a calibrated reference, *this screen is not a grading reference*. Review links always say it.

**Do:** *Original · no grade* and *Graded · v3* written on the picture's corners.

**Don't:** Two unlabelled halves, or a label that says *Before* with no version.

## Style

### Anatomy

1. **Head**: mode switch.
2. **Frame**: two layers; the top one clipped at `--split`.
3. **Split line**: 1px `--k-pro-picture-ink` with a 24px grip; a slider.
4. **Labels**: burn-in style, top corners, naming each side with its version.
5. **Foot**: timecode, the viewing transform and the reference statement.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-pro-picture` | #0b0b0c |  |
| `--k-pro-picture-ink` | #e6e6e6 |  |
| `--k-pro-panel` | #f6f7f9 | #19191b |
| `--k-pro-line` | #d3d9e0 | rgba(255, 255, 255, .09) |
| `--k-text-2` | #5b6779 | #9ca3af |

### Numbers
| Part | Value |
|---|---|
| Line | 1px; grip 24 × 24px circle with two 1px bars |
| Labels | 12px Poppins 500, 2px 6px, on picture black at 72% |

## Code

### React

Use the HTML below with `kwark.css`. The example shows the markup and styling. Supply any application behavior described on this page.

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<figure class="kw-pro kw-pro-viewer kw-pro-cmp" aria-label="Compare viewer, clip 04, original and graded" style="--split:50%">
  <div class="kw-pro-bar"><strong>Viewer</strong><span class="kw-pro-dim kw-pro-ellip">Clip 04 · 12B-1</span><span class="kw-pro-sp"></span><div class="kw-pro-seg kw-pro-seg--text" role="group" aria-label="Compare"><button type="button" aria-pressed="true">Split</button><button type="button" aria-pressed="false" class="kw-pro-x">Wipe</button><button type="button" aria-pressed="false" class="kw-pro-x">Side by side</button><button type="button" aria-pressed="false">Toggle</button></div></div>
  <div class="kw-pro-viewer__pic"><div class="kw-pro-viewer__frame"><span class="kw-pro-cmp__a"><svg class="kw-pro-pic" viewBox="0 0 160 90" preserveAspectRatio="xMidYMid slice" data-look="flat" aria-hidden="true"><rect class="w" width="160" height="90"/><circle class="l" cx="26" cy="22" r="11" opacity=".35"/><circle class="l" cx="46" cy="33" r="5" opacity=".25"/><path class="b" d="M40 90c0-19 19-29 44-29s44 10 44 29z"/><rect class="s" x="76" y="52" width="16" height="14"/><ellipse class="s" cx="84" cy="40" rx="17" ry="21"/><path class="h" d="M66 42c0-17 8-25 19-25s18 8 18 23c-4-9-10-13-18-13s-14 7-19 15z"/><path class="m" d="M99 29c4 5 5 13 3 21l-3 4c2-9 2-17 0-25z" opacity=".85"/></svg></span><span class="kw-pro-cmp__b"><svg class="kw-pro-pic" viewBox="0 0 160 90" preserveAspectRatio="xMidYMid slice" data-look="night" aria-hidden="true"><rect class="w" width="160" height="90"/><circle class="l" cx="26" cy="22" r="11" opacity=".35"/><circle class="l" cx="46" cy="33" r="5" opacity=".25"/><path class="b" d="M40 90c0-19 19-29 44-29s44 10 44 29z"/><rect class="s" x="76" y="52" width="16" height="14"/><ellipse class="s" cx="84" cy="40" rx="17" ry="21"/><path class="h" d="M66 42c0-17 8-25 19-25s18 8 18 23c-4-9-10-13-18-13s-14 7-19 15z"/><path class="m" d="M99 29c4 5 5 13 3 21l-3 4c2-9 2-17 0-25z" opacity=".85"/></svg></span><span class="kw-pro-burn" data-pos="tl">Original · no grade</span><span class="kw-pro-burn" data-pos="tr">Graded · v3</span><span class="kw-pro-cmp__line" role="slider" tabindex="0" aria-label="Split position" aria-valuemin="0" aria-valuemax="100" aria-valuenow="50" aria-valuetext="Half original, half graded"></span></div></div>
  <div class="kw-pro-viewer__foot"><output class="kw-pro-tc">01<i>:</i>04<i>:</i>17<i>:</i>10</output><span class="kw-pro-sp"></span><span class="kw-pro-dim">Rec.709 · gamma 2.4 · this screen is not a grading reference</span></div>
</figure>
```

## Accessibility

### Keyboard
| Key | Does |
|---|---|
| ← / → on the line | Move the split by 1% (⇧ 10%) |
| ⌘ D | Toggle graded / original |
| W | Wipe against the selected still |

### ARIA
- The split line is `role="slider"` with value text *Half original, half graded*.
- Mode switch is a toggle group; the change is announced: *Showing split, original left*.

## For agents

### Rules

- **Must** label both sides with what they are and which version.
- **Must** state the viewing transform, and when the screen is not a reference, say so.
- **Never** put controls over the picture other than the split line.
- **Always** make bypass (⌘ D) a single key.

### AI readiness test

**Task:** Let a director compare v2 and v3 of clip 04 on a laptop.

**Give the agent:** Compare viewer, Clips and grade versions.

**Constraint:** The laptop is not calibrated.

**A reliable answer:**
- Both sides labelled with versions
- Draggable split slider
- Toggle with one key
- Foot names Rec.709 and says not a reference
- No controls on picture
