A receipt you can crumple and throw away

Press "Crumple it". The receipt folds up into a ball of paper and drops to the floor. Drag the ball and throw it at the bin, or tap it to smooth it out. When it's flat again it's the same table as before, with a few more creases each time.

After Crumpled Receipt by Lorenzo Cabra (on Memorables) and CrumpledPaper Reveal by Matt Ölschlegel (on Memorables).

Corner Shop23 Nov 2026, 09:14
Item£
Milk, 2 pints1.35
Stamps, 46.60
Bread1.80
Batteries, AA4.25
Total14.00

Paid by card. Thank you.

 

Show the code the markup, the one picture, the ball, the triangles, the creases
  1. The markup. A receipt with a table in it, a bin, and an empty button that is the ball.
  2. Styles. The ball button has touch-action: none, so a drag on it doesn't scroll the page.
  3. The one picture. Draw the receipt and its creases, copy that part of the canvas, then make the receipt inert.
  4. The paint. Flat, it's one element draw. As a ball, every frame comes from the copy.
  5. Dragging and throwing. Pointer events on the ball button, which is captured for the drag.
  6. The sheet. Each grid point has a flat place and a place on a lumpy ball.
  7. One triangle. A clip, a transform and a drawImage().
  8. All of them. Far ones first, each shaded by the way it faces.
  9. Creases. Thin bands of shade and light.

How it works

The receipt is an <article> with a <table> in it, and it's a child of the canvas. While it's flat the canvas draws it with one drawElementImage() call, so you can select the text and press its button.

One picture. When you press "Crumple it", the canvas draws the receipt once more, copies that rectangle of itself into a plain canvas with drawImage(), and clears. From then until the receipt is flat again no frame draws the element. The receipt is made inert and its hit box is shrunk to a point, so nothing invisible can be pressed or reached with the Tab key.

Triangles. The copy is treated as a sheet of 10 by 14 squares, each cut into two triangles. Every corner of the grid has a flat position and a position on a lumpy ball, and a number from 0 to 1 moves it between them. Each frame the triangles are sorted from far to near and drawn with drawImage() under a clip and a transform. A triangle that faces away is filled with blank paper. Each one is then darkened by the way it faces and how deep in the ball it is.

The ball. The ball you drag is a <button> with nothing in it. Each frame the canvas draws it at the paper's position, which draws nothing but moves its hit box there. Pointer events on it drag and throw the paper, a click smooths it out, and it takes keyboard focus like any button. The bin is a button as well.

Creases. Each time the paper is smoothed out, three fold lines are added to a list. They're painted over the flat receipt after it's drawn, and into the copy, so they show on the ball too. Paint on top of an element doesn't change where it can be pressed.

Live checks

These run on their own small canvases in the corner of the window.

Findings