
Falling tools
Physics, Hover
The product card of a made-up jewellery atelier, Ferne Atelier, in the premium style of the interface pieces: in the photo a pair of freshwater pearl drops hangs from a brass rod, and each earring is a chain of three pieces (the ear wire, the hoop, the pearl) in a small hand-written physics world, with gravity, inertia and air drag. Drag the card and the pearls lag behind, swing and settle as the card springs back into place; a passing pointer brushes them; picking Gold, Silver or Rose changes the metal, the thumb slides on a spring, the price rolls and the earrings chime; Add to bag dips the card a touch and the bag count pops up.
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 pearl earrings" 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 earring product card with pearls that swing as you drag it</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 product card of a made-up jewellery atelier. A pair of pearl drops hangs from a brass rod in the photo
well: each earring is a chain of three pieces (the ear wire, the hoop, the pearl) in a small hand-written
physics world. Drag the card and they swing with its inertia, brush them with the pointer, change the metal
and they chime; adding to the bag dips the card -->
<article class="card" data-card aria-label="Tide pearl drops">
<div class="well" data-well>
<span class="well__light" aria-hidden="true"></span>
<svg class="jewel" data-svg aria-hidden="true">
<defs>
<linearGradient id="metal" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" data-m1 stop-color="#f6e2a8"></stop>
<stop offset="0.45" data-m2 stop-color="#d4ab5c"></stop>
<stop offset="1" data-m3 stop-color="#9b7431"></stop>
</linearGradient>
<radialGradient id="pearl" cx="0.4" cy="0.36" r="0.7" fx="0.34" fy="0.28">
<stop offset="0" stop-color="#ffffff"></stop>
<stop offset="0.38" stop-color="#f6f0e7"></stop>
<stop offset="0.8" stop-color="#ddd1c0"></stop>
<stop offset="1" stop-color="#c3b5a1"></stop>
</radialGradient>
<radialGradient id="sheen" cx="0.5" cy="0.5" r="0.5">
<stop offset="0.62" stop-color="#f3c9d4" stop-opacity="0"></stop>
<stop offset="0.9" stop-color="#e9b9c7" stop-opacity="0.5"></stop>
<stop offset="1" stop-color="#bcd3e6" stop-opacity="0.35"></stop>
</radialGradient>
<linearGradient id="rod" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#efe2c4"></stop>
<stop offset="0.5" stop-color="#b99a62"></stop>
<stop offset="1" stop-color="#7d6238"></stop>
</linearGradient>
<filter id="soft" x="-50%" y="-50%" width="200%" height="200%">
<feColorMatrix type="matrix" values="0 0 0 0 0.28 0 0 0 0 0.22 0 0 0 0 0.16 0 0 0 0.32 0"></feColorMatrix>
<feGaussianBlur stdDeviation="2.6"></feGaussianBlur>
</filter>
</defs>
<use href="#pair" class="jewel__shadow" data-shadow filter="url(#soft)"></use>
<g id="pair" data-pair>
<rect class="rod" data-rod fill="url(#rod)"></rect>
<rect class="rod__glint" data-rodglint></rect>
</g>
</svg>
<div class="bag" data-bag aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M5.2 7h9.6l-.8 9.2H6Z"></path><path d="M7.6 7V5.8a2.4 2.4 0 0 1 4.8 0V7"></path></svg>
<span class="bag__n" data-bagn>0</span>
</div>
<span class="tag" data-tagline>Freshwater pearl</span>
</div>
<div class="info">
<div class="info__row">
<div>
<p class="brand">Ferne Atelier</p>
<h1 class="name">Tide pearl drops</h1>
</div>
<p class="price" aria-live="polite"><span class="price__win"><span class="price__n" data-price>$148</span></span></p>
</div>
<div class="metal" role="radiogroup" aria-label="Metal" data-metals>
<span class="metal__thumb" data-thumb aria-hidden="true"><span class="metal__thumb-face"></span></span>
<button class="metal__opt is-on" type="button" role="radio" aria-checked="true" data-metal="gold" data-autoclic>Gold</button>
<button class="metal__opt" type="button" role="radio" aria-checked="false" data-metal="silver" data-autoclic>Silver</button>
<button class="metal__opt" type="button" role="radio" aria-checked="false" data-metal="rose" data-autoclic>Rose</button>
</div>
<button class="add" type="button" data-add data-autoclic>
<span class="add__face" data-addface>
<span class="add__words" data-addwords>Add to bag</span>
<svg class="add__icon" viewBox="0 0 16 16" aria-hidden="true">
<path class="add__plus" data-plus d="M8 3.5v9M3.5 8h9"></path>
<path class="add__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"></path>
</svg>
</span>
</button>
</div>
</article>
<p class="hint">Drag the card, brush the pearls.</p>
<p class="sr" aria-live="polite" data-live></p>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></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.
27 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 “Swinging pearl earrings” from Animorio and fit it into my siteEach earring is made of four points: the first is fixed on the rod, the other three (the end of the ear wire, the bottom of the hoop, the pearl) move with Verlet integration, which only remembers the previous position: velocity is the difference between the two, gravity is added each step and the air takes a little away. After the step, five rounds of constraints put each link back to its length, moving the lighter point more.
The card has its own hand-written spring for offset, tilt and lift. Each step the point on the rod is carried into page coordinates through the card’s transform: the pearls, living in the same world, lag behind by inertia on their own. To draw them the sum runs backwards and the pieces go into the photo’s SVG, the hoop rotated along its link and the pearl only moved, so its light stays where the lamp is.
While dragging, the card follows the pointer up to half of the free room and then less and less, like a rubber band that never passes the margin worked out on every resize with tilt and lift already inside; let go, it returns to the middle on a lightly damped spring, and the bounce shows in the pearls.
| Name | File | Default | What it changes |
|---|---|---|---|
GRAVITY | script.js | 1 | How heavy the pearls are: higher, they swing faster. |
DAMPING | script.js | 1 | How quickly they calm down: higher, they stop sooner. |
REACH | script.js | 64 | How many pixels at most the card travels when dragged, then it pulls like a rubber band. |
TILT | script.js | 1 | How much the card tilts with its speed (0 stays straight). |
LIFT | script.js | 1.025 | How much the card lifts while you hold it (1 for none). |
BRUSH | script.js | 1 | How much a passing pointer moves the pearls (0 none). |
CHIME | script.js | 1 | How much the earrings chime when the metal changes (0 none). |
HOLD | script.js | 1.6 | The seconds of pause before the autopilot starts again. |
--page | style.css | #efebe4 | The ivory of the page. |
--accent | style.css | #b08a4a | The brass of the bag count and of the keyboard focus ring. |
For the product card or grid of a shop selling jewellery, accessories or small hanging objects: whoever looks picks up the card and feels the weight of the product, tries the metals and puts it in the bag.
The same physics with a finger: the card is dragged by touch and sizes the photo on the height too; the drag room is worked out on the screen so the tilted card never leaves the side, and the line below hides under 480 pixels.
No swinging or moving: the earrings hang still, the card does not drag, the metal, the price and the button change with fades.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 15 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.