Skip to content
animorio
IT
Back to the library

Layered app screen

Scroll, 3DGSAP, CSS onlyAdvancedCompressed weight: Demo 7.3 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The screen of an analytics app, drawn in HTML and CSS, that leans back in 3D as you scroll and comes apart into its four layers, background, layout, components and content, which rise one above the other with a thin label beside each and dashed lines at the corners; then it settles flat 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>
<!--
  "Layered app screen" 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>Pellora, layer by layer</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>
  <!-- the screen of a made-up analytics app, Pellora. The stage sticks while you scroll: the flat screen tilts back
       in 3D and comes apart into its four layers, background, layout, components and content, that rise one above
       the other with a thin label each and dashed lines tying their corners; then it all settles flat again -->
  <main>
    <section class="corsa" data-corsa>
      <div class="palco">
        <header class="testa" data-testa>
          <p class="testa__nota">How Pellora is built</p>
          <h1 class="testa__titolo" data-titolo>One screen, <span>four layers</span></h1>
        </header>

        <div class="scena" data-scena>
          <div class="pila" data-pila>

            <!-- the dashed lines that tie the corners of the layers, along the depth -->
            <span class="filo filo--a" data-filo aria-hidden="true"></span>
            <span class="filo filo--b" data-filo aria-hidden="true"></span>
            <span class="filo filo--c" data-filo aria-hidden="true"></span>
            <span class="filo filo--d" data-filo aria-hidden="true"></span>

            <!-- layer: background -->
            <div class="strato strato--fondo" data-strato>
              <div class="fondo__griglia"></div>
              <div class="fondo__luce" data-luce></div>
              <span class="ancora" data-ancora></span>
            </div>

            <!-- layer: layout, the grid the interface sits on -->
            <div class="strato strato--schema" data-strato>
              <span class="schema schema--lato"></span>
              <span class="schema schema--testa"></span>
              <span class="schema schema--a"></span>
              <span class="schema schema--b"></span>
              <span class="schema schema--c"></span>
              <span class="schema schema--grafico"></span>
              <span class="ancora" data-ancora></span>
            </div>

            <!-- layer: components, the boxes and controls -->
            <div class="strato strato--pezzi" data-strato>
              <span class="pezzo pezzo--lato"><i></i><i class="acceso"></i><i></i><i></i></span>
              <span class="pezzo pezzo--cerca"></span>
              <span class="pezzo pezzo--bottone"></span>
              <span class="pezzo pezzo--a"></span>
              <span class="pezzo pezzo--b"></span>
              <span class="pezzo pezzo--c"></span>
              <span class="pezzo pezzo--grafico"></span>
              <span class="ancora" data-ancora></span>
            </div>

            <!-- layer: content, words, numbers and the chart line -->
            <div class="strato strato--testi" data-strato>
              <span class="marchio"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 12.5V3.5h4.6a3 3 0 0 1 0 6H3"/><circle cx="12" cy="12" r="1.6"/></svg>Pellora</span>
              <span class="voce voce--a">Overview</span>
              <span class="voce voce--b">Reports</span>
              <span class="voce voce--c">Audience</span>
              <span class="voce voce--d">Settings</span>
              <span class="cerca">Search</span>
              <span class="bottone">New report</span>
              <span class="dato dato--a"><em>Visitors</em><b data-conta="48210">48,210</b></span>
              <span class="dato dato--b"><em>Signups</em><b data-conta="3184">3,184</b></span>
              <span class="dato dato--c"><em>Revenue</em><b data-conta="27940" data-valuta>$27,940</b></span>
              <svg class="linea" viewBox="0 0 200 60" preserveAspectRatio="none" aria-hidden="true">
                <path class="linea__area" d="M0 46 C 18 44, 26 34, 40 36 S 64 22, 80 26 S 104 40, 120 30 S 150 10, 168 14 S 190 8, 200 6 V 60 H 0 Z"/>
                <path class="linea__tratto" data-linea d="M0 46 C 18 44, 26 34, 40 36 S 64 22, 80 26 S 104 40, 120 30 S 150 10, 168 14 S 190 8, 200 6" pathLength="1"/>
                <circle class="linea__punto" data-punto cx="168" cy="14" r="2.6"/>
              </svg>
              <span class="grafico-titolo">Weekly traffic</span>
              <span class="ancora" data-ancora></span>
            </div>
          </div>
          <div class="etichette" aria-hidden="true">
            <div class="etichetta" data-etichetta><span class="etichetta__corpo"><i class="etichetta__filo"></i><b>Background</b><em>Surface and light</em></span></div>
            <div class="etichetta" data-etichetta><span class="etichetta__corpo"><i class="etichetta__filo"></i><b>Layout</b><em>12 column grid</em></span></div>
            <div class="etichetta" data-etichetta><span class="etichetta__corpo"><i class="etichetta__filo"></i><b>Components</b><em>Cards, nav, buttons</em></span></div>
            <div class="etichetta" data-etichetta><span class="etichetta__corpo"><i class="etichetta__filo"></i><b>Content</b><em>Text, data, icons</em></span></div>
          </div>
        </div>

        <p class="piede" data-piede>Scroll to take it apart</p>
      </div>
    </section>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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.

