
Squared paper under the photo
Hover, WebGL, Images
The cover of a photo essay in Halation, a made-up magazine: a real photo of a street at night under blue and magenta neon. Move the mouse over it and a WebGL shader pulls red, green and blue apart along the direction and with the strength of the movement, more around the pointer like a soft lens, and when you stop the channels come back together on a measured spring; the title beside it shifts one pixel the other way and the photo edge picks up a thread of the three colours only when the split is strong.
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>
<!--
"Chromatic aberration hover" 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>Chromatic aberration hover</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/standard.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<article class="cover" data-cover>
<figure class="photo" data-photo>
<div class="photo__frame" data-frame>
<img class="photo__img" data-img src="strada.webp" alt="A city street at night, wet asphalt under blue and magenta neon lights" width="960" height="721" decoding="async">
<canvas class="photo__gl" data-gl aria-hidden="true"></canvas>
<span class="photo__fringe" aria-hidden="true"></span>
</div>
<figcaption class="photo__cap"><span>Photograph</span><span data-caption>Blue hour, wet asphalt</span></figcaption>
</figure>
<div class="text" data-text>
<p class="mag"><span class="mag__name" data-brand>Halation</span><span class="mag__issue">Night issue</span></p>
<h1 class="title" data-title>The street that<br>never dries</h1>
<p class="lede">Neon, rain and the long walk home. A photo essay on the hour when a city turns its lights on.</p>
<dl class="meta">
<div><dt>Category</dt><dd>Cities</dd></div>
<div><dt>Year</dt><dd>2026</dd></div>
<div><dt>Read</dt><dd>9 min</dd></div>
</dl>
<a class="read" href="#" data-read>
<span>Read the essay</span>
<svg class="read__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4l4 4-4 4" /></svg>
</a>
</div>
</article>
</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.
30 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Chromatic aberration hover” from Animorio and fit it into my siteThe photo is a real file in the folder, strada.webp, shown as an <img> with object-fit: cover. Above it sits a WebGL canvas as big as the frame: once the photo has loaded it becomes a texture, and the shader redraws it with the same cover fit, so the two match to the pixel. Until the texture is ready, or without WebGL, you see the clean <img>.
For each point the shader reads the photo three times: red shifted by +o, green in place, blue shifted by −o. The vector o is the split multiplied by a weight that is 1 around the pointer and falls off on a Gaussian to EDGE far away: a soft lens. On top, a grain made from a hash of the point that changes 24 times a second.
Every frame we measure how many pixels the pointer travelled, scaled to a sixtieth of a second so it behaves the same at any refresh rate: times STRENGTH it becomes the target split, kept under MAX_SPLIT. The real split chases the target on a spring (velocity × DAMPING + distance × SPRING); the target drops back to zero by itself when the pointer stops, and the spring brings the channels back together with a small overshoot.
The same strength, from 0 to 1, goes into a CSS variable, --sep: the red and blue edge of the photo has opacity --sep squared, so it shows only when the split is strong. The title block moves 1.4 pixels the other way, and the photo breathes by a thousandth on a slow sine.
A repeating GSAP timeline moves a fake pointer over the photo, with slow passes and quick flicks. A real movement stops it, and it restarts after six quiet seconds with gsap.delayedCall.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | 'Halation' | The name of the made-up magazine, above the title. |
STRENGTH | script.js | 2.6 | How far the channels split for each pixel of pointer speed. |
MAX_SPLIT | script.js | 34 | The strongest split, in pixels. |
LENS | script.js | 0.42 | The radius of the soft lens around the pointer. |
EDGE | script.js | 0.35 | How much the channels split far from the pointer. |
SPRING | script.js | 0.11 | The spring that brings the channels back together. |
DAMPING | script.js | 0.8 | The spring damping: lower means less overshoot. |
GRAIN | script.js | 0.032 | The grain over the photo. |
For an article cover, a portfolio project or an electronic music event poster: the photo reacts to the mouse without breaking and comes back clean as soon as you stop.
The same effect with a finger dragging over the photo; the photo goes on top and the text below, the introduction hides to fit the box.
No split: the photo stays clean, on hover it brightens slightly in a fade, and everything arrives in a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.
Tested on 26 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.
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.