Skip to content
animorio
IT
Back to the library

Halftone background

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

A page background for the opening of a made-up print studio, on warm paper: behind the headline sits a halftone screen of midnight blue ink dots at 45 degrees, like a newspaper photo seen up close. The dot sizes follow a soft light that breathes and drifts slowly; the pointer pushes a wave through the dots, which swell and spring back, and a click drops a ring. Minimal style, canvas 2D.

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>
<!--
  "Halftone 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>Halftone background</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/newsreader@5.3.0/opsz.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the opening of an invented print studio, Grainline Press, on warm paper: behind the words a halftone screen of
       ink dots at 45 degrees, like a newspaper photo seen up close. Each dot grows and shrinks with a soft light that
       drifts slowly across the page; the pointer pushes a wave of ink through the dots, a click drops a ring -->
  <main class="stage" data-stage>
    <canvas class="screen" data-screen aria-hidden="true"></canvas>
    <span class="grain" aria-hidden="true"></span>

    <span class="crop crop--tl" aria-hidden="true"></span>
    <span class="crop crop--tr" aria-hidden="true"></span>
    <span class="crop crop--bl" aria-hidden="true"></span>
    <span class="crop crop--br" aria-hidden="true"></span>

    <section class="hero" aria-labelledby="hero-title">
      <p class="kicker" data-in><span class="kicker__mark" aria-hidden="true"></span>Grainline Press</p>
      <h1 class="title" id="hero-title" data-in>Printed,<br><em>one dot at a time.</em></h1>
      <p class="lede" data-in>Risograph and letterpress for books, posters and small runs.</p>
      <p class="meta" data-in><span>85 lpi</span><span class="meta__rule" aria-hidden="true"></span><span>Screen 45°</span><span class="meta__rule" aria-hidden="true"></span><span data-tone>Tone 42%</span></p>
    </section>
  </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.

21 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Halftone 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 opening of Grainline Press, a made-up risograph and letterpress studio, on warm paper with its grain. In the middle the label with the registration mark, the serif headline «Printed, one dot at a time.» with its second line in vermilion italic, a line below and the screen data: 85 lpi, Screen 45°, and the tone. Behind it sits a halftone screen of midnight blue ink dots at 45 degrees: on arrival the dots are born from the centre towards the edges, then each one takes the size of the tone over it, like in a newspaper photo. The tone comes from two soft patches of light that breathe and drift slowly, so the page looks like a print that moves. The pointer pushes a wave of ink through the dots: the nearby ones swell and return with a spring, with a small overshoot and a settle; a click drops a ring that widens and fades. The tone under the pointer shows in the data line. In the four corners the crop marks of a print proof; around the words the paper lightens a little, so the dots never fight the headline.

How it works

The angled screen

The dots sit on a regular grid rotated 45 degrees around the page centre, the newspaper angle, rebuilt on every resize: only the ones that fall inside the screen are created.

The halftone

Each dot’s tone is a top-to-bottom gradient plus two Gaussian bells that drift and breathe on slow sines and cosines. The radius is the square root of the tone, so the ink area grows with the tone: the rule of real halftone.

One spring per dot

Each dot has an extra push with its own velocity. The pointer, scaled by its speed, sets a bell-shaped target; the click rings set a target on their edge. Every frame the push moves towards the target on a damped spring: it overshoots a little and settles.

A single path

All the dots go into one canvas path and one fill per frame, with the time step capped at a thirtieth of a second: thousands of dots at 60 frames per second.

Paper and words

Over the canvas an SVG paper grain in multiply, the crop marks in the corners and, behind the headline, a paper-coloured radial that lightens the dots just enough to read.

Values to change

NameFileDefaultWhat it changes
CELLscript.js13Distance between the screen’s dots, in pixels.
ANGLEscript.js45Angle of the screen, in degrees.
MAX_DOTscript.js0.52Largest dot radius, as a share of the distance.
DRIFTscript.js1Speed of the drifting light.
PUSHscript.js150Radius of the pointer’s wave, in pixels.
SPRINGscript.js1How lively the dots’ spring is.
RING_SPEEDscript.js420Speed of the click ring, in pixels per second.
AUTO_PILOTscript.js3After how many idle seconds the ghost pointer passes (0 never).

Try them in the Playground

When to use it

Behind the opening headline of a print studio, a magazine, a graphic design studio or a portfolio that works with print; as the background of a landing page that wants the feel of printed paper.

On phones

The same screen with adapted sizes: the headline is sized on width and height together, the dots are rebuilt on every resize, and a tap pushes the wave and drops the ring.

With reduced motion

The screen stays, still: the light does not drift, pointer and click leave the dots alone, the words and crop marks are already in place.

Pitfalls

  • Dot size comes from the square root of the tone, not the tone: otherwise mid greys turn too dark.
  • All dots in one path and one fill, or thousands of fills per frame slow the phone down.
  • The radial behind the headline matters: without it, large dots cut through the letters.

Libraries

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

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

Testing

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