Skip to content
animorio
IT
All components

Call elevator button

Buttons, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.3 KBGSAP 28 KBFreeDownload the zip

The Call elevator button in the app of Pellham House, a made-up office building: a pill of light brushed aluminium on white, with the two little lift doors on the left and the floor display on the right. Pressed, it sinks and springs back, the arrow lights up in blue and turns down, and the floor rolls down digit by digit from 12 to L, slow at the start, fast in the middle and slow at the end, while a short line runs down its track. Two floors before, Arriving appears; on L two thin rings open out from the button like the chime, the little doors slide apart on a lit cabin and the words become Doors open; then they close with a tiny knock and the button is ready again.

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>
<!--
  "Call elevator 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>Call elevator button</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">
    <!-- the call button of the Pellham House building app: a pill of soft brushed aluminium with the lift doors on the
         left and the floor display on the right. Pressed, it sinks and springs back, the arrow lights up, the floor
         rolls down digit by digit from 12 to L, a thin ring opens like the chime, the little doors slide apart on a
         lit cabin and the words say Doors open; then they close and it all goes back to rest -->
    <div class="lift" data-wrap>
      <span class="lift__shadow" data-shadow aria-hidden="true"></span>
      <span class="lift__ring" data-ring aria-hidden="true"></span>
      <span class="lift__ring" data-ring aria-hidden="true"></span>
      <button class="lift__btn" type="button" data-btn data-autoclic aria-label="Call elevator. Lift B is on floor 12">
        <span class="lift__body" data-body>
          <span class="lift__metal" aria-hidden="true"></span>
          <span class="lift__brush" aria-hidden="true"></span>
          <span class="lift__shine" data-shine aria-hidden="true"></span>
          <span class="lift__spill" data-spill aria-hidden="true"></span>
          <span class="lift__row">
            <span class="lift__doors" aria-hidden="true">
              <span class="lift__cabin" data-cabin>
                <span class="lift__cabin-light" data-cabinlight></span>
                <span class="lift__cabin-floor"></span>
              </span>
              <span class="lift__door lift__door--l" data-door><span class="lift__door-face"></span></span>
              <span class="lift__door lift__door--r" data-door><span class="lift__door-face"></span></span>
              <span class="lift__frame"></span>
            </span>
            <span class="lift__words">
              <span class="lift__stack" aria-hidden="true">
                <span class="lift__label" data-label>Call elevator</span>
                <span class="lift__label" data-label>On its way</span>
                <span class="lift__label" data-label>Arriving</span>
                <span class="lift__label" data-label>Doors open</span>
              </span>
              <span class="lift__stack" aria-hidden="true">
                <span class="lift__sub" data-sub>Pellham House · Lift B on <span data-fromword>12</span></span>
                <span class="lift__sub" data-sub>Lift B · going down</span>
                <span class="lift__sub" data-sub>Lift B · Lobby</span>
                <span class="lift__sub" data-sub>Lift B · going up</span>
              </span>
            </span>
            <span class="lift__display" data-display aria-hidden="true">
              <span class="lift__arrow">
                <svg viewBox="0 0 14 16"><path data-arrow d="M7 13.2V3.2M3 7.1 7 3.1l4 4"/></svg>
              </span>
              <span class="lift__digits">
                <span class="lift__slot lift__slot--tens" data-slot><span class="lift__ch" data-ch>1</span></span>
                <span class="lift__slot" data-slot><span class="lift__ch" data-ch>2</span></span>
              </span>
              <span class="lift__track"><span class="lift__run" data-run></span></span>
            </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>

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.

