Skip to content
animorio
IT
Back to the library

Poster to trailer

Scroll, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 9.6 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The page of a made-up film, Paper Moons, from a made-up distributor, Kestrel Pictures: the poster stays still in the middle while the synopsis and credits scroll by, and halfway through the section the same frame stretches from the shape of the poster into a wide still of the trailer, which lands from four times closer; a quarter of a second later the play button appears. Scrolling back, it closes into the poster. Minimal style, black and white with the film’s pink.

Rebuilt from scratch studying neonrated.com by 27b: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Poster to trailer" 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 film poster that turns into the trailer on scroll</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/archivo@5.3.0/wdth.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>
  <!-- the page of a made-up film, Paper Moons, released by a made-up distributor, Kestrel Pictures. The poster stays
       in the middle of the screen while the synopsis and the credits go by; halfway through the section the same
       frame stretches from the poster into a wide still of the film, the still lands from very close, and a play
       button appears. Scrolling back, it closes into the poster again -->
  <main class="pagina">
    <header class="apertura">
      <div class="barra">
        <span class="marchio">KESTREL</span>
        <span class="barra__voce">Now showing</span>
      </div>
      <p class="occhiello">Kestrel Pictures presents</p>
      <h1 class="titolo">Paper<br>Moons</h1>
      <p class="sotto">A film by Noor Achterberg</p>
      <p class="scendi"><span>Scroll</span><svg viewBox="0 0 12 40" aria-hidden="true"><path class="scendi__riga" d="M6 0v36" /><path d="M2 32l4 6 4-6" /></svg></p>
    </header>

    <section class="film" data-film aria-label="Paper Moons">
      <div class="palco">
        <div class="area" data-area>
          <div class="quadro" data-quadro>
            <!-- the poster: drawn by us, a pink sheet with three paper moons on their threads -->
            <div class="strato strato--poster" data-poster>
              <div class="dentro" data-dentro-poster>
                <svg viewBox="0 0 400 600" preserveAspectRatio="xMidYMid slice" role="img" aria-label="Paper Moons poster">
                  <defs>
                    <linearGradient id="p-fondo" x1="0" y1="0" x2="0" y2="1">
                      <stop offset="0" stop-color="#ff5fae" />
                      <stop offset="0.62" stop-color="#ff4fa3" />
                      <stop offset="1" stop-color="#e9368c" />
                    </linearGradient>
                    <radialGradient id="p-luna" cx="0.38" cy="0.34" r="0.75">
                      <stop offset="0" stop-color="#fff8ea" />
                      <stop offset="1" stop-color="#efdfc4" />
                    </radialGradient>
                    <clipPath id="p-c1"><circle cx="0" cy="0" r="54" /></clipPath>
                    <clipPath id="p-c2"><circle cx="0" cy="0" r="34" /></clipPath>
                    <clipPath id="p-c3"><circle cx="0" cy="0" r="24" /></clipPath>
                  </defs>
                  <rect width="400" height="600" fill="url(#p-fondo)" />
                  <text x="200" y="38" class="p-piccolo" text-anchor="middle">A KESTREL PICTURES RELEASE</text>
                  <g class="p-luna" data-luna data-perno="132 0">
                    <path d="M132 0V150" class="filo" />
                    <g transform="translate(132 204)">
                      <ellipse cx="10" cy="64" rx="40" ry="5" class="p-ombra" />
                      <circle r="54" fill="url(#p-luna)" />
                      <g clip-path="url(#p-c1)"><circle cx="26" cy="-10" r="52" class="p-falce" /></g>
                      <path d="M-36 -30C-28 -38 -18 -44 -8 -46" class="piega" />
                      <path d="M-44 6C-40 22 -30 34 -18 40" class="piega" />
                    </g>
                  </g>
                  <g class="p-luna" data-luna data-perno="262 0">
                    <path d="M262 0V96" class="filo" />
                    <g transform="translate(262 130)">
                      <circle r="34" fill="url(#p-luna)" />
                      <g clip-path="url(#p-c2)"><circle cx="-16" cy="-6" r="32" class="p-falce" /></g>
                      <path d="M18 -20C24 -12 27 -2 26 8" class="piega" />
                    </g>
                  </g>
                  <g class="p-luna" data-luna data-perno="318 0">
                    <path d="M318 0V218" class="filo" />
                    <g transform="translate(318 242)">
                      <circle r="24" fill="url(#p-luna)" />
                      <g clip-path="url(#p-c3)"><circle cx="12" cy="8" r="23" class="p-falce" /></g>
                    </g>
                  </g>
                  <text x="200" y="438" class="p-titolo" text-anchor="middle">PAPER</text>
                  <text x="200" y="514" class="p-titolo" text-anchor="middle">MOONS</text>
                  <text x="200" y="542" class="p-crediti" text-anchor="middle">DIRECTED BY NOOR ACHTERBERG  WRITTEN BY TOVE LIND AND SAMI OKAFOR</text>
                  <text x="200" y="553" class="p-crediti" text-anchor="middle">ELIF DEMIR  JUN ARAKAWA  ROSA KELL  ILAN MOREAU  MUSIC BY ODA STRAND</text>
                  <text x="200" y="578" class="p-data" text-anchor="middle">IN THEATERS DECEMBER 12</text>
                </svg>
              </div>
            </div>

            <!-- the still: a dark room, paper moons hung from the ceiling, a lamp on the table, the real moon outside -->
            <div class="strato strato--trailer" data-trailer>
              <div class="dentro" data-dentro-trailer>
                <svg viewBox="0 0 720 500" preserveAspectRatio="xMidYMid slice" role="img" aria-label="A still from the Paper Moons trailer">
                  <defs>
                    <linearGradient id="t-muro" x1="0" y1="0" x2="0" y2="1">
                      <stop offset="0" stop-color="#0b0f21" />
                      <stop offset="1" stop-color="#171c38" />
                    </linearGradient>
                    <linearGradient id="t-notte" x1="0" y1="0" x2="0" y2="1">
                      <stop offset="0" stop-color="#17214a" />
                      <stop offset="1" stop-color="#2b3a6c" />
                    </linearGradient>
                    <radialGradient id="t-luce" cx="0.5" cy="0.5" r="0.5">
                      <stop offset="0" stop-color="#ffd59a" stop-opacity="0.85" />
                      <stop offset="0.45" stop-color="#ff9f6b" stop-opacity="0.25" />
                      <stop offset="1" stop-color="#ff7a5c" stop-opacity="0" />
                    </radialGradient>
                    <radialGradient id="t-luna" cx="0.3" cy="0.4" r="0.8">
                      <stop offset="0" stop-color="#fff3dc" />
                      <stop offset="1" stop-color="#e2c9a2" />
                    </radialGradient>
                    <clipPath id="t-c1"><circle r="40" /></clipPath>
                    <clipPath id="t-c2"><circle r="28" /></clipPath>
                    <clipPath id="t-c3"><circle r="40" /></clipPath>
                    <clipPath id="t-c4"><circle r="22" /></clipPath>
                  </defs>
                  <rect width="720" height="500" fill="url(#t-muro)" />
                  <!-- the window, with the real moon -->
                  <rect x="468" y="64" width="190" height="270" fill="url(#t-notte)" />
                  <circle cx="610" cy="118" r="11" fill="#e8ecff" opacity="0.9" />
                  <circle cx="615" cy="114" r="10" fill="#1a2550" />
                  <g class="stella" data-stella><circle cx="512" cy="104" r="1.2" /><circle cx="560" cy="160" r="0.9" /><circle cx="636" cy="210" r="1" /><circle cx="498" cy="236" r="0.8" /></g>
                  <path d="M563 64V334M468 199H658" class="telaio" />
                  <rect x="468" y="64" width="190" height="270" class="telaio telaio--bordo" />
                  <path d="M458 340H668" class="davanzale" />
                  <!-- the floor -->
                  <rect y="404" width="720" height="96" fill="#090b17" />
                  <path d="M0 404H720" class="pavimento" />
                  <!-- the table and the lamp -->
                  <path d="M84 404V352M226 404V352M70 352H240" class="tavolo" />
                  <path d="M134 352V300M120 352H150" class="lampada" />
                  <path d="M116 300L126 268H144L154 300Z" class="paralume" />
                  <circle cx="135" cy="300" r="190" fill="url(#t-luce)" class="alone" data-alone />
                  <!-- the paper moons on their threads -->
                  <g data-luna data-perno="248 0">
                    <path d="M248 0V132" class="filo filo--scuro" />
                    <g transform="translate(248 172)">
                      <ellipse cx="-6" cy="232" rx="26" ry="3.5" class="t-ombra" />
                      <circle r="40" fill="url(#t-luna)" />
                      <g clip-path="url(#t-c1)"><circle cx="22" cy="-6" r="38" class="t-falce" /></g>
                      <path d="M-26 -22C-20 -30 -12 -34 -4 -36" class="piega piega--scura" />
                    </g>
                  </g>
                  <g data-luna data-perno="352 0">
                    <path d="M352 0V70" class="filo filo--scuro" />
                    <g transform="translate(352 98)">
                      <circle r="28" fill="url(#t-luna)" />
                      <g clip-path="url(#t-c2)"><circle cx="-12" cy="4" r="27" class="t-falce" /></g>
                    </g>
                  </g>
                  <g data-luna data-perno="438 0">
                    <path d="M438 0V222" class="filo filo--scuro" />
                    <g transform="translate(438 262)">
                      <ellipse cx="-14" cy="142" rx="30" ry="4" class="t-ombra" />
                      <circle r="40" fill="url(#t-luna)" />
                      <g clip-path="url(#t-c3)"><circle cx="-22" cy="8" r="38" class="t-falce" /></g>
                      <path d="M26 -22C32 -13 35 -3 34 7" class="piega piega--scura" />
                    </g>
                  </g>
                  <g data-luna data-perno="186 0">
                    <path d="M186 0V58" class="filo filo--scuro" />
                    <g transform="translate(186 80)">
                      <circle r="22" fill="url(#t-luna)" />
                      <g clip-path="url(#t-c4)"><circle cx="10" cy="-4" r="21" class="t-falce" /></g>
                    </g>
                  </g>
                  <!-- dust in the lamp light -->
                  <g class="polvere" data-polvere>
                    <circle cx="150" cy="220" r="1.4" /><circle cx="196" cy="262" r="1" /><circle cx="110" cy="240" r="1.2" />
                    <circle cx="232" cy="300" r="0.9" /><circle cx="168" cy="180" r="1.1" /><circle cx="90" cy="290" r="0.8" />
                    <circle cx="210" cy="206" r="1.3" /><circle cx="128" cy="196" r="0.9" /><circle cx="250" cy="250" r="1" />
                  </g>
                  <rect width="720" height="500" class="vignetta" />
                </svg>
              </div>
              <div class="grana" data-grana aria-hidden="true"></div>
              <div class="avanza" aria-hidden="true"><span data-avanza></span></div>
              <button class="play" type="button" data-play aria-label="Play trailer">
                <svg viewBox="0 0 40 40" aria-hidden="true">
                  <path class="play__tri" data-tri d="M13.5 9.9L31.3 21L13.5 32.1Z" />
                  <g class="play__pausa" data-pausa><path d="M15 11V31" /><path d="M25 11V31" /></g>
                </svg>
              </button>
            </div>
          </div>
          <p class="didascalia" aria-live="polite">
            <span data-dida-poster>Poster</span>
            <span data-dida-trailer>Trailer, 2 min 14 s</span>
          </p>
        </div>

        <div class="testi" data-finestra>
          <div class="testi__scorre" data-testi>
            <p class="etichetta">Synopsis</p>
            <p class="sinossi">In a coastal town where the street lights went out years ago, a family of paper makers hangs a new moon in every window, one for each night of the winter.</p>
            <p class="meta">2025, 112 min, rated PG</p>
            <dl class="crediti">
              <div><dt>Directed by</dt><dd>Noor Achterberg</dd></div>
              <div><dt>Written by</dt><dd>Tove Lind, Sami Okafor</dd></div>
              <div><dt>Starring</dt><dd>Elif Demir, Jun Arakawa, Rosa Kell, Ilan Moreau</dd></div>
              <div><dt>Awards</dt><dd>Official Selection, Harbour Film Festival</dd></div>
            </dl>
            <p class="uscita">In theaters<br>December 12</p>
          </div>
        </div>
      </div>
    </section>

    <footer class="chiusura">
      <span class="marchio marchio--grande">KESTREL</span>
      <p class="chiusura__frase">Films worth the dark.</p>
    </footer>
  </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.

