
Stacking certificates
Hover, Images
The case study card of a made-up restoration studio, Oake & Vellum: a public domain seventeenth century flower still life split by a glass handle. On the left as it came in, with yellowed varnish, grain, a web of cracks, stains and small losses of paint; on the right as it left. Dragging the handle, the Before and After chips follow on a softer spring, the line catches the light, a loupe riding the line enlarges the detail under it, still split in two, and when you let go the handle settles a pixel past its mark. On its own it gives a tour: the tulip, the roses, the vase and back to the middle.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Restoration before and after" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Before and after of the restoration with the glass handle</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz-italic.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the case study card of a made-up painting conservation studio, Oake & Vellum. One real photo of a public domain
flower still life: on the left the same photo as it came in (yellowed varnish, grain, a web of cracks, stains,
small losses of paint, all drawn on top in SVG), on the right as it left the studio. A glass handle splits the
two; the Before and After chips travel with it, the line catches the light, and a loupe rides the line,
showing the detail under it twice as big, still split in two. -->
<article class="case" data-case>
<header class="case__head">
<span class="case__brand">
<svg class="case__mark" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 2.6c4.1 3 6.4 6 6.4 9.4a6.4 6.4 0 0 1-12.8 0c0-3.4 2.3-6.4 6.4-9.4z"/>
<path d="M12 7.2v13.2M12 12.6l-3-2.4M12 15.4l3.2-2.6"/>
</svg>
<span class="case__studio">Oake <i>&</i> Vellum</span>
</span>
<span class="case__chip">Conservation report</span>
</header>
<div class="frame" data-frame>
<div class="plate plate--after" data-after>
<div class="plate__img"></div>
<span class="plate__sheen" aria-hidden="true"></span>
</div>
<div class="plate plate--before" data-before>
<div class="plate__img"></div>
<span class="plate__varnish" aria-hidden="true"></span>
<svg class="plate__wear" data-wear aria-hidden="true"></svg>
</div>
<span class="tag tag--before" data-tag-before aria-hidden="true"><span class="tag__in">Before</span></span>
<span class="tag tag--after" data-tag-after aria-hidden="true"><span class="tag__in">After</span></span>
<div class="split" data-split>
<span class="split__line" aria-hidden="true"><span class="split__glint" data-glint></span></span>
<div class="loupe" data-loupe aria-hidden="true">
<div class="loupe__view" data-loupe-view></div>
<span class="loupe__rim"></span>
</div>
<span class="knob" data-knob role="slider" tabindex="0" aria-label="Before and after" aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
<span class="knob__glass" data-knob-glass>
<svg class="knob__icon" viewBox="0 0 16 24" aria-hidden="true">
<path d="M6 8.5L2.6 12 6 15.5M10 8.5l3.4 3.5-3.4 3.5"/>
</svg>
</span>
</span>
</div>
</div>
<footer class="case__foot">
<div class="case__title">
<p class="case__name">Flowers in a Wan-li vase</p>
<p class="case__meta">Oil on panel, after Bosschaert. Varnish lifted, losses inpainted.</p>
</div>
<p class="case__read"><span class="case__pct" data-pct>50</span><span class="case__unit">% cleaned</span></p>
</footer>
</article>
<p class="sr" aria-live="polite" data-live></p>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
27 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Restoration before and after” from Animorio and fit it into my siteThe frame holds two plates of the same size with the same photo in background-size cover. The one below is the after, a touch more saturated; the one above is the before, clipped with clip-path: inset(0 W−x 0 0) up to the handle. There is no real pair of before and after photos, so the before is made from the same photo: a CSS filter (sepia, saturate, brightness, contrast) and an amber varnish layer in mix-blend-mode multiply.
Over the before sits an SVG as big as the frame, drawn from a fixed seed: grain with feTurbulence, five stains bent by an feDisplacementMap with their ring, the craquelure made of short broken runs that turn and now and then branch (one dark path and the same one moved 0.6 px in a light tone for the lip that catches the light), small losses of paint and dust. It is drawn again on resize with the new sizes.
The loupe is a circle holding a copy of both plates (cloneNode), scaled by ZOOM from the top left and moved by D/2 − x·ZOOM and D/2 − y·ZOOM. The copy of the before has the frame's own clip-path, so the line splits the enlarged detail too, and a line drawn in the glass rim repeats it.
Six springs integrated in 1/240 s steps in the GSAP ticker: the line (stiff while dragging, STIFFNESS and DAMPING once let go, so it carries its speed and passes the mark by a pixel), the chips following it more softly, the loupe's height and opening, the squash of the glass (a kick of speed on landing) and the hover. The handle leans by −v·0.006 degrees, and the band of light on the line sits at the loupe's height and grows with speed.
The tour is a GSAP timeline moving a pilot in shares of the painting (the tulip, the roses, the vase, the middle), turned into frame points with the cover maths: the springs chase it. It repeats until someone touches; at the first touch it stops for good. The handle is a slider: arrows move 5 per cent, with Shift 20, Home and End go to the ends.
| Name | File | Default | What it changes |
|---|---|---|---|
START | script.js | 0.5 | Where the handle rests, as a share of the width from the left. |
ZOOM | script.js | 2.2 | How much the loupe enlarges. |
LOUPE | script.js | 0.34 | The loupe's size, as a share of the photo's shorter side. |
AGE | script.js | 1 | How worn the before looks: 0 clean, 1 as it came in. |
CRACKS | script.js | 1 | How dense the web of cracks is. |
STIFFNESS | script.js | 240 | The spring that settles the handle when you let go: higher is quicker. |
DAMPING | script.js | 17 | Lower lets the handle pass its mark more before it stops. |
SPEED | script.js | 1 | The speed of the tour. |
LOOP | script.js | true | Left alone, the tour starts again. |
For the portfolio of a restoration studio, a photo retoucher, a renovation firm or a cabinet maker, for a before and after of a beauty treatment or an AI retouch: when the comparison is the product and the close up detail matters as much as the whole.
The same animation with adapted sizes: the card takes almost the whole width, the photo gets shorter with the screen's height, the loupe is a third of the shorter side and the line under the title gets shorter. You drag with your finger, also by pressing anywhere on the photo; the page still scrolls vertically.
No tour and no springs: the card fades in with the handle in the middle and the loupe open; when dragging, the line, the loupe and the chips go straight to the finger.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 7 November 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.