28 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 “Call elevator button” 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 white ground there is a single pill button 60 pixels tall, in light brushed aluminium: a gradient from white to cool grey, a very fine horizontal brush, the one pixel edge catching the light at the top and a soft layered shadow, plus a patch of shadow on the floor. On the left a small tile with the two lift doors in steel, with the seam in the middle and a vertical brush; in the middle Call elevator and under it Pellham House · Lift B on 12; on the right, after a thin line, the display: the up arrow, the 12 in large fixed width figures and a thin track. On hover a soft light follows the pointer, the arrow rises by a pixel and the words widen slightly on the wdth axis. Pressed, the button shrinks and sinks by a pixel while the shadow under it gathers; let go, it comes back with an elastic. The arrow lights up in blue with a small push and turns on a spring to point down, since the cabin is above and comes down to you; the words become On its way, a short blue line starts running down the track and the digits turn blue. Then the floor comes down: 12, 11, 10, 9 down to 1 and L, each changing digit leaving at the bottom while the new one comes in from the top, only the one that changes, slow at the start, fast and slightly blurred in the middle, slow at the end; when the tens empty, their slot closes and the number centres again. Two floors before, the words become Arriving. On L the letter passes the mark by a pixel and settles, the track goes dark, the button swells slightly and two thin blue rings open out from its edge one after the other and fade, like the chime. The little doors slide apart on a spring and uncover the cabin: a light that flickers and comes on at the top, the pale blue floor and a blue glow spreading on the metal around; the words become Doors open, Lift B · going up, and only then the arrow turns back up. While they stay open the cabin light breathes. Then the doors close, meet with a tiny knock that shakes the button by half a pixel, the words go back to Call elevator and the floor rises quickly from L to 12 in grey, ready for the next call.

How it works

The digits in two slots

The display has two slots, tens and units, one line tall with hidden overflow. For each floor the two characters are worked out (the lobby is L); when one changes a new span is created above the slot, the old one leaves at the bottom with a yPercent of 100 and the new one comes in from -100% to 0. Only the digit that changes moves, and when the tens are empty their slot closes from 15 to 0 pixels.

The ride slow, fast, slow

The floor times come from the inverse of power2.inOut: floor k arrives at RIDE times the inverse of k over the number of floors. Each roll lasts 85% of the gap to the next one (between 0.08 and 0.3 seconds) and the digits blur slightly when the gap is short; the last one comes in with a back.out and passes the mark by a pixel.

One timeline for the whole round

The click builds a GSAP timeline: the arrow lighting up, the words changing, the track running, the floors as calls at their moments, then the chime, the doors, the wait and the closing. During the round extra clicks are ignored, and the button still presses under the finger.

The chime and the doors

The rings are pills with a 1.5 pixel border: GSAP animates their inset property from 0 to -13 and -17 pixels, so they widen without thickening the border as a scale would. The doors are two halves sliding by xPercent -86 and 86 with power3.inOut and settling at 84, leaving the edge of each leaf in sight with a back.out; closing, they meet with a 3% bounce.

Values to change

NameFileDefaultWhat it changes
FROM_FLOORscript.js12The floor the lift starts from (2 to 39).
RIDEscript.js3The seconds the lift takes to come down to the lobby.
HOLDscript.js1.9The seconds the doors stay open.
SPRINGscript.js1How springy the press, the digits and the doors are.
PRESSscript.js0.972How much the pill shrinks when pressed.
RINGSscript.js2How many thin rings open for the chime (0 to 3).
--accentstyle.css#2f5bffThe blue of the arrow, the moving floors, the chime and the cabin light.
--metal-lostyle.css#e6e8edThe bottom of the button’s aluminium.

Try them in the Playground

When to use it

In the app of an office building, a coworking space or a hotel to call the lift from the phone, in a smart building panel or on the page of a residence; and as the button for an action with a real countdown (an order on its way, a turn at the counter, a place in a queue).

On phones

The pill narrows to 88% of the screen while staying 60 pixels tall, the small words shorten with an ellipsis if they do not fit and under 360 pixels the text gets half a point smaller. A tap presses and lets go like the mouse, and the soft light comes on where you touch.

With reduced motion

No press, rolling, sliding doors or widening rings: the words change with a fade, the floor goes from 12 to L with a fade, the rings appear and fade standing still, the doors fade away on the lit cabin and then come back.

Pitfalls

  • The digit spans are replaced on every floor: a colour tween created at the start of the timeline would colour spans already removed, so the colour changes after the rolls start from a call that takes the spans on show at that moment, and each new span copies the old one’s colour.
  • With a scale the chime rings thickened their border and stretched along the long sides of the pill: the inset property is animated instead, widening them while the border stays 1.5 pixels.
  • A click with no press before it (keyboard, the preview autopilot) did not show the button sinking: in that case the click makes a short press itself and lets it go.
  • The arrow pointed up even while the cabin was coming down to us: now it turns down on a spring as soon as it sets off, and turns back up only when the words say going up, with the doors open.
  • While the doors stayed open nothing moved and the preview video stopped before they closed: the cabin light breathes until the doors close again.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.3 KB; the libraries: GSAP 28 KB.

Testing

Tested on 18 November 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