Skip to content
animorio
IT
All components

Connect calendar button

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

The integrations card of Slotwise, a made-up booking app, to connect the Datebook calendar, made up too. At the top the two apps in their circles with a dashed wire between them; on tap the elastic «Connect calendar» pill squashes, the permission sheet opens below and its three items tick in a row; the pill becomes «Allow access». On the second tap the pill closes into a circle with a spinning ring, the sheet folds away, the two circles move together, the blue wire draws between them and the knot in the middle lights up; then the pill opens again into «Connected» with a tick and «Synced with Datebook · just now» arrives under the title. On white, with a single blue accent.

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>
<!--
  "Connect calendar 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>Connect calendar 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 calendar integration card of Slotwise, a made-up booking app: the two apps in their circles, the elastic
         pill. Connect opens the permission sheet, the permissions tick in a row, Allow access closes the pill into a
         ring while the two circles move together and the wire between them draws, then Connected -->
    <section class="card" data-card aria-label="Connect your calendar to Slotwise">
      <span class="card__edge" aria-hidden="true"></span>

      <div class="link" aria-hidden="true">
        <span class="app app--ours" data-a>
          <svg viewBox="0 0 40 40">
            <rect class="ours__bg" x="0" y="0" width="40" height="40" rx="20"/>
            <path class="ours__mark" d="M13 15.5h14M13 20h9M13 24.5h14"/>
            <circle class="ours__dot" cx="26" cy="20" r="2.2"/>
          </svg>
        </span>
        <span class="wire" data-wire-box>
          <span class="wire__track" data-track>
            <svg viewBox="0 0 100 8" preserveAspectRatio="none">
              <path class="wire__dash" d="M2 4H98"/>
              <path class="wire__line" d="M2 4H98" pathLength="1" data-wire/>
            </svg>
          </span>
          <span class="wire__knot" data-knot>
            <svg viewBox="0 0 16 16"><path d="M6.6 9.4 9.4 6.6M7.4 4.6l1-1a2.6 2.6 0 0 1 3.7 3.7l-1 1M8.6 11.4l-1 1a2.6 2.6 0 0 1-3.7-3.7l1-1"/></svg>
          </span>
        </span>
        <span class="app app--cal" data-b>
          <svg viewBox="0 0 40 40">
            <rect class="cal__bg" x=".5" y=".5" width="39" height="39" rx="19.5"/>
            <rect class="cal__page" x="11" y="11.5" width="18" height="17" rx="3"/>
            <path class="cal__band" d="M11 15.2a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.3H11z"/>
            <path class="cal__ring" d="M15.5 9.8v3.4M24.5 9.8v3.4"/>
            <text class="cal__day" x="20" y="25.6" text-anchor="middle">12</text>
          </svg>
        </span>
      </div>

      <div class="head">
        <p class="brand">Slotwise · Integrations</p>
        <h1 class="name">Sync your bookings</h1>
        <p class="meta">
          <span class="meta__face" data-m="off">New bookings land on your Datebook calendar.</span>
          <span class="meta__face" data-m="on" aria-hidden="true">
            <svg class="ico" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 5"/></svg>
            Synced with Datebook · just now
          </span>
        </p>
      </div>

      <!-- the permission sheet, opened by Connect calendar -->
      <div class="sheet" data-sheet aria-hidden="true">
        <div class="sheet__in">
          <p class="ask">Slotwise will be able to</p>
          <ul class="perms">
            <li class="perm" data-perm>
              <span class="box"><svg viewBox="0 0 16 16"><path d="M4 8.4 6.8 11 12 5.4" pathLength="1"/></svg></span>
              <span class="perm__txt">See your events</span>
              <span class="perm__tag">Read</span>
            </li>
            <li class="perm" data-perm>
              <span class="box"><svg viewBox="0 0 16 16"><path d="M4 8.4 6.8 11 12 5.4" pathLength="1"/></svg></span>
              <span class="perm__txt">Create events for bookings</span>
              <span class="perm__tag">Write</span>
            </li>
            <li class="perm" data-perm>
              <span class="box"><svg viewBox="0 0 16 16"><path d="M4 8.4 6.8 11 12 5.4" pathLength="1"/></svg></span>
              <span class="perm__txt">Free/busy only for others</span>
              <span class="perm__tag">Private</span>
            </li>
          </ul>
        </div>
      </div>

      <div class="row">
        <button class="pill" type="button" data-pill data-autoclic aria-label="Connect calendar">
          <span class="pill__bg" data-pill-bg aria-hidden="true"></span>
          <span class="pill__face" data-face="connect">
            <svg class="ico" viewBox="0 0 16 16"><rect x="2.6" y="3.4" width="10.8" height="10" rx="2"/><path d="M2.6 6.6h10.8M5.6 2v2.6M10.4 2v2.6"/></svg>
            <span class="pill__txt">Connect calendar</span>
          </span>
          <span class="pill__face" data-face="allow" aria-hidden="true"><span class="pill__txt">Allow access</span></span>
          <span class="pill__face" data-face="wait" aria-hidden="true">
            <svg class="ring" viewBox="0 0 20 20" data-ring><circle class="ring__track" cx="10" cy="10" r="7"/><circle class="ring__arc" cx="10" cy="10" r="7" pathLength="1"/></svg>
          </span>
          <span class="pill__face" data-face="done" aria-hidden="true">
            <svg class="ico ico--tick" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 5" pathLength="1" data-tick/></svg>
            <span class="pill__txt">Connected</span>
          </span>
        </button>
      </div>

      <button class="undo" type="button" data-undo aria-hidden="true" tabindex="-1">Disconnect</button>

      <p class="sr" aria-live="polite" data-live></p>
    </section>
  </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

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Connect calendar 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 hover the pill’s label widens on the width axis and the ground swells with a bounce. On tap the pill squashes and springs back; the grey permission sheet opens below, the three items rise in a row and their boxes fill with blue one after another as the tick draws itself; the pill says «Allow access». On the second tap the pill narrows into a circle with a white ring spinning in the middle, the sheet folds away, the two app circles slide towards each other, the blue wire draws over the dashed one and, when it arrives, the circles and the chain knot give a small jolt. Then the pill widens again on a spring, turns dark and says «Connected» with a tick; the line under the title becomes «Synced with Datebook · just now» and «Disconnect» appears, which takes everything back to the start. If nobody touches it, the demo does everything by itself and starts over.

