Skip to content
animorio
IT
Back to the library

Curved background

Backgrounds, ScrollGSAP, CanvasMediumCompressed weight: Demo 7.1 KBGSAP + ScrollTrigger + CustomEase 49 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The home page of Lantern Decks, a made-up presentation studio in Lisbon, in four chapters: warm white, indigo, near black and warm white again. Behind the page a canvas paints one colour per chapter; as the next chapter comes up, its colour rises from the bottom of the screen with a curved edge, high at the sides and low in the middle, that straightens out as it reaches the top. A slow light wave drifts inside every colour, a light line follows the edge, the header changes ink exactly when the curve passes under it and the chapter name in the corner rolls. Minimal style, one accent. Inspired by the La boite à slides site.

Rebuilt from scratch studying laboiteaslides.fr by Sparkk, Evan Fasquelle: 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>
<!--
  "Curved background" 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>Lantern Decks, the colour that rises on a curve</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 home page of Lantern Decks, a made-up presentation studio in Lisbon, in four chapters. Behind the page a
       canvas holds one colour per chapter: as the next chapter comes up, its colour rises from the bottom of the
       screen with a curved edge, high at the sides and low in the middle, that flattens out as it reaches the top.
       Inside each colour a slow light wave drifts. The header changes ink exactly when the curve passes under it -->
  <canvas class="fondo" data-fondo aria-hidden="true"></canvas>

  <header class="testa" data-testa>
    <p class="testa__marca">
      <svg viewBox="0 0 20 20" aria-hidden="true"><rect x="2.5" y="4.5" width="15" height="10" rx="1.6" /><path d="M10 14.5v2.6M6.6 17.1h6.8" /><path d="M5.6 11.4l2.6-2.6 2 1.7 3.6-3.6" /></svg>
      Lantern Decks
    </p>
    <p class="testa__capitolo" aria-live="polite"><span class="testa__rullo" data-rullo><span>Studio</span><span>Pitch</span><span>Keynote</span><span>Contact</span></span></p>
  </header>

  <main>
    <section class="capitolo" data-capitolo data-colore="carta" data-nome="Studio">
      <div class="capitolo__dentro" data-dentro>
      <p class="occhiello" data-entra>Presentation studio, Lisbon</p>
      <h1 class="titolo" data-titolo>We make decks people remember.</h1>
      <p class="nota" data-entra>Pitch decks, keynotes and investor updates, written and designed in one room.</p>
      <p class="invito" data-entra aria-hidden="true"><span>Scroll</span><svg viewBox="0 0 12 16"><path d="M6 1v13M1.5 9.5 6 14l4.5-4.5" /></svg></p>
      </div>
    </section>

    <section class="capitolo" data-capitolo data-colore="indaco" data-nome="Pitch">
      <div class="capitolo__dentro" data-dentro>
      <p class="occhiello" data-entra>Pitch decks</p>
      <h2 class="titolo" data-titolo>Twelve slides that raise a round.</h2>
      <p class="nota" data-entra>From the first seed meeting to the board that signs the term sheet.</p>
      </div>
    </section>

    <section class="capitolo" data-capitolo data-colore="notte" data-nome="Keynote">
      <div class="capitolo__dentro" data-dentro>
      <p class="occhiello" data-entra>Keynotes</p>
      <h2 class="titolo" data-titolo>Built for rooms of three thousand.</h2>
      <p class="nota" data-entra>Big type, one idea per slide, and a rehearsal before every stage.</p>
      </div>
    </section>

    <section class="capitolo" data-capitolo data-colore="carta" data-nome="Contact">
      <div class="capitolo__dentro" data-dentro>
      <p class="occhiello" data-entra>Your next deck</p>
      <h2 class="titolo" data-titolo>Tell us about the room.</h2>
      <p class="azione" data-entra><a class="pillola" href="#" data-pillola><span class="pillola__fondo" data-pillola-fondo></span><span class="pillola__testo">Start a deck</span><svg class="pillola__freccia" viewBox="0 0 14 14" aria-hidden="true"><path d="M2 7h9.5M7.5 3 11.5 7l-4 4" /></svg></a></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/gsap@3.15.0/dist/CustomEase.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.

