Skip to content
animorio
IT
Back to the library

Printing receipt

Scroll, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.7 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The receipt of a made-up coffee bar, in the clean style of product interfaces: as you scroll, the paper rises out of the slot of a slim dark printer and every line is typed the moment it comes out, with prices right-aligned, the total counting up and the barcode printing bar by bar. At the end the receipt is torn off with a small yank, settles at an angle and gets a Paid stamp.

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>
<!--
  "Printing 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>Wren Coffee</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>
  <!-- the order receipt of a made-up coffee bar, Wren Coffee. The stage sticks while you scroll: a slim receipt printer
       waits at the bottom and the receipt rises out of its slot line by line, each line typed as it comes out, the
       prices right-aligned, the total counting up, the barcode printing bar by bar. At the end the receipt is torn off
       with a small yank, lifts off the printer, settles at a slight angle and gets a Paid stamp. -->
  <main>
    <section class="corsa" data-corsa>
      <div class="palco" data-palco>
        <div class="spazio" data-spazio>
          <div class="cornice" data-cornice>
            <div class="uscita">
              <div class="gruppo" data-gruppo>
                <div class="ombra" data-ombra></div>
                <div class="carta" data-carta>
                  <div class="riga riga--marchio" data-riga><span data-testo>WREN COFFEE</span></div>
                  <div class="riga riga--centro tenue" data-riga><span data-testo>Espresso bar, 9 Canal Street</span></div>
                  <div class="riga riga--centro tenue" data-riga><span data-testo>Oct 26, 9:41 AM   Order 1042</span></div>
                  <div class="taglio" data-riga data-taglio></div>
                  <div class="riga" data-riga><span data-testo>Flat white</span><span class="prezzo" data-testo>4.50</span></div>
                  <div class="riga riga--extra tenue" data-riga><span data-testo>Oat milk</span><span class="prezzo" data-testo>0.60</span></div>
                  <div class="riga" data-riga><span data-testo>Almond croissant</span><span class="prezzo" data-testo>3.80</span></div>
                  <div class="riga" data-riga><span data-testo>Cardamom bun</span><span class="prezzo" data-testo>3.40</span></div>
                  <div class="riga" data-riga><span data-testo>Cold brew, large</span><span class="prezzo" data-testo>5.20</span></div>
                  <div class="taglio" data-riga data-taglio></div>
                  <div class="riga tenue" data-riga><span data-testo>Subtotal</span><span class="prezzo" data-testo>17.50</span></div>
                  <div class="riga tenue" data-riga><span data-testo>Tip</span><span class="prezzo" data-testo>3.00</span></div>
                  <div class="riga riga--totale" data-riga data-totale><span data-testo>Total</span><span class="prezzo" data-conta="20.50">$20.50</span></div>
                  <div class="riga riga--piccola tenue" data-riga><span data-testo>Visa ending 4821</span><span class="prezzo" data-testo>Approved</span></div>
                  <div class="taglio" data-riga data-taglio></div>
                  <div class="codice" data-riga data-codice>
                    <svg viewBox="0 0 200 34" preserveAspectRatio="none" aria-hidden="true" data-barre></svg>
                    <span data-testo>1042 2610 0941</span>
                  </div>
                  <div class="riga riga--centro" data-riga><span data-testo>Thank you, see you tomorrow.</span></div>
                  <div class="arriccio arriccio--su" data-arriccio-su></div>
                  <div class="arriccio arriccio--giu" data-arriccio-giu></div>
                </div>
                <div class="timbro" data-timbro><span>PAID</span></div>
              </div>
            </div>
            <div class="stampante" data-stampante>
              <div class="stampante__bocca">
                <svg class="stampante__denti" viewBox="0 0 300 6" preserveAspectRatio="none" aria-hidden="true" data-denti></svg>
              </div>
              <div class="stampante__fronte">
                <span class="stampante__nome">WREN</span>
                <span class="stampante__stato" data-stato>Ready</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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.

40 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 “Printing 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 warm white background there is only a slim dark receipt printer, with the slot on top, the name Wren and the word Ready. As you scroll, the paper rises out of the slot and the printer says Printing and hums slightly while it feeds it out. Every line is typed letter by letter the moment it comes out: the bar’s name Wren Coffee in large type, the address, the date with the order number, then a flat white, oat milk, an almond croissant, a cardamom bun and a cold brew, each with its price typed right-aligned. The dashed rules draw themselves from the left, the total counts up to $20.50 and gives a small nudge when it lands, the barcode prints bar by bar. The longer the paper, the more it sways if you scroll in a hurry, and its free edge has a faint curl shade. At the end the receipt is torn off with a yank, lifts off the printer, settles at an angle with a soft shadow, and an orange Paid stamp lands on it, making it bounce by a hair; the printer says Done. Scroll back up and the paper slides back in as the lines erase.

How it works

Paper coming out of a slot

The paper sits in a container clipped only at the bottom with clip-path inset (with room above and at the sides): moved down by its own height it is hidden under the slot, and the timeline brings it up pixel by pixel. Everything is drawn 340 pixels wide and a scale, recomputed on every resize, fits it to the stage.

Each line is typed as it comes out

Every line’s position and height on the paper are measured; how much paper is out decides how far its typing has gone, and that much of the text is written: first the item, then the price, which, right-aligned, grows to the left like on a real printer. The dashed rules do the same with scaleX, the total with its count and the barcode with its bars switching on one after another.

One place for the transform

Rise, sway and tear all touch the same element: a single ticker adds up the paper’s position, a spring pushing against the scroll speed (stronger when the paper is long) and the tear values, and writes one transform. Nothing steps on anything else.

The tear at the end

When the timeline reaches the end a small independent timeline starts: a one-and-a-half degree yank, the paper lifting and leaning with back.out, the shadow spreading, then the stamp dropping from large and the paper bouncing by two pixels with elastic.out. Going back above the end plays the same timeline in reverse, faster.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the receipt takes to print: 2 is twice as long.
TYPEscript.js26How many pixels of paper each line takes to type: lower is faster.
SWAYscript.js1How much the hanging paper sways when you scroll fast: 0 none.
TILTscript.js3How many degrees the torn receipt leans when it settles.
STAMPscript.js11: the torn receipt gets a Paid stamp; 0: no stamp.

Try them in the Playground

When to use it

For an order confirmation page, the checkout of an online shop, the landing page of a point-of-sale or payments app, the site of a cafe or restaurant that wants to show how easy ordering is: the receipt coming out is the moment the order becomes real.

On phones

The same animation with adapted sizes: receipt and printer scale down together to fit the screen, with the same lines, the same tear and the same stamp.

With reduced motion

The receipt is already printed, torn and stamped and simply fades in, with no movement and no typing.

Pitfalls

  • The slot’s cut uses clip-path inset with negative margins above and at the sides: with overflow hidden the torn receipt, lifting and leaning, would lose its corners and shadow.
  • The serrated edge is a pixel clip-path polygon and clips the box-shadow too: the shadow is a separate element behind the paper, blurred with filter.
  • The tear is checked in the timeline’s onUpdate, not the ScrollTrigger’s: the scrub keeps going after the wheel stops.
  • Never once: true on a timeline with a ScrollTrigger: opening the page already scrolled down would freeze everything.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.7 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

Tested on 26 October 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