Skip to content
animorio
IT
Back to the library

New arrivals shelf

Hover, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The ‘New this week’ shelf of an invented online bookshop: nine cloth spines with their titles stamped in gold, in a row on a plank. The book under the pointer comes out of the row towards you and turns three quarters on a spring, showing its glossy cover (abstract shapes and type) with a band of light sweeping over it; the neighbours lean a little into the gap. On a click the book moves to the middle and opens halfway: on the first page the price and ‘Add to bag’, which gives under the finger, comes back with a check and makes the bag count one more.

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>
<!--
  "New arrivals shelf" 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 new arrivals shelf with books that turn to their cover</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>
  <main class="stage" data-stage>
    <!-- the new arrivals shelf of an online bookshop: a row of cloth spines. The book under the pointer comes out of
         the row and turns three quarters to show its glossy cover; a click opens it halfway on its price and the
         Add to bag button -->
    <header class="head">
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 4.5h5.2c1 0 1.8.8 1.8 1.8V16c0-.8-.7-1.4-1.5-1.4H3z"/><path d="M17 4.5h-5.2c-1 0-1.8.8-1.8 1.8V16c0-.8.7-1.4 1.5-1.4H17z"/></svg>
        Harrow Lane Books
      </span>
      <span class="head__label">New this week</span>
      <span class="bag" data-bag>
        <svg class="bag__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M4.2 7h11.6l-.9 9.2c-.1.7-.6 1.2-1.3 1.2H6.4c-.7 0-1.2-.5-1.3-1.2z"/><path d="M7.2 7V5.8a2.8 2.8 0 0 1 5.6 0V7"/></svg>
        <span class="bag__count"><span data-count>0</span></span>
      </span>
    </header>

    <section class="shelf" data-shelf aria-label="New arrivals">
      <div class="shelf__row" data-row></div>
      <div class="shelf__plank" aria-hidden="true"></div>
    </section>

    <footer class="info" aria-live="polite">
      <span class="info__window"><span class="info__title" data-title>Nine new books</span></span>
      <span class="info__window"><span class="info__meta" data-meta>Point at a spine to see the cover</span></span>
    </footer>
  </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.

113 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 “New arrivals shelf” 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 paper coloured page, under the ‘Harrow Lane Books’ mark, the words ‘New this week’ and the bag with a zero, there is a plank with nine books seen from the spine: red, blue, moss green, ochre, cream, sea green, charcoal, terracotta and dusty pink cloth, each with the weave of the fabric, the curve of the spine made of light, two rules at the top and its title stamped in gold. The books arrive one after the other and settle with a little knock. Under the pointer a book comes out of the row towards you, rises a little and turns three quarters on a spring that passes the mark by a hair: spine and glossy paper cover show together, with abstract shapes (a sun on the horizon, arcs, waves, a crescent moon, steps) and the title in a soft serif. As it turns a band of light sweeps across the cover; after that it follows the pointer. The two neighbours lean into the gap, the next ones less; under the shelf title and author roll in. On a click the book moves to the middle of the shelf, faces you and the cover opens halfway on its hinge, showing the endpaper; on the first page ‘Hardback · 388 pages’, the title, the author, a rule that draws itself, the big price in the accent and the ‘Add to bag’ button. Pressed, the button gives, comes back on an elastic, the label turns into ‘Added’ with a checkmark that draws itself and the bag's number rolls to one. Another click closes the book and puts it back in the row. On its own the demo walks through it: two books, one opened, added, closed.

How it works

A box for each book

Each book is a small CSS 3D box: spine, fore edge of the pages, back, first page and the cover on a hinge (an element with its transform origin on the left edge and two faces, outside and inside). Each sits in its own slot with its own perspective, so the pulled book can pass in front of the others with a plain z-index.

Spine on or three quarters

At rest the box is turned 90 degrees and only the spine shows. Pulled, it comes forward in Z by a quarter of its height, rises and turns to 32 degrees with back.out: spine and cover show together. Its position is clamped so it never leaves the shelf.

One drawing per frame

GSAP does not animate the elements but one state object per book (x, y, z, rotation, cover, light, lean); a ticker writes the transforms. So the shadow on the plank, the darkening of the cover seen edge on and the hidden inner faces follow the same number.

Light on glossy paper

Over the cover sits a banded gradient in soft-light, moved by a CSS variable: it sweeps left to right as the book turns, then follows the pointer. Spine and cloth are only gradients: the one pixel weave and the curve of light and shade.

Open halfway and add

On a click the book moves to the middle of the shelf and the cover turns 148 degrees on its hinge. The button squashes in 0.11 s and comes back with elastic.out, the check draws itself with pathLength and the bag's number leaves upwards and comes back from below.

Values to change

NameFileDefaultWhat it changes
BOOKSscript.jsnove libriThe books: title, author, price, pages, cloth colour, second colour and ink of the cover, thickness, height and the shapes on the cover.
CURRENCYscript.js£The sign before the price.
TURNscript.js58How far the book turns to show its cover, in degrees.
PULLscript.js0.26How far it comes out of the row towards you, as a share of its height.
OPENscript.js148How far the cover opens, in degrees.
LEANscript.js2.4How far the neighbours lean, in degrees.
SPRINGscript.js1.3How much the book passes the mark as it turns.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the walk when nobody points.

Try them in the Playground

When to use it

For the new arrivals of an online bookshop, a publisher or a record and magazine shop: a row of narrow products you browse with the pointer and buy without leaving the page.

On phones

The same animation with adapted sizes: the shelf shrinks to the width and height of the box, the first tap pulls the book out, the second opens it, the button is pressed with a finger and a tap outside puts it back in the row.

With reduced motion

The books do not fly: each state (pulled, open, added) appears already in place with a fade of the row, and the words change with a fade.

Pitfalls

  • With a single 3D context for the whole row the turned book ends up inside its neighbours: each book has its own slot with its own perspective, and the pulled one passes in front with z-index.
  • The cover turned to 90 degrees is an edge-on plane the browser sorts badly: the inner faces stay hidden until the cover opens.
  • Perspective does not pass through an element in between: the wrapper that leans the neighbours also needs transform-style: preserve-3d.

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 12 KB; the libraries: GSAP 28 KB.

Testing

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