Skip to content
animorio
IT
All components

Slide to answer call

Notifications, Hover, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 8.5 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a very light grey background, in the middle, the white card of a call: the round avatar with the initials NH on a peach and violet gradient, Noor Halvorsen and below, next to a small camera, Incoming video call, with a sheen running over it now and then. Below, a grey track with a round green handle and its white receiver, and the words slide to answer with their arrow. Every two and a half seconds the card buzzes for a moment and the receiver shakes. The fake pointer takes the handle halfway and lets it go: the handle runs back on a spring, hits the start and bounces slightly, while the green behind it shortens and the words come back. The second time it pulls with momentum: the handle runs to the end, squashes for a moment against the edge and the card shrinks and goes dark, the call bar with the avatar, the name, the green time counting 00:01, 00:02 with the digits rising, five little voice bars moving, the mute button and the red one to hang up. The pointer presses mute: the circle turns white, a slash draws itself over the microphone and the bars go quiet; pressed again, the voice comes back. Then it presses hang up: the bar becomes a small white pill, Call ended · 0:06, and after a moment the call rings again.

How it works

A number, a velocity

The 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.

The throw decides

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.

A real spring

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.

One surface

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 and the voice

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.

Values to change

NameFileDefaultWhat it changes
SOGLIAscript.js0.82How far the handle must go (from 0 to 1) for the call to start.
MOLLAscript.js340How stiff the spring that pulls the handle back is.
ATTRITOscript.js22How quickly the spring settles (lower, more bounces).
SPINTAscript.js0.14How much the speed of the throw counts.
VIBRA_OGNIscript.js2.4How often, in seconds, the card buzzes while ringing.
VERDEscript.js#22a55bThe green of the handle.
NOMEscript.jsNoor HalvorsenWho is calling.

Try them in the Playground

When to use it

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.

On phones

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).

With reduced motion

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.

Pitfalls

  • Without pointer capture a finger leaving the handle never sends pointerup and the handle stays caught halfway.
  • The velocity must be measured with the GSAP ticker’s time, not the computer’s clock, otherwise a slow frame looks like a very fast throw.
  • Without the wall at the start the spring would carry the handle past the left edge of the track before coming back.
  • The dark colour must arrive when the surface is almost the size of the bar: blended through the whole change it becomes a big grey rectangle.

Libraries

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.

Testing

Tested on 28 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components