Skip to content
animorio
IT
Back to the library

Truck into the yard

Scroll, 3D, WebGLWebGL, GSAPAdvancedCompressed weight: Demo 41 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBThree.js 174 KBFreeDownload the zip

Scroll inside the preview

The home page of a made-up logistics company, Yardline, all in 3D: as you scroll, a semi truck at sunset drives along a desert road with its headlights on, kicking up dust, the camera rises and the yard appears behind it. The truck turns in at the gate, the barrier lifts, it goes under the scanner arch, which draws it in lime lines and writes its card, crosses the yard and backs in on a curve to dock seven, trailer first and tractor behind like a real rig. Five metres from the wall it stops: the lock rods turn, the rear doors swing open and bounce off their stops, the dock door rolls up, the truck docks, the dock plate rises, runs its lip out and settles on the trailer, the straps drop. A driverless electric pallet jack brings out two pallets, one at a time; the film is cut and peels off in strips, the cartons line up in rows, a gantry reads their labels one by one while the receiving list ticks them off, and the last carton opens on the goods.

Rebuilt from scratch studying terminal-industries.com by Rejouice, Propagande: 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.

<!doctype html>
<!--
  "Truck into the yard" 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 truck that drives into the yard on scroll</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <script type="importmap">
    {
      "imports": {
        "three": "https://cdn.jsdelivr.net/npm/three@0.178.0/build/three.module.min.js",
        "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/"
      }
    }
  </script>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the home page of a made-up yard operations company, Yardline: at dusk a semi truck drives along the road, turns
       in at the gate, is scanned, crosses the yard, pulls forward and backs into dock seven. The lock rods turn, the
       doors swing open, the dock door rolls up, the plate settles, a driverless pallet jack brings out two pallets,
       the film peels off, the cartons line up, a gantry reads their labels while the list ticks them off and the last
       carton opens on the goods. The whole scene is built in three.js and follows the scroll -->
  <header class="barra" data-barra>
    <a class="marchio" href="#" aria-label="Yardline">
      <svg viewBox="0 0 32 32" aria-hidden="true"><path d="M4 6h7l5 9 5-9h7L19 19v7h-6v-7z"/></svg>
      <span>Yardline</span>
    </a>
    <nav class="voci" aria-label="Main">
      <a href="#">Platform</a>
      <a href="#">Gate</a>
      <a href="#">Yard</a>
      <a href="#">Dock</a>
      <a href="#">Customers</a>
    </nav>
    <div class="azioni">
      <a class="pulsante pulsante--chiaro" href="#">Book a demo</a>
      <a class="pulsante pulsante--accento" href="#">See the yard</a>
    </div>
  </header>

  <main>
    <section class="corsa" data-corsa>
      <div class="palco" data-palco>
        <canvas class="scena" data-scena aria-hidden="true"></canvas>
        <div class="velo" data-velo aria-hidden="true"></div>

        <div class="righe">
          <p class="riga riga--grande" data-riga data-da="0.004" data-a="0.085">The yard, rebuilt from the gate to the dock.</p>
          <p class="riga" data-riga data-da="0.1" data-a="0.205">Every truck checked in at the gate, in seconds.</p>
          <p class="riga" data-riga data-da="0.22" data-a="0.325">Guided across the yard to the right door.</p>
          <p class="riga" data-riga data-da="0.335" data-a="0.455">Backed in on the first try. Doors open.</p>
          <p class="riga" data-riga data-da="0.47" data-a="0.56">Dock ready before the engine stops.</p>
          <p class="riga" data-riga data-da="0.565" data-a="0.77">Unloaded the moment it arrives.</p>
          <p class="riga" data-riga data-da="0.775" data-a="0.885">Every carton counted and checked.</p>
          <p class="riga riga--grande" data-riga data-da="0.89" data-a="1.01">Unboxed, verified, on the shelf.</p>
        </div>

        <div class="scheda-scan" data-scan aria-hidden="true">
          <p class="scheda-scan__titolo">Inbound</p>
          <dl>
            <div><dt>Carrier</dt><dd>Northline Freight</dd></div>
            <div><dt>Trailer</dt><dd>YL 48213</dd></div>
            <div><dt>Seal</dt><dd>Intact</dd></div>
            <div><dt>Door</dt><dd>Dock 7</dd></div>
          </dl>
          <p class="scheda-scan__esito"><span class="spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span>Cleared in <b data-tempo>0:04</b></p>
        </div>

        <aside class="lista" data-lista aria-hidden="true">
          <p class="lista__titolo">Receiving<span>Dock 7 · PO 48213</span></p>
          <div class="lista__conte">
            <div><b><span data-palette>0</span><small>/2</small></b><span>pallets</span></div>
            <div><b><span data-cartoni>0</span><small>/12</small></b><span>cartons</span></div>
            <div><b><span data-unita>0</span><small>/24</small></b><span>units</span></div>
          </div>
          <div class="lista__barra"><i data-avanzamento></i></div>
          <ul class="lista__righe">
            <li data-voce="Stoneware mugs"><span class="lista__nome">Stoneware mugs</span><span class="lista__sku">SKU 2041</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Linen napkins"><span class="lista__nome">Linen napkins</span><span class="lista__sku">SKU 1187</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Glass carafes"><span class="lista__nome">Glass carafes</span><span class="lista__sku">SKU 3320</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Oak boards"><span class="lista__nome">Oak boards</span><span class="lista__sku">SKU 0912</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Wool throws"><span class="lista__nome">Wool throws</span><span class="lista__sku">SKU 5530</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Clay planters"><span class="lista__nome">Clay planters</span><span class="lista__sku">SKU 7724</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Copper kettles"><span class="lista__nome">Copper kettles</span><span class="lista__sku">SKU 6408</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Cotton towels"><span class="lista__nome">Cotton towels</span><span class="lista__sku">SKU 1462</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Rattan baskets"><span class="lista__nome">Rattan baskets</span><span class="lista__sku">SKU 8815</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Gift sets"><span class="lista__nome">Gift sets</span><span class="lista__sku">SKU 9006</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Ceramic bowls"><span class="lista__nome">Ceramic bowls</span><span class="lista__sku">SKU 2093</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
            <li data-voce="Brass candleholders"><span class="lista__nome">Brass candleholders</span><span class="lista__sku">SKU 4471</span><span class="lista__spunta"><svg viewBox="0 0 16 16"><path d="M3 8.5l3.2 3L13 4.5"/></svg></span></li>
          </ul>
          <p class="lista__ultimo" data-ultimo>Unloading dock 7</p>
        </aside>

        <div class="numeri" data-numeri aria-hidden="true">
          <div><b data-conta="2.4" data-decimali="1">0</b><span>min at the gate</span></div>
          <div><b data-conta="38" data-suffisso="%">0</b><span>faster turns</span></div>
          <div><b data-conta="12" data-suffisso=" min">0</b><span>dock to shelf</span></div>
        </div>

        <p class="scorri" data-scorri>Scroll</p>
      </div>
    </section>
    <section class="dopo">
      <h2>One yard, from the gate to the shelf.</h2>
      <a class="pulsante pulsante--accento" href="#">Book a demo</a>
    </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 type="module" 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.