33 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Curved background” 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 page, at the top the Lantern Decks mark with its little drawn screen and «Studio» on the right; in the middle the big title «We make decks people remember.» rising word by word and narrowing from wide to normal. As you scroll, indigo rises from the bottom of the screen: the sides first, then the middle, with a smile-shaped edge a third of the screen deep that flattens as it goes, until the colour covers everything just as the «Pitch decks» chapter reaches the top. A light line runs along the edge as it climbs and a band of light drifts slowly inside the colour. When the curve passes under the header, the sides first, the mark and the label turn white and «Studio» rolls into «Pitch». Then the near black of the keynotes rises, with a faint indigo light, and at the end the warm white comes back with «Tell us about the room.» and the indigo pill «Start a deck», which widens on hover and sinks and springs back when pressed.

How it works

One colour per chapter

A fixed canvas behind the page. For every chapter after the first a ScrollTrigger runs from «top bottom» to «top top» and writes its progress t, 0 to 1, with no easing: the scroll, smoothed by Lenis, decides everything. Every frame the colours are painted one over the other.

The parabola edge

The height of the new colour, counted from the bottom, is the base plus nx² times the curve: the base goes from −CURVE to 1 and the curve from CURVE to 0 as t goes from 0 to 1 (on the site a shader with the curve going from 0.3 to 0). So the sides start at the bottom and the middle a third below, and the edge reaches the top straight. The path is a polyline with a point every 12 pixels.

The light wave

Inside every colour, clipped by its edge, two soft diagonal bands one shade lighter drift on two sines: one with time at WAVE_SPEED, the other with the scroll raised to 1.2, like the site’s gradient.

The header that changes ink

For the mark and for the label on the right the script finds which colour covers their centre, working out the edge at exactly that point: since the curve is higher at the sides, they change ink a moment before the middle, each at its own time. The chapter name rolls on the site’s curve.

The titles

Every word has its own mask and rises from 130% to 0 in WORD_IN seconds, one every STAGGER, while the wdth axis of Mona Sans goes from 125 to 100; the curve is the site’s custom::out, with a 1% overshoot, rebuilt with CustomEase from its points.

Values to change

NameFileDefaultWhat it changes
CURVEscript.js0.3How deep the curved edge is when a colour starts rising, in screen heights.
WAVE_SPEEDscript.js0.06The speed of the light wave inside each colour.
WAVE_LIGHTscript.js0.5How visible the light wave is, from 0 to 1.
EDGE_LINEscript.js1The thickness in pixels of the light line along the edge (0 hides it).
WORD_INscript.js1.7How many seconds each word of a title takes to rise.
STAGGERscript.js0.05The seconds between one word and the next.
LERPscript.js0.1The Lenis scroll smoothing: lower is softer.
DRIFTscript.js0.12How far a chapter lags behind as it leaves the screen, in screen heights, fading as it goes.

Try them in the Playground

When to use it

For the home page of a studio, an agency or a product split into chapters, when every part has its own colour and the change should be felt; also for a long landing page where the background tells you where you are.

On phones

Every chapter is as tall as the screen, the canvas is fixed and redraws at the real width, the titles sit between 30 pixels and the smaller of 9.2vw and 10.4vh. The curve is measured in screen heights, so on a narrow phone it is steeper but the same. Scrolling with a finger does everything.

With reduced motion

No canvas, no curve and no smooth scroll: every chapter has its own solid colour, the text fades in as it arrives and the header changes ink and name as you pass from one chapter to the next.

Pitfalls

  • The canvas has to be measured at its real size and devicePixelRatio (at most 2) on every resize, and drawn with setTransform: without it the edge comes out blurry or the curve shifts.
  • The colour behind the header is worked out from the edge at the exact point of each label, not at the centre of the screen: the curve is higher at the sides, and the right label would change late.
  • GSAP interpolates font-variation-settings strings only when they have the same shape: «"wdth" 125» and «"wdth" 100», with the same quotes.
  • The addColorStop values of a gradient must be between 0 and 1 and in order: the bands near the border are kept inside with a clamp.

Libraries

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

Compressed with gzip, the three demo files weigh 7.1 KB; the libraries: GSAP + ScrollTrigger + CustomEase 49 KB, Lenis 5.3 KB.

Testing

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