46 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 “Poster to trailer” 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

It opens on white with Kestrel Pictures’ thin bar and the film’s title, “Paper Moons”, in a very narrow, very heavy typeface. Scrolling down you enter the film page: on the left (on a phone, at the top) the poster, drawn by us, a pink sheet with three paper moons hanging from their threads, the title at the bottom and tiny credits; on the right (on a phone, below) a window where the synopsis, the year and running time, the credits (Directed by, Written by, Starring, Awards) and finally “In theaters December 12” scroll by. The poster doesn’t move. Past the middle of the section the frame changes shape: in 0.75 seconds it widens from the poster’s two by three to a wide 1.4375 format, and inside a still from the trailer arrives, a dark room with paper moons hanging from the ceiling, a lamp lit on the table and the real moon in the window, starting four times larger and settling; a quarter of a second later the play triangle appears, with a small bounce. The caption below changes from “Poster” to “Trailer”. The moons sway on their threads each at its own pace, dust drifts in the light of the lamp, which breathes, and a moving film grain lies on top. Pressing play turns the triangle into pause, a line runs along the bottom and the still slowly pushes in. Scrolling back, the frame closes into the poster, which arrives from one and a half times larger.

How it works

The stage and the text window

The section is three screens tall and holds a sticky stage 100vh tall, split in two: the frame area and a window with hidden overflow and edges faded by a mask. A timeline with a ScrollTrigger from top top to bottom bottom, with scrub, moves the text inside the window from bottom to top: the frame stays, the words go by next to it.

