Skip to content
animorio
IT
Back to the library

Wallpaper picker

Physics, ImagesGSAP, CanvasAdvancedCompressed weight: Demo 14 KBGSAP 28 KBFreeDownload the zip

A physics and image animation on a real panel: the wallpaper picker of a phone launcher, nine abstract wallpapers painted in a canvas (silk, dunes, orbits, fluted glass, mesh gradients) in a row of lock screen previews. Fling it with a finger: it glides on its inertia, slows down on its friction, stretches like rubber past the first and the last one and settles on a spring on the nearest wallpaper. Every preview follows on a spring of its own, leans with its speed and its picture slides inside the frame as behind a window; the lights behind the panel take the colours of the wallpaper in the middle and the button applies it.

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>
<!--
  "Wallpaper picker" 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 wallpaper picker to fling with inertia</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>
  <main class="stage" data-stage>
    <!-- the Wallpaper sheet of Lumen, an invented phone launcher. Nine abstract wallpapers, painted in a canvas,
         stand in a row of lock screen previews: fling it and it glides, slows down on its friction, stretches like
         rubber past the last one and settles on a spring on the nearest. Every preview follows on a spring of its
         own, leans with the speed, and its picture slides inside the frame like a window. The light behind the
         sheet takes the colours of the wallpaper in the middle; the button below applies it -->
    <section class="sheet" aria-labelledby="sheet-title" data-sheet>
      <span class="sheet__rim" aria-hidden="true"></span>
      <header class="sheet__head">
        <div>
          <h1 class="sheet__title" id="sheet-title">Wallpaper</h1>
          <p class="sheet__sub">Lumen Studio collection</p>
        </div>
        <p class="sheet__count"><span class="count__now" data-count>1</span><span class="sheet__of">of 9</span></p>
      </header>

      <div class="track" data-track aria-label="Drag to browse the wallpapers" role="group">
        <span class="track__floor" aria-hidden="true"></span>
        <div class="track__layer" data-layer></div>
      </div>

      <div class="dial" aria-hidden="true">
        <div class="dial__ticks" data-ticks></div>
        <svg class="dial__caret" viewBox="0 0 10 6"><path d="M1 0.5h8L5 5.5z"/></svg>
      </div>

      <footer class="foot">
        <div class="foot__words">
          <p class="foot__name" data-name>Aurora Silk</p>
          <p class="foot__meta" data-meta>Silk series, 4K</p>
        </div>
        <button class="apply" type="button" data-btn>
          <span class="apply__shine" aria-hidden="true" data-btnshine></span>
          <span class="apply__face" data-face>
            <svg class="apply__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="apply__frame" data-frame d="M4.5 2.5h7a1.5 1.5 0 0 1 1.5 1.5v8a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 12V4a1.5 1.5 0 0 1 1.5-1.5zM6.5 11h3"/>
              <circle class="apply__spin" data-spin cx="8" cy="8" r="5.4" pathLength="1"/>
              <path class="apply__check" data-check pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.3"/>
            </svg>
            <span class="apply__words" data-words>Set wallpaper</span>
          </span>
        </button>
      </footer>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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 “Wallpaper picker” 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 near black page with two soft lights and a little grain, a frosted glass panel with very round corners rises: at the top ‘Wallpaper’, the line ‘Lumen Studio collection’ and on the right a pill with the count ‘1 of 9’. In the middle a row of lock screen previews, tall and round like a phone, each with an abstract wallpaper painted in the canvas with its own grain: the violet and teal silk of Aurora Silk, the orange dunes with the sun of Ember Dune, the blue fluted glass of Glacier, the pink and violet orbit of Nocturne, the yellow and green gradients of Citrus Bloom, then Rosewater, Moss Velvet, Solar and Lagoon. On each one the date and the time ‘9:41’: the one in the middle is big and lit, with wider and fuller digits, the others shrink, sink a hair and dim. Below, a dial of thin ticks slides with the row, taller near the notch, and the bar with the name, the series and the light ‘Set wallpaper’ button. The row flings itself: it glides, slows down, passes the wallpaper by a hair and comes back, and the far previews arrive a beat later, leaning with the speed, with the picture sliding inside the frame. The lights behind the panel and its rim take the colours of the wallpaper in the middle. On Nocturne the button is pressed, an arc spins with ‘Applying’, then the check draws itself, it turns pale green ‘Applied’, a flash of light runs over the preview and the ‘Current’ pill pops up. Then a hard push towards the end and a finger pulling past the last one: the row resists like rubber and comes back. With a finger you really fling it, with inertia, friction and rubber at the edges; a tap on a preview brings it to the middle, the arrow keys move from one wallpaper to the next and Enter applies it.

