Skip to content
animorio
IT
All components

Christmas delivery button

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

The Get it by Christmas button of an online shop: a fir green pill with, inside on the right, a small ivory paper window where the dates sit on a drum (Dec 22, Dec 23, Dec 24). On hover the small line says how many days are left to the last day to order, Order in 4 days, and the drum gives half a turn. On click the days go back to today, Nov 19, then roll forward blurred to December 23; a thin cranberry ribbon runs down the window, a bow of two strokes draws itself on the date with a precise spring and the pill says Arrives Dec 23 with a drawn tick and the small Change pill, which takes it back to rest.

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>
<!--
  "Christmas delivery 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>Christmas delivery 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">
    <!-- a "get it by Christmas" button: the days roll in the little date drum from today to the delivery day,
         a thin ribbon runs down the drum and a bow ties itself on the date, and the pill says when it arrives -->
    <button class="xm" type="button" data-xm data-autoclic>
      <span class="xm__face" data-face>
        <span class="xm__light" aria-hidden="true"></span>
        <span class="xm__sheen" data-sheen aria-hidden="true"></span>
        <svg class="xm__check" viewBox="0 0 16 16" aria-hidden="true"><path data-check pathLength="1" d="M3.4 8.6 6.5 11.5 12.7 4.7"></path></svg>
        <span class="xm__text" data-text aria-hidden="true">
          <span class="xm__line xm__line--a"><span data-a>Get it by Christmas</span></span>
          <span class="xm__line xm__line--b"><span data-b>Free gift delivery</span></span>
        </span>
        <span class="xm__win" aria-hidden="true">
          <span class="xm__paper">
            <i class="xm__row"></i>
            <span class="xm__drum" data-drum></span>
          </span>
          <svg class="xm__ribbon" viewBox="0 0 74 46" aria-hidden="true">
            <rect class="rb__shade" data-shade x="14.2" y="0" width="1" height="46"></rect>
            <rect class="rb__band" data-band x="13" y="0" width="2" height="46"></rect>
            <g transform="translate(14 4) scale(1.2) translate(-14 0)">
            <path class="rb__tail" data-tail-l pathLength="1" d="M13.6 0.6 10.4 8.6"></path>
            <path class="rb__tail" data-tail-r pathLength="1" d="M14.4 0.6 17.6 8.6"></path>
            <path class="rb__loop" data-loop-l pathLength="1" d="M14 0C10.4-5 5.6-5.6 5.5-2.2 5.4 0.8 9.8 1.1 14 0"></path>
            <path class="rb__loop" data-loop-r pathLength="1" d="M14 0C17.6-5 22.4-5.6 22.5-2.2 22.6 0.8 18.2 1.1 14 0"></path>
            <rect class="rb__knot" data-knot x="12.7" y="-1.3" width="2.6" height="2.6" rx="0.8"></rect>
            </g>
          </svg>
        </span>
      </span>
    </button>
    <p class="live" data-live aria-live="polite"></p>
  </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.

16 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 “Christmas delivery 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 background a fir green pill 60 pixels tall, with a thread of light along the top and a soft layered shadow. On the left, in ivory Mona Sans, Get it by Christmas and under it, dimmer, Free gift delivery. On the right a recessed ivory paper window, its corners following the pill's round end: inside a small drum of dates, Dec 23 in the middle on a slightly darker band and Dec 22 and Dec 24 above and below, turned and faded. On arrival the pill rises and the drum turns to the 23rd. Under the mouse a soft light follows the pointer, the words widen, the small line rolls to Order in 4 days and the drum gives half a turn and springs back. Pressed, the pill gives way. On click the words become Finding your date and From today, Nov 19; the drum rewinds fast to today, rests a moment, then rolls forward through every day, blurred while it is fast, and lands on Dec 23 one pixel too far and settles. The date turns cranberry, a thin ribbon, a two pixel line, runs down the window with its shadow, the knot pulls tight, the two loops of the bow, outlines only, draw themselves springing out of the knot and the two tails drop and swing; the window gives a small jolt. The words move over for a drawn tick and say Arrives Dec 23, with a small Change pill under them, and a sheen crosses the pill. Another click pulls a tail: the loops slip back into the knot, the ribbon goes back up, the tick is wiped and Get it by Christmas comes back with Order in 4 days, which after a while turns back to Free gift delivery.

How it works

The dates on a drum

