
Stacking certificates
Hover, Images
The editor of a made-up photo app, Tonewell, in the style of today’s product interfaces: a real, dark photo of a harbour at dusk with its stone lighthouse and, on top of it, a glass panel with the light curve. Pull a point of the curve and the photo brightens and warms up live, the histogram slides along; hold Compare to see the original again, Reset puts everything back.
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>
<!--
"Light curve photo fix" 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>The photo that corrects as you pull the light curve</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the editor of a made-up photo app, Tonewell: an underexposed real photo of a harbour at dusk with its lighthouse
(porto.webp, CC0) and, floating on it, a
glass panel with the light curve. Pull a point of the curve and the photo brightens and warms up live, the
histogram slides with it; hold Compare to see the original again, Reset to start over -->
<article class="card" data-card aria-label="Tonewell photo editor">
<header class="top">
<div class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M5.6 16.2c3.6.2 5.4-1.6 6.4-4.2s2.8-4.4 6.4-4.4"/></svg>
<span class="brand__name" data-brand>Tonewell</span>
<span class="brand__file" data-file>harbor-at-dusk.raw</span>
</div>
<span class="chip" data-chip>
<svg class="chip__tick" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4l2.9 2.8 5.9-6.2"/></svg>
<span class="chip__text" data-chiptext>Original</span>
</span>
</header>
<figure class="photo" data-photo>
<canvas class="photo__canvas" data-canvas aria-label="A harbour at dusk with a stone lighthouse on the pier and sailing boat masts behind it" role="img"></canvas>
<span class="photo__sheen" data-sheen aria-hidden="true"></span>
<div class="curve" data-curve>
<svg class="curve__svg" data-svg viewBox="0 0 100 100" preserveAspectRatio="none" aria-label="Light curve" role="group">
<g class="curve__grid">
<line x1="25" y1="0" x2="25" y2="100"/><line x1="50" y1="0" x2="50" y2="100"/><line x1="75" y1="0" x2="75" y2="100"/>
<line x1="0" y1="25" x2="100" y2="25"/><line x1="0" y1="50" x2="100" y2="50"/><line x1="0" y1="75" x2="100" y2="75"/>
</g>
<path class="curve__hist" data-hist d=""/>
<line class="curve__ref" x1="0" y1="100" x2="100" y2="0"/>
<path class="curve__glow" data-glow d=""/>
<path class="curve__line" data-line d=""/>
</svg>
<button class="handle" data-handle="0" type="button" aria-label="Shadows point"><span></span></button>
<button class="handle" data-handle="1" type="button" aria-label="Midtones point"><span></span></button>
<span class="curve__read" data-read>In 150 · Out 150</span>
</div>
</figure>
<footer class="bar">
<div class="bar__info">
<span class="bar__label">Light curve</span>
<span class="bar__hint" data-hint>Drag a point on the curve</span>
</div>
<div class="bar__tools">
<button class="tool" data-compare type="button">
<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.2" y="3" width="11.6" height="10" rx="2"/><path d="M8 3v10"/><path class="fill" d="M8 3h3.8a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H8z"/></svg>
<span>Hold to compare</span>
</button>
<button class="tool tool--round" data-reset type="button" aria-label="Reset">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8a4.6 4.6 0 1 0 1.5-3.4"/><path d="M3.2 2.6v2.6h2.6"/></svg>
</button>
</div>
</footer>
</article>
<!-- used only when the page can't read the photo's pixels (opened from a file): the same raw look and curve as tables -->
<svg class="filtri" aria-hidden="true" focusable="false">
<filter id="tono" color-interpolation-filters="sRGB">
<feComponentTransfer>
<feFuncR data-func type="table" tableValues="0 1"/>
<feFuncG data-func type="table" tableValues="0 1"/>
<feFuncB data-func type="table" tableValues="0 1"/>
</feComponentTransfer>
</filter>
</svg>
<svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></svg>
</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.
23 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 “Light curve photo fix” from Animorio and fit it into my siteThe real photo, porto.webp, is drawn on a canvas cut like a background-size: cover, as big as the card at the screen’s pixel density (1100 pixels at most). Right after, the pixels are read with getImageData and turned into the raw shot: a power curve that darkens and flattens them, a touch more blue and a random grain with a fixed seed. Those pixels stay in memory: every correction starts again from there. Opened from a file, where the browser won’t let the page read the pixels, the same sum is done by an SVG feComponentTransfer filter with tables computed from the curve.
The two movable points and the two fixed ends go through a monotone cubic (Fritsch and Carlson), which makes no waves and never leaves the square. From it, a table of 256 values: every channel of every pixel reads it, and the same function draws the SVG path of the curve and its glow.
How much the curve lifts the middle grey also decides the warmth: red rises a little and blue drops, so as the light grows the sunset gets warmer. The comparison with the original is a number, mix, that GSAP takes from 1 to 0: every pixel is the original plus the correction multiplied by mix.
Every change marks the photo as dirty, and a single gsap.ticker redraws it at most once per frame. While recolouring, it counts the brightness of one pixel in eight into 48 columns; the histogram chases the new values halfway for a few frames, so it slides instead of jumping.
The point doesn’t jump to where you touch: GSAP takes it there in a little over two tenths of a second with power3.out, kept between its neighbours so the curve never turns back. On release the point settles with an elastic bounce, the pill takes its colour with the tick drawing itself and a soft-light sheen crosses the photo.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | 'Tonewell' | The name of the made-up photo app, written at the top left. |
MID_LIFT | script.js | 50 | How far the drawn pointer lifts the midtones point, out of 255. |
SHADOWS | script.js | 16 | How far the drawn pointer lowers the shadows point, out of 255. |
WARMTH | script.js | 1 | How much the colours warm up as the light rises: 0 none, 2 a lot. |
FOLLOW | script.js | 0.22 | The seconds the curve point takes to reach the finger. |
COMPARE | script.js | 1.3 | The seconds the drawn pointer holds Compare down. |
PAUSE | script.js | 1.2 | The seconds of pause before the loop starts again. |
For the page of a photo editing app, a creative tool or a service that fixes photos: it shows in a single gesture what the product does, and the comparison with the original proves it. It also suits the portfolio of a photographer or a retoucher.
The same animation with adapted sizes: the card is sized on the width and the height of the screen, the curve panel stays a third of the photo, the file name disappears and the buttons keep only their icons under 420 pixels. The points can be dragged with a finger.
No pointer and nothing moving by itself: the photo arrives already corrected, the comparison with the original is a fade and Reset puts the points back without travelling.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 6 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.