How it works

Wallpapers painted in a canvas

Each wallpaper is a canvas painted only once at the preview's size: patches of colour with radial gradients added up in ‘lighter’ mode, then its shape (fifty silk threads folding on two sines, six dunes filled with a gradient and a light crest, an orb with thin rings, nine flutes copying the picture shifted and squeezed), a vignette and the grain pixel by pixel. A generator with a fixed seed always paints it the same.

The projected throw

While dragging, the speed is read from the last 90 ms of the finger. On release, the point where the row would stop is projected (position plus speed times FRICTION seconds), the wallpaper nearest to that point is chosen and a spring (STIFFNESS, DAMPING) carries it there starting with the finger's speed: it glides, passes the mark by a hair and settles.

Rubber at both ends

Before the first wallpaper and after the last the offset is squeezed with 1 − 1/(x·RUBBER/reach + 1), the curve of the rubber edges of phones: the harder you pull, the less it moves, and on release the spring brings it back inside.

A spring, a lean and a window for every preview

Every preview follows the row on a spring of its own, stiff near the finger and softer far from it (LAG), so the far ones arrive a beat later. Its speed becomes a lean of a few degrees (LEAN) and stretches the shadow beneath; the picture, wider than the frame, slides against its distance from the middle (PARALLAX) like a landscape behind a window.

The light that takes the colour

Each wallpaper has two light colours. Every frame those of the two wallpapers the row sits between are mixed by the position, and they become the two lights behind the panel, the rim that follows the pointer, the pool under the middle preview and the button's shadow. The time in the middle gains weight and width on the font's variable axes.

Values to change

NameFileDefaultWhat it changes
FRICTIONscript.js0.32How far a flick glides: the throw is projected this many seconds ahead.
STIFFNESSscript.js170The spring that settles the row on a wallpaper: higher is quicker.
DAMPINGscript.js20Lower lets the row pass the wallpaper and come back.
LAGscript.js0.55How far the distant previews trail behind the near ones (0 = one rigid row).
LEANscript.js1How much each preview leans with its speed (0 = upright).
PARALLAXscript.js0.8How far the picture slides inside its frame (0 = glued to the frame).
RUBBERscript.js0.55How hard the row resists past the first and the last wallpaper.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the walk on its own.

Try them in the Playground

When to use it

To pick the wallpaper or the theme in an app, a profile cover, a product colour, one photo among many in an onboarding or an editor: when the pictures are few and large and you want to browse them with a thumb, with the physical feel of a real phone.

On phones

The same animation with adapted sizes: the panel is as wide as the box, the row is as tall as the screen allows and the previews are sized on both dimensions; the wallpapers are repainted at the new size; the row takes the finger without scrolling the page.

With reduced motion

The row neither glides nor leans and the pictures stay still: changing wallpaper it lands in place at once, the name changes with a fade and the button turns to ‘Applied’ and its check without a spring.

Pitfalls

  • The script writes each preview's transform every frame, GSAP plays the entrance and the apply bump on the body (.wp__body) and the hover and press live on the card (.wp__card): three elements, one per owner, otherwise one wipes out the other.
  • Pixel by pixel grain is costly: the wallpapers are painted only once and repainted only when the size changes a lot, not on every resize.
  • The release speed has to be read from the last milliseconds and reset if the finger rested before lifting, otherwise a slow drag ends in a throw.
  • The row has touch-action: none, otherwise on a phone the finger scrolls the page instead of the wallpapers.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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