38 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 “Layered app screen” 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 very light grey background, under the headline «One screen, four layers», sits the screen of Pellora, a made-up analytics app: the sidebar with its items, the search, the New report button, three cards with numbers and the weekly traffic chart. As soon as you scroll the chart line draws itself and the numbers count up; then the screen leans back and turns a little on the table, as if seen from above, and comes apart into its four layers, which rise one above the other on a small spring, the top one first: the white background with its grid, the dashed indigo layout everything sits on, the components without words (the boxes, the sidebar, the button) and on top the content, that is text, numbers and the chart line. Beside each layer a thin label grows, always facing the viewer, with the name and a grey line, and four dashed lines tie the corners from the bottom to the top. While they stay apart a sheen crosses the background and the content layer floats up a few pixels; then the labels leave, the layers sink and the screen settles flat with a one pixel overshoot. Scroll back up and it all plays in reverse.

How it works

A stack in 3D

The screen is a stack of four overlapping divs inside a container with transform-style preserve-3d and a perspective on the stage. Each layer rises with translateZ, and the container leans with rotateX and turns with rotateZ: the first tips it back, the second turns it on the table, like a view from above.

One state, one drawing

GSAP does not animate the elements one by one: it moves an object holding the tilt, the turn, each layer's rise, the guides and the labels, and on every update a draw() function writes all the transforms. So the stack, the layers, the lines and the labels always agree, even when the scroll goes back.

Labels that face the reader

The labels are children of the layers, so they would tilt with them. Each gets the opposite of the stack's transform, rotateZ and rotateX with flipped signs and in reverse order, and stays upright in front of the screen while following its layer through space.

Lines along the depth

The four dashed lines start at the corners of the bottom layer, turned 90 degrees on X so they stretch towards the viewer; their height in pixels is the rise of the top layer, computed again on every frame.

Scroll as the director

The whole story is a paused timeline one unit long, which a ScrollTrigger with scrub drives back and forth: first the screen in use, then the tilt, the layers rising staggered with back.out, the still moment with the sheen, and the return flat with a small overshoot.

Values to change

NameFileDefaultWhat it changes
GAPscript.js18The distance between two layers, in hundredths of the screen width.
TILTscript.js50How many degrees the screen leans back.
TURNscript.js30How many degrees the screen turns on the table.
RIDEscript.js1How much scroll the whole story takes: 2 is twice as long.
SCRUBscript.js0.7How far the screen lags behind the scroll, in seconds.

Try them in the Playground

When to use it

For the «how it is built» section of an app’s landing page, a design system or a tool for interface designers: instead of listing what is inside, the real screen opens up into its layers.

On phones

The same animation with adapted sizes: the screen is measured on the width and the height of the window, is smaller and leaves room for the labels beside it, which have a shorter line.

With reduced motion

The screen stays flat and still; as you scroll its layers fade in one at a time, and the headline says which.

Pitfalls

  • The labels inside the layers tilt with the stack: to keep them upright the opposite transform has to list the rotations in reverse order, rotateZ first and then rotateX.
  • A layer with overflow hidden would flatten its 3D children and clip the labels: the layers stay without overflow and with preserve-3d.
  • The gap between the layers is in pixels, computed from the screen width: it has to be measured again on resize.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.3 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

Tested on 25 October 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