
The layered button
Buttons, Hover, Physics
The Add to wishlist button of an invented fashion and design shop, Orrin & Vale, in espresso lacquer on warm paper with light and grain, like a Dribbble shot. From a brass eyelet a price tag hangs on a cotton thread and swings like a real pendulum. Pressed, the heart fills on a spring and the tag spins on itself: on the back it says «We’ll tell you when it drops». Then it turns to the front and the drop arrives: the old price floats up small and is struck through, the big one rolls down digit by digit to the new price, the discount pops in and the tag swings and settles.
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>
<!--
"Wishlist price tag button" 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 add to wishlist button with the dropping price tag</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/fraunces@5.3.0/full.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the Add to wishlist button of an invented fashion and design shop, Orrin & Vale. A price tag hangs from the
pill on a thin thread. Pressed, the heart fills on a spring and the tag spins round: on the back, We'll tell
you when it drops. Then the drop: the old price is struck through, the new one rolls down digit by digit and
the tag swings and settles. Pressed again, the piece leaves the wishlist -->
<div class="wt" data-wrap>
<span class="wt__floor" data-floor aria-hidden="true"></span>
<svg class="wt__thread" data-thread-svg aria-hidden="true">
<path class="wt__thread-shade" data-thread-shade d=""/>
<path class="wt__thread-line" data-thread d=""/>
</svg>
<div class="wt__tag" data-tag aria-hidden="true">
<div class="wt__card" data-card>
<div class="wt__face wt__face--front">
<span class="wt__hole"></span>
<span class="wt__brand" data-brand>Orrin & Vale</span>
<span class="wt__item" data-item>Linen overshirt</span>
<span class="wt__rule"></span>
<span class="wt__price">
<span class="wt__was" data-was>
<span data-was-text>$148</span>
<svg class="wt__strike" viewBox="0 0 40 10" preserveAspectRatio="none"><path data-strike d="M1 6.4 C 12 5.2, 26 4.6, 39 3.6" pathLength="1"/></svg>
</span>
<span class="wt__now" data-now></span>
</span>
<span class="wt__foot">
<span class="wt__size" data-size>Sand · M</span>
<span class="wt__off" data-off>−20%</span>
</span>
</div>
<div class="wt__face wt__face--back">
<span class="wt__hole"></span>
<svg class="wt__bell" data-bell viewBox="0 0 24 24">
<path d="M12 3.6c-3.1 0-5.4 2.4-5.4 5.6v3.4c0 1-.4 1.9-1.1 2.6l-.6.6h14.2l-.6-.6c-.7-.7-1.1-1.6-1.1-2.6V9.2c0-3.2-2.3-5.6-5.4-5.6z"/>
<path data-clapper d="M10 18.2c.4.9 1.1 1.4 2 1.4s1.6-.5 2-1.4"/>
</svg>
<span class="wt__note" data-note>We’ll tell you when it drops</span>
<span class="wt__watch">Price watch on</span>
</div>
</div>
</div>
<button class="wt__btn" type="button" data-btn aria-pressed="false" aria-label="Add Linen overshirt to wishlist">
<span class="wt__body" data-body>
<span class="wt__fill" aria-hidden="true"></span>
<span class="wt__light" data-light aria-hidden="true"></span>
<span class="wt__sheen" aria-hidden="true"><span class="wt__sheen-band" data-sheen></span></span>
<span class="wt__edge" aria-hidden="true"></span>
<span class="wt__row">
<span class="wt__disc" data-disc aria-hidden="true">
<svg class="wt__heart" viewBox="0 0 24 24">
<g class="wt__rays" data-rays>
<path d="M12 2.2v-1.6"/><path d="M19.2 5.2l1.1-1.1"/><path d="M21.6 12h1.6"/>
<path d="M4.8 5.2L3.7 4.1"/><path d="M2.4 12H.8"/><path d="M19.2 18.6l1.1 1.1"/><path d="M4.8 18.6l-1.1 1.1"/>
</g>
<path class="wt__heart-fill" data-heart-fill d="M12 20.3c-.3 0-.6-.1-.8-.3C6.4 15.9 3.4 13 3.4 9.4c0-2.7 2.1-4.8 4.7-4.8 1.6 0 3 .8 3.9 2.1.9-1.3 2.3-2.1 3.9-2.1 2.6 0 4.7 2.1 4.7 4.8 0 3.6-3 6.5-7.8 10.6-.2.2-.5.3-.8.3z"/>
<path class="wt__heart-line" data-heart-line d="M12 20.3c-.3 0-.6-.1-.8-.3C6.4 15.9 3.4 13 3.4 9.4c0-2.7 2.1-4.8 4.7-4.8 1.6 0 3 .8 3.9 2.1.9-1.3 2.3-2.1 3.9-2.1 2.6 0 4.7 2.1 4.7 4.8 0 3.6-3 6.5-7.8 10.6-.2.2-.5.3-.8.3z"/>
<path class="wt__heart-gloss" data-gloss d="M7.2 8.2c.3-1 1-1.6 1.9-1.8"/>
</svg>
</span>
<span class="wt__words" aria-hidden="true">
<span class="wt__label" data-label>Add to wishlist</span>
<span class="wt__label" data-label>In your wishlist</span>
</span>
<span class="wt__eyelet" data-eyelet aria-hidden="true"></span>
</span>
</span>
</button>
</div>
<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.
34 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 “Wishlist price tag button” from Animorio and fit it into my siteA single gsap.ticker integrates two springs in three substeps, with the step capped at 1/30 s: the thread angle is a damped pendulum (sine of the angle, not linear), the card’s angle under the thread is a stiffer second spring fed with the thread’s acceleration with the opposite sign, so the tag lags and then follows. The ticker writes the tag’s translate and rotate itself: GSAP never touches it. When everything is still it stops integrating.
The thread is a quadratic SVG path from the eyelet to the tag’s hole: the control point moves sideways in proportion to the pendulum’s speed, so the cotton bends against the motion. The eyelet follows the pill even when it squashes: the starting point is recomputed with the scale and y read through gsap.getProperty.
The tag (moved by the pendulum) holds the card (moved by GSAP with rotationY and transformPerspective): front and back have backface-visibility hidden. The spin is always an odd number of half turns, so it stops on the back whatever SPIN is; on every frame a CSS variable darkens the face turning away from the light.
Each digit of the new price is a 1em window holding a column of digits, from the new one at the top to the old one at the bottom: at first the column is moved up (yPercent) and shows the old price, at the drop it slides down to zero with a light back.out, staggered from the left. Digits that do not change stay still, the last one always does a full turn. The old price floats up small and the red line strikes it with strokeDashoffset on pathLength 1.
A delayedCall starts from the load event: it saves, shows the back for BACK seconds, drops the price, waits HOLD seconds and removes from the wishlist. At the first real touch the loop stops and the button answers only whoever presses it.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | Orrin & Vale | The shop on the tag. |
ITEM | script.js | Linen overshirt | The piece on the tag. |
PRICE | script.js | 148 | The price before the drop. |
DROP | script.js | 118 | The price after the drop (the discount is worked out by itself). |
CURRENCY | script.js | $ | The sign before the price. |
SPIN | script.js | 1.5 | How many turns the tag makes to show its back: 0.5 a plain flip, 2.5 a twirl. |
BACK | script.js | 1.7 | Seconds the back stays in view before the drop. |
SWING | script.js | 1 | How much the tag swings: 0.3 barely, 1.8 a lot. |
SPRING | script.js | 1 | How springy the heart and the pill are: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 3.2 | In the loop, seconds it stays on the new price before leaving the wishlist. |
AUTO | script.js | true | The button goes round by itself until someone touches it. |
For the product page of an online fashion, design, furniture or accessories store: it saves the piece to the wishlist, promises to tell you when the price drops, and shows the drop in a memorable way. It also suits sales, timed deals and price alerts.
On the phone the pill is at most 72% of the screen wide and the tag stays under it, never going out at the sides even when it swings; there is no hover, so at the touch the pill squashes and the tag takes the push, the rest is the same.
Nothing moves: the tag hangs still, the heart fills with a fade, back and front swap at once with a fade, the price changes in place and the struck old price and the discount fade in.
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 11 KB; the libraries: GSAP 28 KB.
Tested on 4 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.