Skip to content
animorio
IT
All components

Wake-up call button

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

The button to book a wake-up call at a made-up hotel, Halden House. At rest it is a night-coloured pill with a small moon over the horizon. One tap rings the front desk: the moon sets, a handset rocks with its two waves and the label shines while it waits. When the desk confirms, the pill grows on a spring, the time rolls in one character at a time and a small sun rises over the horizon with a tick on it, while the night of the pill turns into dawn. Cancel sets the sun again and the moon comes 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>
<!--
  "Wake-up call 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>The hotel wake-up call button with the sun rising in 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 wake-up call button of a made-up hotel, Halden House: one tap rings the front desk, then the time rolls
         in and a small sun rises over the horizon inside the pill, turning the night into dawn. Cancel sets it back. -->
    <div class="wrap" data-wrap>
      <div class="pill" data-pill>
        <span class="pill__night" aria-hidden="true"></span>
        <span class="pill__dawn" data-dawn aria-hidden="true"></span>
        <span class="pill__glow" data-glow aria-hidden="true"></span>
        <span class="pill__light" data-light aria-hidden="true"></span>
        <span class="pill__grain" aria-hidden="true"></span>
        <span class="pill__rim" data-rim aria-hidden="true"></span>

        <!-- the little window on the left: moon, then the handset ringing, then the sun over the horizon -->
        <span class="slot" aria-hidden="true">
          <span class="slot__sky">
            <span class="slot__moon" data-moon>
              <svg viewBox="0 0 20 20"><path d="M13.6 13.9A6 6 0 0 1 8.1 4.1a6 6 0 1 0 5.5 9.8Z"></path></svg>
            </span>
            <span class="slot__sun" data-sun>
              <svg viewBox="0 0 20 20"><path class="slot__tick" data-tick d="M6.4 10.3 8.9 12.7 13.7 7.6"></path></svg>
            </span>
          </span>
          <span class="slot__horizon" data-horizon></span>
          <span class="slot__glint" data-glint></span>
          <span class="slot__phone" data-phone>
            <svg viewBox="0 0 24 24">
              <path class="slot__wave" data-wave d="M15.2 4.6a5 5 0 0 1 4.2 4.2"></path>
              <path class="slot__wave" data-wave d="M15 1.6a8 8 0 0 1 7.4 7.4"></path>
              <g data-handset><path d="M6.6 3.4 8.9 3a1 1 0 0 1 1.1.7l.9 3.1a1 1 0 0 1-.4 1.1l-1.5 1a11 11 0 0 0 5.6 5.6l1-1.5a1 1 0 0 1 1.1-.4l3.1.9a1 1 0 0 1 .7 1.1l-.4 2.3a1.4 1.4 0 0 1-1.4 1.2A14.6 14.6 0 0 1 5.4 4.8a1.4 1.4 0 0 1 1.2-1.4Z"></path></g>
            </svg>
          </span>
        </span>

        <!-- three faces of the same pill -->
        <button class="face face--rest" type="button" data-call data-face="rest" aria-label="Book a wake-up call for 7:00">
          <span class="face__label" data-label>Wake-up call</span>
          <span class="face__sep" aria-hidden="true"></span>
          <span class="face__time" data-resttime>7:00</span>
        </button>

        <div class="face face--wait" data-face="wait" aria-hidden="true">
          <span class="face__label face__shimmer">Calling front desk</span>
          <span class="face__sub">Room <span data-room>412</span></span>
        </div>

        <div class="face face--set" data-face="set" aria-hidden="true">
          <span class="face__stack">
            <span class="face__label">Wake-up at <span class="digits" data-digits>7:00</span></span>
            <span class="face__sub">Tomorrow · Room <span data-room>412</span></span>
          </span>
          <button class="cancel" type="button" data-cancel tabindex="-1">Cancel</button>
        </div>
      </div>
      <span class="sr" aria-live="polite" data-live></span>
    </div>
  </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.