How it works

The pill’s four faces

«Connect calendar», «Allow access», the ring and «Connected» sit on top of each other in absolute position, centred with inset 0 and flex: the pill swaps faces with a fade and a small hop, and when it narrows into a circle no hidden label can push the ring off centre.

The pill that becomes a circle

The width goes in measured pixels, from the row’s width to the pill’s height, and comes back on an elastic spring; at the end the inline width is cleared, so on resize the pill follows the card again. The ring spins on the whole svg with transformOrigin 50% 50%.

The permission sheet

The sheet has zero height and hidden overflow; GSAP takes it to the measured height of its content and meanwhile fills the boxes one after another, each with a small scale bounce, and draws the ticks with stroke-dashoffset on pathLength 1 (with autoRound off).

The two circles and the wire

The circles slide towards each other by a share of the wire’s width, and the wire shortens with scaleX by the same amount; over the grey dashes a blue line draws with stroke-dashoffset, and on arrival the circles and the knot give a scale jolt on a spring.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js0.55Seconds the permission sheet takes to open under the pill.
TICK_GAPscript.js0.22Seconds between one permission tick and the next.
CONNECT_TIMEscript.js1.4Seconds the ring spins while the two apps link up.
PULLscript.js0.24How far the two circles move towards each other (0 not at all, 0.5 halfway).
SQUASHscript.js0.9How flat the pill gets when pressed (1 = not at all).
SPRINGscript.js0.45How springy the pill and the circles are (lower = more bounce).
HOLDscript.js2.4Seconds the connected state stays before the demo starts over.
IDLEscript.js7Seconds after your last touch before the demo plays by itself again.

Try them in the Playground

When to use it

On the integrations page of a booking app, a CRM or a work tool: the moment you link an outside account, with the permissions clear before you authorise and a visible sign that the connection worked.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the card fits whole in the phone box even with the sheet open. The pill is as wide as the card, easy for the thumb, and «Disconnect» is a real button, tall enough to tap.

With reduced motion

No springs, slides or spinning ring: the sheet opens at once, the boxes fill with a fade, the wire appears, the pill goes from wide to circle and back without motion, and the faces swap with a fade.

Pitfalls

  • The pill’s faces sit in absolute position with inset 0: «Connect calendar», the longest, in the flow would have kept the pill wide and the ring off the circle’s centre.
  • The wire has a box of its own: the CSS centres it with a margin, not with translateY, because GSAP’s transform (scaleX) would have wiped out the class’s one.
  • The pill’s width goes in measured pixels, not percentages (GSAP doesn’t read percentages back from CSS), and is cleared at the end, otherwise on resize the old one stays.
  • With pathLength 1 the ticks and the wire need autoRound off: GSAP would round stroke-dashoffset to 0 or 1 and they would pop in.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 2 December 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