The rows run from two days before today to two after the delivery, worked out with Date.UTC from the three dates in the values block. A single position p, a decimal number, says which row is in the middle: every frame each row is d = i − p rows away, turns by d × 40 degrees on a small cylinder (translate3d with the sine and cosine of the radius, then rotateX) and its opacity is 1 / (1 + (1.8 d)²). Beyond 2.3 rows it is hidden. A fade of the paper colour above and below and a slightly recessed band behind the middle row make the picker.

The motion blur

The drum's speed is measured between frames (rows a second) and becomes a blur filter on the drum, up to 1.3 pixels, which follows the speed with a small lag: the dates smear while they run and sharpen as they slow. When p does not change and the blur is gone, the drawing writes nothing.

The run of the days

A GSAP timeline takes p back to today in half a second (expo.inOut, the rewind), then forward to 0.09 rows past the delivery (power3.inOut, 1.45 seconds: one pixel too far) and back with elastic.out. The words roll up or down with yPercent and a hint of blur, and the pill bounces on a spring at the click. PACE changes the pace of everything with timeScale.

The ribbon and the bow

Ribbon and bow are an SVG over the window. The ribbon is a two pixel rectangle in the accent colour that grows with scaleY from the top, with a hairline of shadow a moment later: a dry mark, not a drawing. Loops and tails are strokes with pathLength="1", drawn with stroke-dashoffset. The bow sits in a group moved onto the window's edge, and inside it GSAP moves the pieces round the knot with svgOrigin: the knot pulls tight (scale 1.3 and back), the loops come out of the knot turning 26 degrees with an elastic.out set by SPRING, the tails drop on another spring. To untie, the right tail is pulled, the loops are wiped as they slip back and the ribbon goes up.

The states

It is a real button: aria-busy while it works, an aria-label that changes (Get it by Christmas. Order in 4 days to get it on Dec 23. / Arrives Dec 23. Change delivery date.) and an aria-live region that says the date. The pressed state is a CSS scale on the child, the GSAP bounce on the button: one element for each. Keyboard focus shows a ring and does what the hover does. With no mouse, after the return the line shows Order in 4 days for a moment, so a tap sees it too.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#b8213dThe colour of the ribbon, the bow and the chosen date.
PILLscript.js#0f3a2bThe colour of the pill; the light at the top and the dark at the bottom come from it.
LABELscript.jsGet it by ChristmasThe words at rest.
NOTEscript.jsFree gift deliveryThe small line under the words, at rest.
TODAYscript.js2026-11-19Today (YYYY-MM-DD): the drum goes back here before it runs.
DELIVERYscript.js2026-12-23The delivery day (YYYY-MM-DD): the drum stops here and the bow ties on it. At most 120 days after today.
ORDER_BYscript.js2026-11-23The last day to order: on hover the line says how many days are left.
PACEscript.js1The pace of everything: 2 takes twice as long, 0.5 half.
SPRINGscript.js1How lively the bow's spring is when it ties; 0 it opens with no bounce.

Try them in the Playground

When to use it

On a product page or in the cart of an online shop in the holiday season, when it matters whether the gift arrives in time: Christmas, but also Valentine's Day, Mother's Day, a birthday. The dates are made up: in a real shop today, the delivery and the last day to order come from the server, and the click picks the shipping.

On phones

The same pill, at most 304 pixels wide and never wider than the screen; the date window keeps its size and long words are cut with an ellipsis. A tap presses and picks the date; Order in 4 days shows on its own for a moment after the return.

With reduced motion

No run of the days, no bounces or springs: the drum fades out and comes back already on the 23rd, ribbon and bow fade in, the tick and the new words arrive without motion. On the return everything fades away.

Pitfalls

  • The bow on the window's top edge came out of the pill: the loops rose six pixels above the paper and the pill has only seven of margin. The bow's group now sits four pixels lower and is scaled by 1.2 inside an outer group, and GSAP moves the pieces inside with svgOrigin, without touching the group's transform.
  • Two thin rules above and below the chosen date cut Dec 22 and Dec 24 like a strike-through. In their place a slightly recessed band behind the drum, and the cylinder's step went from 36 to 40 degrees to part the neighbouring rows.
  • The first bow was solid satin, with a gradient and folds: too decorative for a product button. Now ribbon and bow are a thin mark in the accent colour, 1.15 pixel strokes that draw themselves.
  • The preview's pilot clicks every 2.8 seconds and picking the date takes about three: the second click lands while it works and is skipped, so Arrives Dec 23 stays in view for a whole round before the return.

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