Skip to content
animorio
IT
Back to the library

Into the laptop

TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.5 KBGSAP 28 KBFreeDownload the zip

A page transition inside a laptop and a phone, in the style of product components: a site builder shows three templates (a shop, a portfolio, a blog) and picking one makes the page on the screen shrink and slide away upwards like a closing window, the new one rises from below, the address changes letter by letter and the content comes in staggered, while both devices turn a few degrees and settle.

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>
<!--
  "Into the laptop" 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>Pagewright templates</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>
  <!-- an invented site builder shows its templates inside a laptop and a phone: pick one and the page in the screen
       closes upwards like a window while the new one rises from below, the address changes, the content comes in
       staggered and the devices turn a few degrees and settle -->
  <main class="palco">
    <header class="testa" data-testa>
      <p class="occhiello">Pagewright templates</p>
      <h1 class="titolo">One builder, <span class="grigio">every kind of site</span></h1>
    </header>

    <div class="scena-box" data-box>
      <div class="scena" data-scena>
        <div class="portatile" data-portatile>
          <div class="coperchio">
            <div class="schermo" data-schermo="grande">
              <div class="barra">
                <span class="frecce" aria-hidden="true">
                  <svg viewBox="0 0 16 16"><path d="M10 3.5 5.5 8l4.5 4.5" /></svg>
                  <svg viewBox="0 0 16 16"><path d="M6 3.5 10.5 8 6 12.5" /></svg>
                </span>
                <span class="indirizzo"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="7" width="8" height="6" rx="1.5" /><path d="M5.8 7V5.4a2.2 2.2 0 0 1 4.4 0V7" /></svg><span class="url" data-url></span></span>
                <span class="barra-vuoto"></span>
              </div>
              <div class="pagine" data-pagine></div>
              <div class="riflesso" aria-hidden="true"></div>
            </div>
          </div>
          <div class="base" aria-hidden="true"><span class="incavo"></span></div>
          <div class="ombra" aria-hidden="true"></div>
        </div>

        <div class="telefono" data-telefono>
          <div class="schermo schermo--tel" data-schermo="piccolo">
            <div class="isola" aria-hidden="true"></div>
            <div class="pagine" data-pagine></div>
            <div class="riflesso" aria-hidden="true"></div>
          </div>
          <div class="ombra ombra--tel" aria-hidden="true"></div>
        </div>
      </div>
    </div>

    <nav class="schede" data-schede aria-label="Templates">
      <span class="indicatore" data-indicatore aria-hidden="true"></span>
      <button type="button" class="scheda" data-scheda="0" aria-pressed="true">Online store</button>
      <button type="button" class="scheda" data-scheda="1" aria-pressed="false">Portfolio</button>
      <button type="button" class="scheda" data-scheda="2" aria-pressed="false">Blog</button>
    </nav>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true">
      <path d="M4 3l14 7.2-6.1 1.6L9.2 18z" />
    </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.

28 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 “Into the laptop” 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 warm white background, under the headline «One builder, every kind of site» of an invented site builder, Pagewright, stands a laptop drawn in three quarters: thin dark bezel, a screen with the glass sheen and the browser bar, an aluminium base with its notch. Beside it, a little in front, a phone with its island. Both show the same website, drawn in HTML: the Kelso mug shop, the portfolio of a designer, Mira Sato, or the Halfmoon Journal blog. Below, three pill tabs (Online store, Portfolio, Blog) with a black indicator sliding under the chosen one. Pick a template and the page on the screen shrinks, rounds its corners and slides away upwards while fading, like a window closing; the new one rises from below and settles, then the navigation, headline, text, button, picture and cards come in one after another. The letters of the address leave upwards and the new ones rise from below. Meanwhile the laptop turns a few degrees and lifts, then returns on a spring; the phone does the same a moment later. A fake pointer picks the three templates one after another.

How it works

A scene at a fixed size

The laptop and phone sit in a scene drawn at 660 by 420 pixels, with perspective on the container. The script scales it to fit the free space between the headline and the tabs and recomputes it on resize: on a phone it is whole, just smaller.

Two pages on one screen

Each screen keeps its current page. On change the new page is added below, the old one moves up by yPercent -38 while shrinking and fading on power3.in, the new one comes from yPercent 100 on expo.out and starts when the old one is halfway. Then the old one is removed.

Staggered content

Every piece of the site has data-entra: navigation, headline, text, button, picture, cards. They come up 14 pixels, SFALSA seconds apart, shortly after the page starts rising.

The rolling address

The address is a row of spans, one per letter: the old ones leave upwards one after another, then the script writes the new ones and lifts them from below 12 milliseconds apart.

The devices that turn

The laptop and phone have their transforms owned by GSAP (rotationY -14, rotationX 5). On change they turn by GIRO degrees and rise 6 pixels, then come back on elastic.out(1, 0.55); the phone starts RITARDO_TEL seconds later.

Values to change

NameFileDefaultWhat it changes
CHIUDEscript.js0.5How long the old page takes to close upwards, in seconds.
ENTRAscript.js0.85How long the new page takes to rise from below, in seconds.
SFALSAscript.js0.05The delay between one piece and the next of the incoming content, in seconds.
GIROscript.js7How many degrees the devices turn during the change.
RITARDO_TELscript.js0.12How much later the phone starts, in seconds.
SOSTAscript.js2.4How long each site stays in the automatic tour, in seconds.

Try them in the Playground

When to use it

For the templates page of a site builder, an agency or a studio showing its work: the tabs pick the project and the screen shows it as a client would see it, on the computer and the phone together.

On phones

The same transition: the scene with the laptop and phone shrinks to fit whole in the box, while the headline and tabs stay large and readable. A tap picks the template like a click.

With reduced motion

The devices stay still and nothing slides: the old page fades out and the new one fades in already in place, and the address changes at once.

Pitfalls

  • The scene must be absolutely positioned in the middle of its space: in a grid its real size (660 by 420) would widen the row even when scaled down, and the page would spill out of the box.
  • The devices’ transforms must be handed to GSAP from the start (gsap.set with rotationY and rotationX): a transform written in CSS would be wiped by the first tween.
  • The pages slide in yPercent, not pixels, so if the window changes size halfway through a change nothing is left crooked.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.5 KB; the libraries: GSAP 28 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