A threshold, not a scrub

The change does not follow the scroll step by step: in the onUpdate of the same ScrollTrigger, when the progress goes past 0.5 the frame becomes the still, when it falls back the poster returns. A switch keeps it from restarting on every update.

The frame that changes shape

Both sizes are computed from the room in the area: the poster as tall as it fits at two by three, the still as wide as it fits at 1.4375. GSAP takes width and height from one to the other in 0.75 seconds with the cubic-bezier(.19, 1, .22, 1) curve, solved by hand in an easing function. On resize the sizes are measured again, even halfway through the change.

The close-up still and the play

The two drawings sit in two stacked layers, in SVG with preserveAspectRatio slice, so the frame crops them like object-fit: cover while it changes shape. The still fades in while its wrapper scales from 4 to 1 in the same 0.75; the play button arrives in 0.3 seconds after a 0.25 delay. Going back, the poster scales from 1.5 to 1.

The details that move by themselves

The moons turn around the knot of their thread (svgOrigin) with yoyo tweens of different lengths, the dust comes and goes with random values refreshed on every repeat, the lamp’s glow breathes with a tween that starts the next one, and the grain is a tile of noise drawn once on a canvas and moved twelve times a second by GSAP’s ticker.

Values to change

NameFileDefaultWhat it changes
TURN_ATscript.js0.5How far through the section the poster turns into the still (0 to 1).
WIDEscript.js1.4375Width over height of the still.
MORPHscript.js0.75Seconds the frame takes to change shape.
STILL_FROMscript.js4How close the still starts when it arrives.
POSTER_FROMscript.js1.5How close the poster starts when it comes back.
PLAY_DELAYscript.js0.25Seconds before the play button shows up.
SWAYscript.js1.6How many degrees the paper moons sway on their threads.
GRAINscript.js0.14How visible the film grain is on the still.
SMOOTHscript.js1.1Seconds of the smooth scroll; 0 for the browser’s own.

Try them in the Playground

When to use it

For the page of a film, a series, a documentary or an event with a video: you see the poster first and then, scrolling down, you reach the trailer without changing page. It also suits a product with a vertical photo and a wide video.

On phones

The same change with the same curves: the frame sits at the top and the text window below, and both shapes are measured on the room left, in width and in height, so the wide still takes almost the full width.

With reduced motion

The frame does not change shape in front of you: it fades out, takes its new size and fades back in with the still or the poster; no close-up scaling, still moons, still grain, no smooth scroll.

Pitfalls

  • If the change were tied to the scrub, stopping halfway would leave the frame between two shapes: a threshold with a switch is better, as the site does.
  • The sizes of the poster and the still depend on the room in the area, which changes on resize and with the window height: they must be measured again even mid-animation, killing the width and height tween.
  • The scale from 4 to 1 goes on a wrapper inside the layer, not on the layer that fades: otherwise opacity and scale fight over the same element and the fade gets lost.
  • The play button must not stay clickable when it is invisible: pointer-events goes off together with the opacity.

Libraries

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

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

Testing

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