Skip to content
animorio
IT
Back to the library

Private dinner countdown

Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.9 KBGSAP 28 KBFreeDownload the zip

The invitation to a private dinner with its countdown, as elegant as a printed card: thin, wide digits that change places quietly, a gold thread below that the seconds stretch once a minute, and a button to reply at the bottom.

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>
<!--
  "Private dinner countdown" 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>Countdown to a private dinner with the thin digits that change places and the thread of the seconds</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 invitation to a private dinner with its countdown: thin, wide digits that slide quietly into place, a
         gold thread under them that is spun once a minute by the seconds, and a reply button at the bottom -->
    <section class="inv" data-inv aria-label="Invitation">
      <p class="inv__kicker">You are invited</p>
      <h1 class="inv__title">Dinner for Ada’s fortieth</h1>
      <p class="inv__when">Saturday 12 December, 8 pm<i>Villa Sorgente, the long table</i></p>

      <div class="inv__count" data-count role="timer" aria-live="off"></div>
      <div class="inv__thread" aria-hidden="true"><span data-thread></span></div>

      <footer class="inv__foot">
        <span class="inv__by"><span data-by>Kindly reply by 28 November</span></span>
        <button class="inv__go" type="button" data-go aria-pressed="false">
          <svg viewBox="0 0 20 20" aria-hidden="true"><path data-tick pathLength="1" d="M4.500 10.400 8.300 14 15.500 6.200"></path></svg>
          <span class="inv__go-text"><span data-gotext>I’ll be there</span></span>
        </button>
      </footer>
      <p class="sr" data-live aria-live="polite"></p>
    </section>

    <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.

19 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 “Private dinner countdown” 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 paper-coloured ground, a light card with a very thin frame inside its edge: “You are invited” small and golden, the dinner’s title in a wide, light type, day and place, and below four units (days, hours, minutes, seconds) with large thin digits separated by vertical hairlines. On opening the texts and the units arrive one after the other. Every second the digit that changes leaves upwards fading and the new one rises from below; under the digits a gold thread lengthens as the seconds pass and starts again at each minute. Hovering a unit, its digits slowly gain weight and its label turns gold. At the bottom, “Kindly reply by 28 November” and a dark button: pressed it turns gold, a tick is drawn in front of the words, it says “See you there” and the line beside it answers that a seat is being set.

How it works

One clock

GSAP’s ticker adds up the real seconds gone by; from those left a single function works out the four units and the thread’s length. The digits are rewritten only when the whole second changes, and only the ones that differ.

The digits changing places

Each digit sits in a box with hidden overflow: the old one leaves at the top and fades with power2.in, the new one comes from below with power3.out in SLIDE seconds. No bounces: it is a card, not a scoreboard.

Weight on hover

The digits’ font-weight is one CSS variable per unit, animated from 260 to HEAVY in half a second: on Mona Sans’s variable axis the number gets heavier without changing the width of its box.

Values to change

NameFileDefaultWhat it changes
DAYSscript.js25The days left to the dinner when the page opens.
HOURSscript.js6The hours left.
MINUTESscript.js14The minutes left.
SECONDSscript.js4The seconds left (few: so the minute is soon seen changing).
SLIDEscript.js0.6How many seconds a digit takes to change places with the new one.
HEAVYscript.js480The font weight of the unit under the pointer (260 at rest).
ACCENTscript.js#b08a3eThe colour of the thread and the small texts.
LOOPscript.jstrueLeft alone, a pointer rests on the units and replies to the invitation.

Try them in the Playground

When to use it

On the page of a private event: a dinner, a birthday, an anniversary, a wedding, an evening for a few. On a real site the date is a single line and the count is worked out from it.

On phones

The same card, as wide as the screen; title and digits scale with the width (clamp) and in short windows the line with the place hides.

With reduced motion

The count still runs (it is the information) but the digits change without sliding, the weight changes at once and the reply arrives without rolling.

Pitfalls

  • In the demo the count starts each time from the same days, hours and minutes: on a real site it must be worked out from the event’s date, and at zero the units stay at 00.
  • role=timer with aria-live off: a screen reader must not read every second; the time left is in aria-label and the reply in a separate line.
  • If the tab is left in the background the digits jump more than a second: the swap removes digits left halfway before adding a new one.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 16 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 animations