27 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 “Wake-up call 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 sits a navy pill, with a small round window on the left where a little moon stands over a horizon line, the label Wake-up call and the time 7:00. On hover the pill rises a pixel, a soft light follows the pointer and the moon tilts; pressed, it squashes slightly. On the tap the label leaves, the moon sets behind the horizon as it turns, the pill narrows on a spring and a handset comes up in the window, rocking twice with two waves going out, while «Calling front desk» shines from left to right over «Room 412». When the desk confirms, the pill grows, in come «Wake-up at 7:00», with the digits rolling one at a time, «Tomorrow · Room 412» and the Cancel button; in the window a small warm sun rises a pixel too high and settles, with its reflection under the horizon and the tick drawing itself on it; meanwhile the pill turns from night to dawn, with an apricot light rising from the left and the shadow warming, and the pill swells a hair. With Cancel the tick unwinds, the sun sets, the dawn turns back to night, the pill closes and the moon comes back up.

How it works

Three faces in the same pill

Rest, waiting and confirmed are three layers stacked in the same pill. Each one is measured at its natural width (with right: auto for a moment) and GSAP takes the pill’s width from one size to the next with a back.out, while the old face leaves and the new one comes in by six pixels. Sizes are read again on resize.

The horizon in the window

The round window has a sky two thirds high with hidden overflow: moon and sun live inside it, so when they go down they vanish exactly on the horizon line. The sun rises with yPercent to six points past its place and comes back with a sine: the extra pixel that settles.

Night turning into dawn

Under the faces there are two grounds: the night and the dawn, a gradient from blue to apricot. The dawn fades in together with a radial glow starting from the sun, the reflection under the horizon and a pill shadow that GSAP takes from blue to warm, keeping the same box-shadow shape.

The ring and the shine

A repeating timeline rocks the handset twice, lights the two waves one after the other and rests for a breath; the waiting label has a gradient clipped to the text, whose position GSAP moves through a CSS variable. On confirmation the timeline is killed and the handset goes back upright.

The rolling time

Each character of the time sits in its own one-line window with hidden overflow, and comes up from below with a 70 millisecond stagger and a back.out.

Values to change

NameFileDefaultWhat it changes
LABELscript.jsWake-up callThe label of the button at rest.
TIMEscript.js7:00The wake-up time that rolls into the pill.
ROOMscript.js412The room number.
WAITscript.js1.6The seconds the front desk rings before confirming.
SPRINGscript.js1How much the pill bounces when it changes width.
SUNRISEscript.js1.1The seconds of the sun rising and the night turning into dawn.
HOLDscript.js2.6The seconds the autopilot leaves the wake-up call booked.
IDLEscript.js1.2The seconds before the autopilot starts.
--solestyle.css#ffc27aThe colour of the rising sun.
--alba-bassastyle.css#c9735cThe warm dawn colour at the bottom of the pill.

Try them in the Playground

When to use it

In the app or room page of a hotel, a holiday home or a ship: booking a wake-up call with the front desk in one tap, seeing that the request arrived and being able to cancel it. It also works for other front desk requests, by changing the label and the time.

On phones

The pill keeps the same height as on desktop and never goes past 90% of the width; the finger taps like the mouse. Without hover the light stays off and the moon does not tilt.

With reduced motion

No springs, rocking or rising: the faces change with fades, the width changes at once, the handset stays still with its waves on, the sun and the tick appear already in place and the dawn fades in.

Pitfalls

  • The rest face covers the whole pill (right: 0) so all of it is clickable: to measure its natural width it must be set to right: auto for a moment, or it measures the pill itself and never narrows.
  • The waiting shine is an infinitely repeating tween: on confirmation it must be killed with killTweensOf along with the ringing timeline, or it keeps running hidden and piles up tweens every round.
  • GSAP only warms the pill’s shadow smoothly if the target string has the same shape as the CSS one (three shadows, same numbers): with a different shape it jumps.
  • The autopilot starts from the load event and stops at the first real click (event.isTrusted), or it keeps pressing over whoever is trying it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.6 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