
Stacking certificates
Hover, Images
The product photo on the page of a made-up shop, in the clean style of today’s products: a powder-coated steel bottle on a light table, with five colour swatches below. Pick a swatch and the new colour spreads over the bottle in a round wave that starts from the swatch itself, under the photo, while the shading, the highlight and the grain stay where they are; the colour name and the price change one after the other. Hover a swatch and its colour peeks over the edge of the photo first.
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>
<!--
"Swatch wave recolour" 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>Corrin Field Bottle, colours</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>
<!-- the product photo of a made-up shop. Pick a swatch and the new colour spreads over the bottle in a round wave
that starts from the swatch itself; the shading, the highlight and the grain of the powder coat stay where they
are. Hover a swatch and its colour peeks over the bottom edge of the photo first. -->
<main class="stage">
<article class="prodotto">
<div class="foto" data-foto>
<svg viewBox="0 0 300 360" role="img" aria-label="Field Bottle" data-svg>
<defs>
<radialGradient id="luceFondo" cx="0.28" cy="0.18" r="0.9">
<stop offset="0" stop-color="#fff" stop-opacity=".85" />
<stop offset=".55" stop-color="#fff" stop-opacity=".12" />
<stop offset="1" stop-color="#fff" stop-opacity="0" />
</radialGradient>
<linearGradient id="piano" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#000" stop-opacity="0" />
<stop offset=".02" stop-color="#000" stop-opacity=".05" />
<stop offset="1" stop-color="#000" stop-opacity=".015" />
</linearGradient>
<linearGradient id="giro" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#000" stop-opacity=".34" />
<stop offset=".13" stop-color="#000" stop-opacity=".07" />
<stop offset=".25" stop-color="#fff" stop-opacity="0" />
<stop offset=".305" stop-color="#fff" stop-opacity=".46" />
<stop offset=".36" stop-color="#fff" stop-opacity=".04" />
<stop offset=".6" stop-color="#000" stop-opacity="0" />
<stop offset=".86" stop-color="#000" stop-opacity=".16" />
<stop offset="1" stop-color="#000" stop-opacity=".36" />
</linearGradient>
<linearGradient id="piede" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#000" stop-opacity="0" />
<stop offset="1" stop-color="#000" stop-opacity=".2" />
</linearGradient>
<linearGradient id="acciaio" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#8b8d90" />
<stop offset=".3" stop-color="#e9eaeb" />
<stop offset=".42" stop-color="#ffffff" />
<stop offset=".7" stop-color="#b9bbbe" />
<stop offset="1" stop-color="#6f7174" />
</linearGradient>
<linearGradient id="lampo" x1="0" y1="0" x2="1" y2="0">
<stop offset="0" stop-color="#fff" stop-opacity="0" />
<stop offset=".5" stop-color="#fff" stop-opacity=".55" />
<stop offset="1" stop-color="#fff" stop-opacity="0" />
</linearGradient>
<filter id="sfuma" x="-50%" y="-200%" width="200%" height="500%"><feGaussianBlur stdDeviation="6" /></filter>
<filter id="sfumaPoco" x="-50%" y="-200%" width="200%" height="500%"><feGaussianBlur stdDeviation="1.6" /></filter>
<filter id="grana" x="0" y="0" width="100%" height="100%">
<feTurbulence type="fractalNoise" baseFrequency="1.1" numOctaves="2" seed="7" />
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .45 -.16" />
</filter>
<!-- the coloured parts, drawn in currentColor so each layer can take its own colour -->
<rect id="tinta" width="300" height="360" fill="currentColor" opacity=".075" />
<g id="forma">
<path d="M128 104 C113 108 104 120 104 140 L104 300 C104 312 112 320 124 320 L176 320 C188 320 196 312 196 300 L196 140 C196 120 187 108 172 104 Z" fill="currentColor" />
<rect x="122" y="54" width="56" height="40" rx="9" fill="currentColor" />
<path d="M137 56 C137 33 163 33 163 56" fill="none" stroke="currentColor" stroke-width="7" stroke-linecap="round" />
</g>
<clipPath id="soloCorpo">
<path d="M128 104 C113 108 104 120 104 140 L104 300 C104 312 112 320 124 320 L176 320 C188 320 196 312 196 300 L196 140 C196 120 187 108 172 104 Z" />
</clipPath>
<clipPath id="soloTappo"><rect x="122" y="54" width="56" height="40" rx="9" /></clipPath>
<clipPath id="onda"><circle data-cerchio cx="150" cy="400" r="0" /></clipPath>
<clipPath id="sbirciata"><circle data-sbirciata cx="150" cy="400" r="0" /></clipPath>
</defs>
<rect width="300" height="360" fill="#f1eee9" />
<rect width="300" height="360" fill="url(#luceFondo)" />
<use href="#tinta" class="strato" data-base />
<g clip-path="url(#onda)"><use href="#tinta" class="strato" data-nuovo /></g>
<g clip-path="url(#sbirciata)"><use href="#tinta" class="strato strato--sbirciata" data-peek /></g>
<rect y="298" width="300" height="62" fill="url(#piano)" />
<g data-bottiglia>
<g data-ombra>
<ellipse cx="152" cy="321" rx="72" ry="9" fill="#000" opacity=".16" filter="url(#sfuma)" />
<ellipse cx="150" cy="320" rx="46" ry="3.2" fill="#000" opacity=".34" filter="url(#sfumaPoco)" />
</g>
<use href="#forma" class="strato" data-base />
<g clip-path="url(#onda)"><use href="#forma" class="strato" data-nuovo /></g>
<g clip-path="url(#sbirciata)"><use href="#forma" class="strato" data-peek /></g>
<!-- the shading stays still while the colour changes under it -->
<g clip-path="url(#soloCorpo)">
<rect x="104" y="100" width="92" height="222" fill="url(#giro)" />
<rect x="104" y="270" width="92" height="52" fill="url(#piede)" />
<rect x="104" y="100" width="92" height="222" filter="url(#grana)" />
<rect data-lampo x="60" y="96" width="34" height="232" fill="url(#lampo)" transform="skewX(-14)" opacity="0" />
</g>
<g clip-path="url(#soloTappo)">
<rect x="122" y="54" width="56" height="40" fill="url(#giro)" />
<rect x="122" y="54" width="56" height="40" fill="#000" opacity=".16" />
<rect x="122" y="54" width="56" height="40" filter="url(#grana)" />
</g>
<path d="M137 56 C137 33 163 33 163 56" fill="none" stroke="#fff" stroke-opacity=".28" stroke-width="1.4" stroke-linecap="round" transform="translate(-1.6 0)" />
<rect x="126" y="92" width="48" height="13" rx="2" fill="url(#acciaio)" />
<line x1="127" y1="97.5" x2="173" y2="97.5" stroke="#000" stroke-opacity=".14" stroke-width=".8" />
<ellipse cx="129" cy="121" rx="9" ry="4.5" fill="#fff" opacity=".32" filter="url(#sfumaPoco)" transform="rotate(-28 129 121)" />
<text x="150" y="232" text-anchor="middle" class="marchio-inciso">CORRIN</text>
<line x1="141" y1="240" x2="159" y2="240" stroke="#fff" stroke-opacity=".38" stroke-width=".8" />
</g>
<circle data-filo cx="150" cy="400" r="0" fill="none" stroke="#fff" stroke-width="1.4" opacity="0" />
<circle data-filo-sbirciata cx="150" cy="400" r="0" fill="none" stroke="#fff" stroke-width="1" opacity="0" />
</svg>
</div>
<div class="info">
<div class="riga">
<h1 class="nome" data-nome>Field Bottle</h1>
<span class="prezzo"><span data-prezzo>$38</span></span>
</div>
<div class="riga riga--sotto">
<span class="colore"><span data-colore>Sage</span></span>
<span class="dettaglio" data-dettaglio>750 ml, powder-coated steel</span>
</div>
</div>
<div class="campioni" role="radiogroup" aria-label="Colour" data-campioni>
<span class="anello" data-anello aria-hidden="true"></span>
</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.
20 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 “Swatch wave recolour” from Animorio and fit it into my siteThe coloured parts of the bottle are drawn only once in currentColor and called with use in three layers: the current one, the new one and the one that peeks. Shading, highlight, grain and brand sit on top, still: as the colour underneath changes, the light stays the same.
The new layer is cut by a clipPath with a circle. Its centre is the pressed swatch, brought into the drawing’s coordinates with getBoundingClientRect: it sits below the photo, so the colour comes in from the edge as an arc. GSAP animates the radius out to the farthest corner, then the current layer takes the new colour and the circle goes back to zero.
On hover a third layer, with its own circle, grows from the edge by PEEK units with back.out: the colour peeks in without covering yet. If that swatch is then picked, the wave starts from the preview’s radius instead of from zero.
The colour name and the price have one element each: the old one rises and blurs in two tenths, then the text changes and the new one comes from below with back.out and font-stretch from 78 to 100. So two words are never seen together.
| Name | File | Default | What it changes |
|---|---|---|---|
PRODUCT | script.js | Field Bottle | The name of the product. |
WAVE_TIME | script.js | 1.05 | The seconds the colour takes to cover the photo. |
PEEK | script.js | 74 | How far the colour peeks in when you hover a swatch. |
SHINE | script.js | 1 | How bright the glint sweeping across the bottle is; 0 switches it off. |
NOD | script.js | 2.5 | How far the bottle lifts when the colour lands. |
AUTO | script.js | 3.4 | The seconds between colours when nobody touches the photo. |
For the page of a product that comes in several colours (bottles, mugs, backpacks, headphones, lamps, shoes), for an online shop’s product card or for the section of a landing page presenting the colour variants.
The same animation with adapted sizes: the photo is sized on the screen height, the swatches are big enough for a finger and the hover preview only appears with a mouse; with a finger you pick and the wave starts at once.
No wave, nod or glint: the new colour fades in over the whole bottle and the name and price change in place.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.6 KB; the libraries: GSAP 28 KB.
Tested on 30 October 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.