Skip to content
animorio
IT
All components

Open the gate button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 5.0 KBGSAP 28 KBFreeDownload the zip

The button that opens the gate in a video intercom’s app: a dark pill with a small door and the opening seconds. Pressed, the buzz shakes the seat and sends two waves, the small door swings open on its hinge, the pill lights up yellow and a line along the bottom runs out with the seconds; at zero the door slams and the gate is locked 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>
<!--
  "Open the gate 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>Open the gate button of the intercom with the time that runs out before it locks again</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 gate button of a video intercom's app: pressed, the buzzer sends its waves, the little door swings
         open and a line along the bottom of the pill runs out with the seconds; at zero the door closes again -->
    <button class="gate" type="button" data-gate>
      <span class="gate__body" aria-hidden="true"><span class="gate__bar" data-bar></span><span class="gate__light"></span></span>
      <span class="gate__edge" aria-hidden="true"></span>

      <span class="seat" data-seat aria-hidden="true">
        <svg viewBox="0 0 24 24">
          <path d="M6.200 20.400V5.600a2 2 0 0 1 2-2h7.600a2 2 0 0 1 2 2v14.800M4 20.400h16"></path>
          <g data-leaf><path class="seat__leaf" d="M8.400 5.800h7.200v14.600H8.400Z"></path><path class="seat__knob" d="M13.400 12.600v1.400"></path></g>
          <path class="seat__wave" data-wave d="M19.800 9.200a4 4 0 0 1 0 5.600"></path>
          <path class="seat__wave" data-wave d="M22 7.200a7 7 0 0 1 0 9.600"></path>
        </svg>
      </span>

      <span class="label">
        <span class="label__main"><span data-word>Open the gate</span></span>
        <span class="label__sub"><span data-sub>Courier at the front gate</span></span>
      </span>
      <span class="tag" aria-hidden="true"><span data-secs>5s</span></span>
    </button>
    <p class="sr" data-live aria-live="polite"></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>

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.

14 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 “Open the gate 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

In the centre, on white, a dark pill 60 pixels tall whose edge catches the light: on the left, in a round seat, a small outline door in its frame, then “Open the gate” with who rang below (“Courier at the front gate”) and on the right a tag with the seconds, “5s”. Pressed, the label rolls to “Buzzing”, the seat shakes and two yellow waves leave the door, twice. Then the small door turns on its hinge and narrows, the pill takes a yellow glow, the tag turns yellow and the label says “Gate open”, with “Locks again by itself” below; a yellow line along the bottom of the pill shortens at constant speed while the tag counts 5, 4, 3, 2, 1. At zero the small door snaps shut, the seat takes the hit, the label says “Locked again” and after a second everything goes back.

How it works

The buzz

For BUZZ seconds the seat swings 1.2 pixels right and left (a tween going and returning, repeated) and two SVG arcs light one after the other while moving 4 units, twice.

The door

The leaf is an SVG group with its origin on the hinge (svgOrigin on the left side): opening it goes to scaleX 0.42 with a small skewY, that is, it is seen at an angle; back.out makes it slightly pass the point and return. Closing it uses power3.in, which accelerates up to the hit.

The seconds

A number goes from OPEN down to zero in OPEN seconds, linear: the line at the bottom has scaleX equal to its fraction and the tag shows the number rounded up, rewritten only when it changes. At the end the timeline calls the locking.

Values to change

NameFileDefaultWhat it changes
OPENscript.js5For how many seconds the gate stays open.
BUZZscript.js0.6How many seconds the buzz lasts before opening.
WHOscript.jsCourier at the front gateWho rang (invented).
ACCENTscript.js#ffd24aThe colour of the open gate and of the line.
RESTscript.js1.6On its own: how many seconds it waits before trying again.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

For the app of a video intercom, a smart lock, an automatic gate or an apartment block: you see at once that it is open and for how much longer. It suits any action that holds for a few seconds: a temporary code, a link that expires, a timed unlock.

On phones

The same button: the pill takes at most the screen width minus the margins; it is pressed with a finger and there is no light under the pointer.

With reduced motion

No shaking, waves or turning door: the door is open or closed at once, the line and the seconds still go down because they are the information.

Pitfalls

  • While the gate is open the button does not restart: a second press does not extend the time, like a real door release.
  • The line sits inside the pill, at the bottom, and runs out towards the left: it is not the progress bar at the top of the page.
  • The state is told in three ways: colour, word (“Gate open”, “Locked again”) and aria-pressed, with a line for screen readers giving the seconds.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 15 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