Skip to content
animorio
IT
Back to the library

Crumpled paper background

WebGL, Backgrounds, HoverWebGL, GSAP, CSS onlyAdvancedCompressed weight: Demo 9.3 KBGSAP 28 KBFreeDownload the zip

An animated background for a print studio’s hero, on a sheet of crumpled cotton paper under a low lamp: the creases are flat facets at three scales that catch the light on their edges, like real paper. Where the pointer passes the paper smooths out as if under a warm iron and the creases slowly come back behind it; press the button and the whole sheet is pressed flat from the button outwards, then crumples again. A hand-written WebGL shader.

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>
<!--
  "Crumpled paper background" 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>The crumpled paper background that smooths out where the pointer passes</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <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 hero of an invented letterpress studio, Marrow Press, over a sheet of crumpled cotton paper lit by a low lamp:
       where the pointer passes the paper is smoothed flat like under a warm iron, and the creases come back slowly behind
       it; the button presses the whole sheet flat from the button outwards -->
  <main class="stage" data-stage>
    <canvas class="sheet" data-sheet aria-hidden="true"></canvas>
    <span class="grain" aria-hidden="true"></span>

    <section class="hero" aria-labelledby="hero-title">
      <p class="pill" data-in>
        <span class="pill__tag">Spring</span>
        <span class="pill__text">Orders open for March weddings</span>
      </p>
      <h1 class="title" id="hero-title" data-in>Paper, pressed<br><em>by hand</em></h1>
      <p class="lede" data-in>Cards, invitations and letterheads printed on cotton paper, one sheet at a time.</p>
      <div class="actions" data-in>
        <button class="cta" type="button" data-cta>
          <span class="cta__face">
            <span class="cta__row cta__row--idle" data-row="idle">
              <span class="cta__label">Order samples</span>
              <svg class="cta__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"></path></svg>
            </span>
            <span class="cta__row cta__row--busy" data-row="busy" aria-hidden="true">
              <svg class="cta__press" viewBox="0 0 16 16"><path d="M2.5 11.5h11M4 11.5V9h8v2.5M6 9V6.5h4V9M8 6.5V3"></path></svg>
              <span class="cta__label">Pressing the sheet</span>
            </span>
            <span class="cta__row cta__row--done" data-row="done" aria-hidden="true">
              <svg class="cta__tick" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 4.9"></path></svg>
              <span class="cta__label">Samples on the way</span>
            </span>
          </span>
        </button>
        <span class="note">Six papers, free in the post</span>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></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.

24 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 “Crumpled paper background” 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

The first screen of an invented letterpress studio, Marrow Press, on a sheet of ivory cotton paper crumpled all over: a pill «Spring · Orders open for March weddings», the big Fraunces headline «Paper, pressed by hand» with the last words in red italics, a lighter line of text and the button «Order samples» with «Six papers, free in the post» beside it. The paper is drawn by a shader: the creases are flat facets at three sizes, the big ones with the small ones inside, each tilted at random, and a low lamp top left lights them one by one, so the sheet has light edges and facets in shadow like real paper; where two facets meet there is the thin line of the crease. Behind the headline the creases calm down a little so the words read. On arrival the sheet is smooth and crumples up with a small bounce while the lamp swings round low to its place, then the words rise one after another with a one-pixel settle. Where the pointer passes the paper smooths out as if under a warm iron: the path stays smooth, catches a warm sheen, and behind the pointer the creases slowly come back, in a little over three seconds; the lamp leans a little towards it. On the button the arrow jumps forward and the button rises by a pixel; pressed, it squashes and springs back, the whole sheet is pressed flat in a circle running from the button to the edges, the button turns to «Pressing the sheet» with the press coming down twice and then to «Samples on the way» with the tick drawing itself, and meanwhile the creases come back over the whole sheet. If nobody moves the pointer, a drawn one moves about, irons a path across the paper and presses the button.

How it works

One triangle covering the page

The WebGL canvas draws a single triangle bigger than the screen; the shader works out the whole sheet, pixel by pixel.

Creases as flat facets

Crumpled paper is made of flat facets: for every pixel the nearest Voronoi cell is found, and every cell has a random tilt. Three scales one inside the other, big, medium and small, added with falling weights; the distance between the nearest cell and the second one gives the thin line of the crease.

The low lamp

The normal of every facet comes from its tilt times CRUMPLE; the lamp sits at a point on the page, LAMP_HEIGHT high, so every facet sees it from a different side and the sheet has light edges and facets in shadow. The light is normalised to that of smooth paper, so ironed paper has the right colour.

The iron

The pointer leaves a trail of 24 points, one every so often, each with the moment it was ironed. The shader takes the strongest Gaussian among them, which fades in RECOVER seconds: there the creases flatten almost completely and catch a warm sheen, then slowly come back.

The press

A press sends a circle from the button out to the edges: inside it the sheet is smooth. After a couple of seconds the press lets go and the creases come back over the whole sheet, while the button goes through its three states.

The drawn pointer

After AUTO_PILOT seconds without a pointer a looping timeline moves a drawn pointer that irons a path across the sheet and presses the button; the first real movement stops it.

Values to change

NameFileDefaultWhat it changes
CRUMPLEscript.js1How crumpled the paper is (0 smooth, 2 balled up).
FOLD_SIZEscript.js1How big the facets of the creases are.
IRON_SIZEscript.js1How wide the iron following the pointer is.
RECOVERscript.js3.2How many seconds the creases take to come back behind the pointer.
LAMP_HEIGHTscript.js0.55How high the lamp is (low: sharper creases).
WARMTHscript.js1How warm the light on the ironed paper is (0 neutral).
AUTO_PILOTscript.js4After how many seconds without a pointer the drawn one starts moving (0 never).

Try them in the Playground

When to use it

For the hero of a print studio, a stationery shop, an invitations service, a craft brand or a graphic design portfolio: when you need a light background that feels like a real material, reacts to the pointer and leaves the headline in front.

On phones

Same animations: the creases are sized on the short side of the screen, the finger irons the paper like the pointer, and text and button fit inside the box.

With reduced motion

With reduced motion the paper is already crumpled and still, with the lamp in place and no iron, the words only fade in and the button goes straight to «Samples on the way».

Pitfalls

  • With the lamp high every facet takes nearly the same light and the paper just looks dirty: the lamp has to stay low and the light be divided by that of smooth paper, or the ironed sheet turns grey.
  • A single scale of facets looks like a glass mosaic: it takes at least three scales one inside the other, with falling weights, to look like paper.
  • The iron cannot be a circle following the pointer: it has to leave a path that stays and slowly closes, so the shader gets the last points with their moment, not only the current position.
  • Without WebGL the CSS background stays: a few light and dark facets in linear gradients over the ivory, which already looks like a folded sheet.

Libraries

GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 14 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