Skip to content
animorio
IT
All components

Available for work button

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

The availability button for a freelancer’s portfolio: a dark pill with a calendar and the label ‘Available for work’. Pressed, the pill makes room and three months come out, one after the other, each with a small bar filling with the time still free; the ring round the calendar closes to the free share, the tick draws itself and the label says from when. Pressed again, everything folds back.

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>
<!--
  "Available for work 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>Available for work button with the free months opening inside the pill</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 availability button of a freelancer's portfolio: pressed, the pill makes room and three months come out
         one after the other, each with a small bar that fills with the time still free; the ring round the sign closes
         to the share of free time, the tick in the calendar draws itself and the label says from when; pressed again,
         everything folds back -->
    <button class="avail" type="button" data-avail aria-expanded="false">
      <span class="avail__body" aria-hidden="true"><span class="avail__wash" data-wash></span><span class="avail__light"></span></span>

      <span class="seat" data-seat aria-hidden="true">
        <svg class="seat__ring" viewBox="0 0 54 54"><circle class="seat__track" cx="27" cy="27" r="25"></circle><circle class="seat__arc" data-ring cx="27" cy="27" r="25" pathLength="1"></circle></svg>
        <span class="seat__disc">
          <svg viewBox="0 0 24 24"><rect x="4.4" y="5.8" width="15.2" height="13.8" rx="3.2"></rect><path d="M8.4 3.8v3.6M15.6 3.8v3.6M4.4 10.2h15.2"></path><path class="seat__tick" data-tick pathLength="1" d="M8.9 14.6 11.2 16.9 15.4 12.5"></path></svg>
        </span>
      </span>

      <span class="label" data-label><span class="label__word" data-word>Available for work</span></span>

      <span class="months" data-months aria-hidden="true">
        <span class="month" data-month data-free="1"><b>Feb</b><i><u></u></i></span>
        <span class="month" data-month data-free="0.6"><b>Mar</b><i><u></u></i></span>
        <span class="month" data-month data-free="0.3"><b>Apr</b><i><u></u></i></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.

15 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 “Available for work 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 middle, on white, a dark pill 60 pixels tall: on the left, in a round seat, a calendar drawn in line, then the label ‘Available for work’. The pointer arrives, the pill lifts by a pixel and a soft light follows it; on press it squeezes and comes back on a spring. On click the label rolls to ‘From Feb’ and narrows, the pill widens with a small bounce and three tiles come into the new room, Feb, Mar, Apr, one after the other, each on a spring; under each name a small bar fills with green: all of it in February, more than half in March, a third in April. Meanwhile a green ring closes round the calendar up to the share of free time, a tick draws itself inside the calendar, a green veil stays on the calendar’s side and the shadow under the pill takes the green. A second click folds everything back: the tiles leave from the last one, the pill narrows, the ring empties and ‘Available for work’ returns. Left alone, a pointer opens it, looks at the months and closes it.

How it works

A pill as wide as its content

The button is inline-flex with no width: the label and the months tray decide it. GSAP animates the width of those two (measured at the start for both states) with elastic.out, and the pill follows.

The months, one after the other

Each tile comes in from scale 0.5 and 8 pixels lower with elastic.out, staggered by STAGGER; two tenths later its small bar scales horizontally to the free share written in data-free.

The ring and the tick

The ring is an SVG circle with pathLength 1: its stroke-dashoffset goes to 1 minus the average of the free shares. The tick inside the calendar draws itself the same way.

Closing

The tiles leave from last to first, then tray and label return to their rest sizes with power3.inOut: opening has the bounce, closing does not, so the pill seems to fold back calmly.

Values to change

NameFileDefaultWhat it changes
IDLEscript.jsAvailable for workThe label at rest.
FROMscript.jsFrom FebThe label with the months open: from when you are free.
ACCENTscript.js#35d07fThe colour of free time.
SPRINGscript.js0.8How long the spring of the opening pill lasts, in seconds.
STAGGERscript.js0.07The delay between one month and the next, in seconds.
HOLDscript.js2.8By itself: how many seconds the months stay open.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

In the header or the contact page of the portfolio of a freelancer, a studio or a small agency: it says at once whether there is room and from when, before anyone even writes. The months and shares are changed in the HTML.

On phones

The same button: open it is 306 pixels wide and fits screens from 320 up. No light following the pointer.

With reduced motion

No springs: the pill goes straight to the new width, the months appear with their bars already full and the label changes with a fade.

Pitfalls

  • To measure how wide a label is inside a wider container scrollWidth is not enough, it returns the container’s width: the word must be made inline-block for a moment.
  • The state is also said in words (aria-expanded and a line for screen readers with the shares): green alone is not enough.
  • No pulsing dot to say ‘available’: here the calendar, the ring and the tick say it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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