Skip to content
animorio
IT
Back to the library

Rice paper background

Backgrounds, HoverGSAP, Canvas, CSS onlyMediumCompressed weight: Demo 8.5 KBGSAP 28 KBFreeDownload the zip

A page background to put behind a headline, for the hero of a made-up lamp maker, Kesting Lamps: a wall of mulberry paper like a shoji screen, with long fibres and a thin dark wooden lattice, and behind it a lamp that follows the pointer on a soft spring. Where the light passes the paper warms up and the fibres, thicker than the sheet, show dark against the light; the lattice catches a thin rim of light on the lamp's side. The button switches the lamp off and on again: off, only the cold blue of the evening comes through and the fibres turn pale again.

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>
<!--
  "Rice 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 rice paper background with the light passing behind it</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <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/fraunces@5.3.0/full-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the hero of an invented lamp maker, Kesting Lamps: behind the words a sliding paper screen, mulberry paper with
       long fibres in a thin wooden lattice; a lamp behind the paper follows the pointer and lights the fibres from
       behind. The button switches the lamp on and off: off, only the cold light of the evening comes through. -->
  <main class="stage" data-stage>
    <canvas class="paper" data-paper aria-hidden="true"></canvas>
    <span class="vignette" aria-hidden="true"></span>

    <section class="hero" aria-labelledby="hero-title">
      <p class="pill" data-in>
        <svg class="pill__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M6 3.5h8l1.6 8.2H4.4z"/><path d="M10 11.7v4.8M6.6 16.5h6.8"/></svg>
        <span class="pill__tag">Kesting Lamps</span>
        <span class="pill__text">Paper and oak, made by hand</span>
      </p>
      <h1 class="title" id="hero-title" data-in>Light, <em>through paper.</em></h1>
      <p class="lede" data-in>Lamps that glow the way a paper screen does at dusk: soft, warm, never in your eyes.</p>
      <div class="actions" data-in>
        <button class="cta" type="button" data-cta aria-pressed="true">
          <span class="cta__shine" aria-hidden="true"></span>
          <span class="cta__face">
            <span class="cta__row" data-row-on>
              <svg class="cta__icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3.2"/><path d="M8 1.6v1.6M8 12.8v1.6M1.6 8h1.6M12.8 8h1.6M3.5 3.5l1.1 1.1M11.4 11.4l1.1 1.1M3.5 12.5l1.1-1.1M11.4 4.6l1.1-1.1"/></svg>
              <span class="cta__label">Lamp on</span>
            </span>
            <span class="cta__row cta__row--off" data-row-off aria-hidden="true">
              <svg class="cta__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.6 9.6A5.2 5.2 0 0 1 6.4 3.4a5.2 5.2 0 1 0 6.2 6.2z"/></svg>
              <span class="cta__label">Lamp off</span>
            </span>
          </span>
        </button>
        <span class="note" data-note>2,700 K, dimmable</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.

27 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 “Rice 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 whole screen is a wall of cream paper, with the long fibres and the small knots of handmade paper, and in front a thin dark wooden lattice of tall panes, like a Japanese sliding door. Behind the paper there is a lamp: it comes on at the start going a little past its light and then settles, and it follows the pointer calmly, on a soft spring. Where the light reaches, the paper turns warm and bright, and the fibres, thicker than the sheet, show dark against the light; far from the lamp they stay paler than the paper. The lattice bars catch a thin rim of light on the side facing the lamp, and the flame breathes just a little. In the middle there are the brand, the headline, a line and the button: pressed, it squashes and the lamp slowly goes out, the paper takes on the cold blue of the evening and the button's label and the note change; pressed again, the lamp comes back on with a small overshoot of light. With nobody around, a drawn pointer carries the lamp about and switches it off and on.

How it works

The paper drawn once

The fibres are thin Bézier curves, mostly lying along the sheet, with a few knots: they are drawn only once onto two offscreen canvases, a dark one (as they look against the light) and a pale one (as they look unlit), with a fixed-seed random generator so the paper is always the same. They are redrawn only on resize.

The light behind

Every frame the canvas is filled with the colour of unlit paper, then a cold gradient of the evening and a warm radial gradient where the lamp is, with a small bright core. The strength of the light is the lamp's on value times a flame breathing on three slow sines.

The fibres against the light

The pale fibres are drawn everywhere; the dark ones are copied onto a scratch canvas, which destination-in trims to the lamp's circle, and then laid on the paper in multiply: so the fibres turn dark only where the light comes through.

The lattice

The bars are dark wooden rectangles in tall panes; a one-pixel rim of light, coloured by a radial gradient around the lamp, is drawn on the side facing the lamp, and the frame is a little thicker.

The spring and the button

The lamp chases its target on an almost critical spring (stiffness and damping from FOLLOW). The button takes on to 0 in 1.1 seconds, or to 1.16 and then 1 to switch it back on; the button's two rows swap vertically and a glint crosses it.

Values to change

NameFileDefaultWhat it changes
FIBRESscript.js1How many fibres the paper has (0.3 almost smooth, 2 very fibrous).
LIGHTscript.js1How strong the lamp behind the paper is.
LIGHT_SIZEscript.js1How wide the circle of light is.
FOLLOWscript.js0.6How quickly the lamp follows the pointer.
FLICKERscript.js0.35How much the flame breathes (0 steady light).
LATTICEscript.js1How strong the wooden lattice is (0 paper only).
PANESscript.js7How many panes the lattice has across.
AUTO_PILOTscript.js3After how many seconds without a pointer the drawn one comes back (0 never).

Try them in the Playground

When to use it

For the hero of a lamp or interiors shop, a holiday home or a ryokan, a tea room, a spa, an interior architecture studio: when the background should be warm, tactile and calm, and the light should feel real.

On phones

Same animations: the lattice gets one more pane on narrow screens and the canvas is at 1.5 density at most; the finger moves the lamp and the button stays large.

With reduced motion

With reduced motion the lamp stays still, on, to the right of the headline, the flame does not breathe and the light goes off and on only as a fade; the words arrive as a fade.

Pitfalls

  • Drawing thousands of fibres every frame costs too much: they are drawn once onto offscreen canvases and redrawn only on resize.
  • Dark fibres everywhere make the paper look dirty: they must be kept only inside the lamp's circle with destination-in on a scratch canvas, not on the visible one.
  • The lattice runs behind the headline: a halo of brighter paper behind the words (a pseudo-element with a radial gradient) keeps them readable.
  • Without a fixed seed the paper changes on every resize and looks like another sheet.

Libraries

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

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

Testing

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