88 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 “Truck into the yard” 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

A single three.js scene stays behind the page while you scroll through fourteen screens, and the scroll moves one number that the scene follows with a little lag. At first the semi truck is in profile on the desert road at sunset, its headlights lighting the asphalt: the wheels turn as far as the truck moves. The camera rises and widens, and behind the fence the warehouse appears with its thirteen docks. At the gate the striped barrier lifts as the cab comes near, and under the scanner arch a blade of lime light crosses the truck and draws it in lines only where it passes; at the top right its card appears: carrier, trailer, seal, door, «cleared in 0:04». The truck curves into the yard, the trailer following its own path, pulls past the docks and stops; then it backs up with the white lights on: the trailer follows the curve to dock seven and the tractor is pushed along behind it, steering by itself. Dust rises behind the wheels, a breath of smoke from the stacks. Five metres from the wall it stops with the brake lights on; the camera goes close to the locks: the rods turn one after the other, the two rear doors swing open, hit their stops and bounce, the light comes on inside and you see the pallets in glossy film, held by two orange straps. The sectional door runs up its tracks and folds under the ceiling, the dock light turns from green to red, the truck docks. The dock plate rises on its hinge, runs its lip out, settles on the trailer floor; the light inside turns green and the straps drop against the wall. A driverless electric pallet jack, its lidar turning and its screen showing the job, drives in, slides its forks under the first pallet, lifts it with a jolt, backs out and sets it down in its zone; then it does the same with the second. On the floor a blade cuts the film down the corner and the strips peel away one after another, the twelve cartons fly into three rows, a gantry hung from the roof steps row by row and its head reads the labels, which light up one at a time. Meanwhile on the right the receiving list counts pallets, cartons and units and ticks off every item read. On the last carton the tape splits, the four flaps open on a spring, the tissue parts to the sides and six boxes rise under a lime scan line. At the end, on the left, three numbers count up to their value. Over the scene the lines of the home page type themselves letter by letter, the newest one in lime, and leave when the next one comes.

How it works

One scene and one number

The section is 1400vh tall with a 100lvh sticky stage and the three.js canvas inside. A ScrollTrigger on the section gives the progress from 0 to 1; every frame the scene follows it with an exponential ease (the LAG constant), so every move is soft even with a mouse wheel. Lenis smooths the scroll.

