Skip to content
animorio
IT
Back to the library

Hotel bill receipt

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

The bill of a hotel stay, like a paper receipt with a torn edge: the lines arrive one at a time, the receipt grows and the total adds them up as they come in. The extras (spa, minibar) can be taken off with a tap: a line crosses them out and the total comes down; another tap and they are 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>
<!--
  "Hotel bill receipt" 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>Hotel bill at check-out with the lines that add up and the extras you can take off</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 bill of a hotel stay at check-out: the lines arrive one by one and the receipt grows, the total adds
         them up as they come; an extra can be taken off and put back, and the total follows -->
    <div class="bill" data-bill>
      <section class="bill__paper" aria-label="Your bill">
        <header class="bill__head">
          <span class="bill__hotel">Casa Brezza</span>
          <span class="bill__stay">Room 12, three nights</span>
        </header>
        <div class="bill__lines" data-lines></div>
        <footer class="bill__foot">
          <span class="bill__label">Total<span class="bill__note" data-note>Charged to the card on file</span></span>
          <b class="bill__total" data-total></b>
        </footer>
      </section>
      <p class="sr" data-live aria-live="polite"></p>
    </div>

    <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 “Hotel bill receipt” 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 white receipt with a zigzag bottom edge and a soft shadow: at the top the hotel’s name and the room, then five lines (room, breakfast, spa, minibar, city tax) each with a thin rule linking it to its amount, and at the bottom “Total” with the large number. On opening the lines come in one every 0.36 seconds: the receipt grows, the name slides from the left, the rule stretches, the amount counts and the total takes it in with a small jolt. Hovering a line, the name moves forward by three pixels and the amount gains weight on the variable axis. Tapping spa or minibar, a terracotta line crosses them, the line dims, the total comes down and “1 extra off, check at the desk” appears below; tapping again the line withdraws from the other side and the total climbs back.

How it works

The receipt that grows

Each line starts at height 0 and reaches its real height (measured first) in 0.34 seconds with power3.out: it is the layout that makes the paper grow. At the end the written height is removed, so the receipt stays elastic on resize.

The total that adds up

An object with the total shown: at each line that comes in, or is taken off, it counts to the new sum with power2.out and hops three pixels against the change. No spring on the number.

The line that crosses out

An element 1.5 pixels high in scaleX: it comes in from the left with power3.out and leaves from the right with power2.in (transform-origin changes). The extras are real buttons with aria-pressed.

Values to change

NameFileDefaultWhat it changes
NIGHTLYscript.js180The price of one night, in euros (made up).
STEPscript.js0.36How many seconds between one line and the next on opening.
HEAVYscript.js760The font weight of the amount under the pointer.
ACCENTscript.js#c2512bThe colour of the line that crosses out.
PAUSEscript.js1.6Alone: how many seconds the extra stays off.
LOOPscript.jstrueLeft alone, the bill is written again and a pointer takes an extra off.

Try them in the Playground

When to use it

In the online check-out of a hotel or a holiday home, in the guest app, in any summary where the payer must be able to read and dispute the lines (a restaurant bill, an invoice, an order).

On phones

The same receipt, as wide as the screen; in short windows the lines drop to 29 pixels. You tap the line: there is no hover.

With reduced motion

The lines are all already in place with the final total; taking an extra off, the line appears and the total changes without counting.

Pitfalls

  • The mask of the zigzag edge would also cut the paper’s shadow: the shadow sits on a wrapper, with filter: drop-shadow, which follows the clipped shape.
  • If the receipt is tapped while it is still being written, the opening timeline must be taken to its end: otherwise the total would count only the lines already in.
  • The animated font-weight needs a starting number written in the CSS (560), not “normal”.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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