
Spinnable album record
Physics, Hover, Images
The page of a dress from Maison Ondine, a made-up boutique, with a real photo: the price tag hangs on a thin thread from a brass eyelet on the corner of the photo and swings like a real pendulum when you change size or colour, harder when the choice jumps further; the price rolls digit by digit, a new colour dyes only the fabric of the dress, and passing the mouse over the tag flicks it. Minimal style.
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>
<!--
"Swinging price tag" 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>Maison Ondine, the Wren dress</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/inter-tight@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- the product page of a made-up boutique, Maison Ondine, for one dress. A real photo of the dress; the price tag hangs
from an eyelet on the corner of the photo by a thin thread and swings like a real pendulum when you change size or
colour (or flick it with the pointer); the price on the tag rolls to the new value; a new colour recolours only the
fabric of the dress in the photo -->
<main class="scena">
<article class="pezzo" data-pezzo>
<figure class="foto" data-foto>
<img class="foto__img" data-img src="abito.webp" alt="A navy dress with a small white floral print, the hands in front holding a pink blossom" width="960" height="665">
<canvas class="foto__tinta" data-tinta aria-hidden="true"></canvas>
<canvas class="foto__tinta" data-tinta aria-hidden="true"></canvas>
<span class="foto__grana" aria-hidden="true"></span>
<span class="foto__occhiello" data-occhiello aria-hidden="true"></span>
</figure>
<div class="appeso" data-appeso aria-hidden="true">
<svg class="filo" data-filo viewBox="0 0 10 100" preserveAspectRatio="none"><line x1="5" y1="0" x2="5" y2="100"/></svg>
<div class="ombra" data-ombra></div>
<div class="cartellino" data-cartellino>
<span class="cartellino__buco"></span>
<span class="cartellino__marca">Maison Ondine</span>
<span class="cartellino__riga"></span>
<span class="cartellino__taglia" data-tag-taglia>S</span>
<span class="cartellino__prezzo">
<span class="valuta">$</span><span class="cifre" data-cifre></span>
</span>
<s class="cartellino__vecchio" data-vecchio>$168</s>
<span class="cartellino__codice">WR 0412</span>
</div>
</div>
<section class="pannello">
<p class="marca">Maison Ondine</p>
<h1 class="nome">The Wren dress</h1>
<p class="nota">Washed cotton voile, cut on the bias, lined to the knee.</p>
<div class="gruppo">
<p class="etichetta">Colour <b data-colore-nome>Midnight</b></p>
<div class="campioni" role="radiogroup" aria-label="Colour" data-campioni>
<button class="campione" role="radio" aria-checked="true" aria-label="Midnight" data-colore="0" style="--c:#1d2748"><span></span></button>
<button class="campione" role="radio" aria-checked="false" aria-label="Sage" data-colore="1" style="--c:#6f8a6a"><span></span></button>
<button class="campione" role="radio" aria-checked="false" aria-label="Clay, on sale" data-colore="2" style="--c:#a4513f"><span></span></button>
</div>
</div>
<div class="gruppo">
<p class="etichetta">Size</p>
<div class="taglie" role="radiogroup" aria-label="Size" data-taglie>
<span class="taglie__pillola" data-pillola aria-hidden="true"></span>
<button class="taglia" role="radio" aria-checked="false" data-taglia="0">XS</button>
<button class="taglia" role="radio" aria-checked="true" data-taglia="1">S</button>
<button class="taglia" role="radio" aria-checked="false" data-taglia="2">M</button>
<button class="taglia" role="radio" aria-checked="false" data-taglia="3">L</button>
</div>
</div>
<button class="borsa" data-borsa>
<span class="borsa__fondo" aria-hidden="true"></span>
<span class="borsa__testo" data-borsa-testo>Add to bag</span>
<svg class="borsa__spunta" viewBox="0 0 16 16" aria-hidden="true"><path data-spunta d="M3.5 8.4 6.6 11.4 12.6 4.8" pathLength="1"/></svg>
</button>
</section>
</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.
34 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 “Swinging price tag” from Animorio and fit it into my siteThe tag is an angle and a speed: on every frame of gsap.ticker, in four small steps, the acceleration is −k · sin(angle) − damping · speed, with k dropping as the thread gets longer, like a real pendulum. A change adds speed (the knock), and physics does the rest.
The whole group turns around the eyelet. The thread stretches a hair with the square of the speed and the card drops with it; the card also turns slightly against the speed, so it looks hung and not glued. The shadow slides the other way and spreads when the tag swings out.
Each digit is a column from 0 to 9 inside a window one digit tall: to reach the new number the column moves by yPercent −10 per unit, with power3.out and a small delay from right to left.
On load the photo is copied onto a canvas and for each pixel we work out how much of it is blue fabric (a hue between cyan and violet, or an almost black blue). For Sage and Clay only that part is moved to the new hue, lighter and less saturated, once; then the two canvases over the photo fade in and out.
The eyelet’s point and the thread length are measured again on resize. When nobody touches the page a timeline changes sizes and colours, flicks the tag and adds to the bag; the first touch stops it and it starts again after seven quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
DAMPING | script.js | 1.5 | How quickly the swing dies away, per second (higher stops sooner). |
KICK | script.js | 1 | How hard a change of size or colour knocks the tag. |
THREAD | script.js | 1 | How long the thread is: 1.5 is half as long again, and swings slower. |
PUSH | script.js | 1 | How much the pointer flicks the tag when it passes over it. |
MAX_SWING | script.js | 22 | The widest swing, in degrees. |
ROLL | script.js | 0.9 | Seconds the price takes to roll to the new value. |
FADE | script.js | 0.7 | Seconds the photo takes to change colour. |
AUTOPLAY | script.js | 1 | 1: the page changes size and colour by itself when nobody touches it; 0: never. |
For the product page of a shop with character: a boutique, a tailor, a vintage or craft shop. When the price changes with size or colour and the change should be felt, with a small physical gesture instead of a number that jumps.
The same animation with adapted sizes: the photo on top, as wide as the screen and measured on the height too, the eyelet further in so the tag swings without leaving the screen, a shorter tag and thread; below, the name, the colours, the sizes and the pill. Tapping the tag sets it swinging.
The tag stays still and straight, the price changes with a fade instead of rolling, the photo changes colour with a fade and the text arrives without moving.
GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Inter Tight (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 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.