
The layered button
Buttons, Hover, Physics
The incoming call of a video-calling app, on very light grey: one gesture, slide. The card buzzes now and then while it rings; the green handle is dragged along the track with real inertia and a spring and, if it does not reach the end, it runs back and bounces off the edge. Once there, the card shrinks into the dark call bar, with the running time, the voice level, the mute button and the red one to hang 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>
<!--
"Slide to answer call" 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 incoming call you slide to answer</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: slide. The incoming call of a video-calling app: the card buzzes now and then, the handle is
dragged along the track with real inertia and springs back if it does not reach the end; at the end the card
becomes the dark call bar with the running time, mute and hang up -->
<section class="pezzo" data-pezzo aria-label="Incoming call">
<div class="superficie" data-superficie>
<!-- incoming -->
<div class="strato strato--arrivo" data-strato="arrivo">
<div class="chi">
<span class="avatar" aria-hidden="true">
<span class="avatar__luce"></span>
<span class="avatar__iniziali">NH</span>
</span>
<span class="chi__testo">
<span class="chi__nome" data-nome>Noor Halvorsen</span>
<span class="chi__cosa">
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="7" width="12.5" height="10" rx="2.4"></rect><path d="M15.5 10.6 20.2 8v8l-4.7-2.6"></path></svg>
<span class="chi__luccica">Incoming video call</span>
</span>
</span>
<span class="app" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M6.5 15.5a6.5 6.5 0 1 1 11 0"></path><path d="M9.3 13.9a3.2 3.2 0 1 1 5.4 0"></path><path d="M12 13.6v5.2"></path></svg>
</span>
</div>
<div class="binario" data-binario>
<span class="binario__pieno" data-pieno></span>
<span class="binario__scritta" data-scritta>
<span>slide to answer</span>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"></path></svg>
</span>
<button class="maniglia" type="button" data-maniglia aria-label="Slide to answer the call" role="slider" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<svg class="maniglia__cornetta" data-cornetta viewBox="0 0 24 24" aria-hidden="true"><path d="M7.2 3.6 9.5 3c.6-.1 1.1.2 1.3.7l1 2.6c.2.5 0 1.1-.4 1.4l-1.5 1.1a12 12 0 0 0 5.3 5.3l1.1-1.5c.3-.4.9-.6 1.4-.4l2.6 1c.5.2.8.7.7 1.3l-.6 2.3c-.2.6-.7 1-1.3 1A16.6 16.6 0 0 1 5.6 4.9c0-.6.4-1.1 1-1.3Z"></path></svg>
</button>
</div>
</div>
<!-- in the call -->
<div class="strato strato--chiamata" data-strato="chiamata">
<span class="avatar avatar--piccolo" aria-hidden="true">
<span class="avatar__luce"></span>
<span class="avatar__iniziali">NH</span>
</span>
<span class="barra__testo">
<span class="barra__nome" data-nome-barra>Noor Halvorsen</span>
<span class="tempo" data-tempo aria-live="off"><span class="cifra" data-c="0">0</span><span class="cifra" data-c="1">0</span><span class="due">:</span><span class="cifra" data-c="2">0</span><span class="cifra" data-c="3">0</span></span>
</span>
<span class="onda" aria-hidden="true" data-onda><i></i><i></i><i></i><i></i><i></i></span>
<button class="tondo tondo--muto" type="button" data-muto aria-pressed="false" aria-label="Mute microphone">
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="3.5" width="6" height="11" rx="3"></rect><path d="M5.8 11.5a6.2 6.2 0 0 0 12.4 0M12 17.7v2.8"></path><path class="muto__barra" data-barra-muto d="M4.5 4.5l15 15" pathLength="100"></path></svg>
</button>
<button class="tondo tondo--chiudi" type="button" data-chiudi aria-label="Hang up">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3.3 13.6c4.9-4.3 12.5-4.3 17.4 0 .4.4.5 1 .2 1.5l-1.2 1.9c-.3.5-.9.7-1.4.5l-2.6-.9c-.5-.2-.8-.7-.8-1.2l.1-1.9a12 12 0 0 0-6 0l.1 1.9c0 .5-.3 1-.8 1.2l-2.6.9c-.5.2-1.1 0-1.4-.5l-1.2-1.9c-.3-.5-.2-1.1.2-1.5Z"></path></svg>
</button>
</div>
<!-- ended -->
<div class="strato strato--fine" data-strato="fine">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3.3 13.6c4.9-4.3 12.5-4.3 17.4 0 .4.4.5 1 .2 1.5l-1.2 1.9c-.3.5-.9.7-1.4.5l-2.6-.9c-.5-.2-.8-.7-.8-1.2l.1-1.9a12 12 0 0 0-6 0l.1 1.9c0 .5-.3 1-.8 1.2l-2.6.9c-.5.2-1.1 0-1.4-.5l-1.2-1.9c-.3-.5-.2-1.1.2-1.5Z"></path></svg>
<span>Call ended · <span data-durata>0:00</span></span>
</div>
</div>
</section>
<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.
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 “Slide to answer call” from Animorio and fit it into my siteThe handle is a position and a velocity. While dragging, the velocity is measured between one move and the next, smoothed; past the end the handle resists like a rubber band, at 18 per cent of the movement.
On release we look at where the handle would land: the position plus the velocity times SPINTA. If it passes SOGLIA it goes to the end and the call starts, otherwise it runs back: a fast throw answers even from halfway, a slow one does not.
On every frame of the GSAP ticker the acceleration is −MOLLA times the position minus ATTRITO times the velocity. The start is a wall: the handle hits it and bounces back with a third of its speed instead of going through. While it runs it stretches slightly, in proportion to its speed.
The card, the call bar and the final pill are three layers in the same surface: GSAP takes its width, height and radius to the size of the incoming layer with back.out, and changes the colour only near the end, so the white never turns into a big grey block.
The time is a chain of one-second delayedCalls: each digit that changes rises from below with back.out, the others stay still. The five voice bars change height at random with repeatRefresh, and on mute they all go low.
| Name | File | Default | What it changes |
|---|---|---|---|
SOGLIA | script.js | 0.82 | How far the handle must go (from 0 to 1) for the call to start. |
MOLLA | script.js | 340 | How stiff the spring that pulls the handle back is. |
ATTRITO | script.js | 22 | How quickly the spring settles (lower, more bounces). |
SPINTA | script.js | 0.14 | How much the speed of the throw counts. |
VIBRA_OGNI | script.js | 2.4 | How often, in seconds, the card buzzes while ringing. |
VERDE | script.js | #22a55b | The green of the handle. |
NOME | script.js | Noor Halvorsen | Who is calling. |
In the app of a video-calling, support or remote consultation service, in the app of a hotel or a restaurant calling a guest back: wherever a call arrives on screen and has to be accepted with a precise gesture that is not made by mistake.
The same card at the width of the box, a finger drags like the mouse and the page does not scroll while dragging (touch-action none on the handle and the track).
No buzz, spring, stretch or bounces: the handle can still be dragged, on release it goes straight to the end or to the start, the layers change with a fade and the voice bars stay low.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.5 KB; the libraries: GSAP 28 KB.
Tested on 28 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.