The truck made of geometry

The cab is an extruded side profile with the wheel arch cut out, with windscreen, windows, mirrors, grille, headlights, tanks and stacks added on top. The tyres are turned on a lathe with a raised tread and the rims have ten nuts. The trailer has its ribs in an InstancedMesh, the brand on a canvas texture, the rear doors hung on hinges and the brake and reversing lights.

Driving a real articulated truck

The road to the dock is a Catmull-Rom curve for the tractor; the trailer follows it like a tractrix (its axle is pulled toward the kingpin at a fixed distance). In reverse it is the other way round: the trailer axle follows a Bézier curve that ends straight in the dock and the tractor is pushed along behind the kingpin. Everything is worked out once in 1600 and 900 samples; the scroll picks the sample and the wheels turn as far as the distance covered.

The timing of the story

An object P says in which part of the scroll each thing happens. The forward drive is not linear: a monotone curve goes through the points where the truck must be on the road, under the arch and in the lane, so the camera finds it where it is waiting. The other things (rods, doors, dock door, plate, straps, jack, film, cartons, gantry, goods) each have their own window and their own curve.

The camera on keyframes

Thirty-one shots, each with a position, a target and a field of view, some tied to the truck, the jack or the carton. Between them the camera moves along a Catmull-Rom spline, so it never stops on a key. On a tall screen the field widens just enough to keep the same scene.

The unloading, step by step

The pallet jack follows Catmull-Rom curves on the floor with its heel (the root of the forks) and turns along the tangent; in reverse the tangent flips. When the forks rise the pallet moves from the trailer to the scene and follows the forks, then stays where it is set down. Every strip of film has its hinge at the base and peels in order of distance from the cut corner; the cartons go to places worked out in the pallet’s own coordinates. The gantry steps row by row and its head runs back and forth: a label lights up when the head passes it, and the list counts the labels read.

The scan and the lines

The lime lines are the EdgesGeometry of every part of the truck with two clipping planes in world space: they only show inside the band of the arch. The lines of the page are split into letters and type themselves inside their scroll window, the newest letter in the accent colour.

Dust and smoke

One Points object with a shader: every particle has an age, a life, a type and a size, and grows as it fades. Dust is born behind the wheels the faster the truck goes, smoke from the stacks while the engine works; a jump of the scroll makes none.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js'YARDLINE'The name on the trailer, the arch and the boxes.
CAB_COLORscript.js'#2f3539'The paint of the tractor.
TRAILER_COLORscript.js'#d6d8da'The paint of the trailer.
RUNscript.js1400How long the story is, in vh of scroll.
LAGscript.js3.2How quickly the scene catches up with the scroll (higher is tighter).
SMOOTHscript.js1.1Seconds of the smooth scroll (0 turns it off).
SUNscript.js6How high the sun is over the horizon, in degrees.
EXPOSUREscript.js1.08The brightness of the whole picture.
SHADOWSscript.jstrueSoft shadows from the sun.
--accentostyle.css#c7f03aThe one accent: the caret, the scan light, the button.

Try them in the Playground

When to use it

For the home page of a logistics, trucking or warehousing company, or of supply chain software: a story told as you scroll, from the truck on the road to the goods on the shelf. It also suits a shop that wants to show its delivery, or a product page that follows an order step by step.

On phones

The same scene and the same moves: the stage is 100lvh tall and on a tall screen the field of view widens to keep the same framing; the bar keeps the mark and one button, the lines size themselves on height and width. The pixel ratio is capped at 1.75 to stay smooth.

With reduced motion

No following, no smooth scroll and no particles: the story moves in still chapters (the road, the gate, the yard, the dock, the open doors, the plate, the jack under the pallet, the pallets down, the cut film, the cartons in rows, the goods) with a fade between them; the ticks of the list appear without a spring.

Pitfalls

  • A trailer cannot be steered in reverse by following the tractor: it diverges. Do the opposite, give the curve to the trailer and let the tractor follow.
  • Parts mirrored with scale.z = -1 must be flipped (swap two vertices of every triangle) when they are merged into one geometry, or they show inside out.
  • An InstancedMesh merged as it is loses its copies: multiply each instance matrix in first.
  • The clipping planes of the scan are in world space: they need renderer.localClippingEnabled.
  • Canvas textures with text must be drawn after document.fonts.load, or they come out in the system font.
  • A glass panel with backdrop-filter costs even at zero opacity: when it is invisible, hide it with visibility.
  • Things that never move (the pallets at the back of the trailer, the ones on the racks) should be merged into a few meshes: on their own they are hundreds of draw calls, in the shadow pass too.

Libraries

three.js 0.178.0, GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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