Before / after
Slant / Components
A draft and its render of one pixel hillside, one over the other, with a seam to drag, press to, or move with the keys, and a reset.
The theme follows the link: share a page with ?theme=moon.
Usage
<Compare before after>lays the before side over the after side and clips it at the seam;beforeLabelandafterLabelname the corner captions, andaspectRatiosizes the frame.- Both sides are one inline SVG scene drawn twice from the same data: pencil greys for the draft, the chart colours for the render, so it restyles with the theme. The seam is controlled here, for the readout and Reset.
Keyboard
| ← / → | move the seam a step the way the arrow points |
| ↑ / ↓ | grow or shrink the draft a step |
| Page Up / Page Down | move it ten steps |
| Home / End | show all of the render, or all of the draft |
| Tab | moves from the seam to Reset |
Accessibility
- The seam's grip is a
slidernamed "Draft and render", whose value text says how much of each side shows ("60% Draft, 40% Render"). - Both pictures are
imgs with their own names; the corner captions are hidden from assistive technology, since the value text names both sides. Reset says what it did through a polite live region.
Before / after in React and SwiftUI.
The React tab is the component’s real source; the SwiftUI tab is its twin in TUTTNKit.