
The elastic button
Buttons, Hover, Text
The button of a made-up CRM, Halden, to merge the three copies of the same contact, Dana Whitfield, that came in from three different imports. The dark pill holds a stack of three avatars with the same initials in three colours: on the tap the third copy slides into the second, the second into the first, the stack narrows to one avatar while a band of light fills the pill like a progress bar and the count below drops from 3 to 1. Then the pill turns violet, the avatar that is left gets its check and the label reads Merged into 1 contact; a moment later the copies come back out from under it and the button is ready again.
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>
<!--
"Merge duplicates 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 Merge duplicates button with three contacts that become one</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">
<!-- one gesture: merge the duplicates of a contact in a CRM. Pressed, the three copies of the same person slide
into each other one by one, the pill fills like a progress bar and turns violet, and the contact that is
left gets its check; a moment later the copies come back out and the pill is ready again -->
<div class="frame" data-wrap>
<button class="c" type="button" data-btn data-autoclic aria-describedby="c-note">
<span class="c__body" aria-hidden="true">
<span class="c__skin"></span>
<span class="c__ok" data-ok></span>
<span class="c__prog"><span class="c__prog-fill" data-prog></span></span>
<span class="c__glow" data-glow></span>
<span class="c__sheen" data-sheen></span>
</span>
<span class="c__stack" data-stack aria-hidden="true">
<span class="av av--c" data-av="2"><span class="av__in">DW</span></span>
<span class="av av--b" data-av="1"><span class="av__in">DW</span></span>
<span class="av av--a" data-av="0">
<span class="av__in">DW</span>
<svg class="av__badge" data-badge viewBox="0 0 14 14"><circle cx="7" cy="7" r="6.2"></circle><path data-tick d="M4.2 7.2 6.1 9 9.8 5.2"></path></svg>
</span>
</span>
<span class="c__labels" data-labels>
<span class="c__label" data-l="idle">Merge 3 duplicates</span>
<span class="c__label" data-l="wait">Merging records</span>
<span class="c__label" data-l="done">Merged into 1 contact</span>
</span>
</button>
<div class="note" id="c-note" aria-live="polite">
<span class="note__line" data-n="idle">Dana Whitfield<span class="note__sep">·</span><span class="note__roll"><span data-count>3</span></span> <span data-word>records</span></span>
<span class="note__line" data-n="done">Kept 2 emails, 1 phone, 14 notes<span class="note__sep">·</span><button class="note__undo" type="button" data-undo tabindex="-1">Undo</button></span>
</div>
</div>
</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.
29 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 “Merge duplicates button” from Animorio and fit it into my siteThe three avatars sit absolutely in the middle of a 56-pixel window and GSAP only moves them on x (-14, 0, 14). So taking the window to 28 pixels and every x to zero is enough to keep the last avatar centred, with nothing to recalculate.
A single timeline: the run-up outwards, the third sliding onto the second and fading as it shrinks, the keyframed squash of the one taking the hit, then the second and first meeting while the window narrows. The count below rolls on the same instant as the impact. timeScale fits the whole timeline to MERGE.
Inside the pill there are stacked layers: the dark skin, the violet one with its own shadow, the progress band (a gradient with a bright edge that comes in with xPercent from -101 to 0) and the light. The violet fades in, and the ring around the avatars changes colour through a CSS variable animated by GSAP.
The background lives in a child of the pill that grows on hover with an elastic inset transition, and the label takes its width from a --hw variable registered with @property, so it widens with the bounce too. During a swap GSAP squeezes the label with --sq: the label room is measured at the widest setting, after the font has loaded.
| Name | File | Default | What it changes |
|---|---|---|---|
COPIES | script.js | 3 | How many copies of the same contact, in the pill and the line below. |
MERGE | script.js | 1.5 | The seconds the copies take to slide into each other. |
SPREAD | script.js | 14 | The distance between avatars in the stack, in pixels. |
BOUNCE | script.js | 1.6 | How much the avatars and the pill bounce. |
HOLD | script.js | 2.6 | The seconds the Merged state stays before the button is ready again. |
SHEEN | script.js | 1 | How strong the light crossing the violet pill is (0 off). |
--viola | style.css | #5a48ee | The colour of the finished pill and the check. |
--lilla | style.css | #d9d3ff | The colour of the avatar that stays. |
In a CRM, a customer address book, a back office or any dashboard that finds duplicate records (contacts, companies, products): the gesture shows the copies becoming one without losing anything, and the line below says what was kept with a way to undo.
The pill drops to 56 pixels and the label tightens by a point; the finger taps like the mouse and tells the same story. Without hover the light stays off and the avatars do not fan out before the tap.
No sliding avatars or squashes: the stack fades out and back in with a single avatar, the label and the line below change with a fade, the violet fades in and the check appears already drawn; on the way back the same in reverse.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 KB; the libraries: GSAP 28 KB.
Tested on 16 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.