Skip to content
animorio
IT
Back to the library

Three-wave transition

Transitions, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The website of a made-up seaside hotel, Saltmere, with four pages and four seas: petrol for Stay, sand for Rooms, terracotta for Baths, olive for Table. On a click on a menu item three full waves rise from the bottom one after the other in the three tones of the page that is coming, light, middle and deep, with their crest running and a line of foam under the edge, redrawn in SVG at every frame. They cover the screen, wait a moment and ebb away upwards, the deepest first, each one uncovering the one below, until the new page is left with its title rising out of its line. With the mouse over an item, the sea of that page shows at the bottom.

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>
<!--
  "Three-wave transition" 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 page transition with three waves that rise and ebb away</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.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>
  <main class="stage" data-stage>
    <!-- the four pages of a made-up seaside hotel and bathhouse, Saltmere. Every page has its own sea: a background, an
         ink and three tones. A click on the menu sends three full waves up from the bottom, one after the other, in the
         three tones of the page that is coming, with their crests moving; they cover the screen and then ebb away
         upwards, the last one first, and the new page is left behind them with its title rising -->

    <header class="top">
      <a href="#" class="brand" data-go="stay" aria-label="Saltmere, home">
        <svg class="brand__mark" viewBox="0 0 28 28" aria-hidden="true">
          <path class="brand__sun" d="M7.5 15a6.5 6.5 0 0 1 13 0"></path>
          <path d="M3 18.6c1.8 0 1.8-1.2 3.6-1.2s1.8 1.2 3.6 1.2 1.8-1.2 3.6-1.2 1.8 1.2 3.6 1.2 1.8-1.2 3.6-1.2 1.8 1.2 3.6 1.2"></path>
          <path d="M6 22.4c1.6 0 1.6-1 3.2-1s1.6 1 3.2 1 1.6-1 3.2-1 1.6 1 3.2 1 1.6-1 3.2-1"></path>
        </svg>
        <span class="brand__name">Saltmere</span>
      </a>
      <nav class="nav" data-nav aria-label="Main">
        <span class="nav__hover" data-hover aria-hidden="true"></span>
        <span class="nav__pill" data-pill aria-hidden="true"><span class="nav__shine"></span></span>
        <a href="#" class="nav__item is-here" data-go="stay" aria-current="page"><span>Stay</span></a>
        <a href="#" class="nav__item" data-go="rooms"><span>Rooms</span></a>
        <a href="#" class="nav__item" data-go="baths"><span>Baths</span></a>
        <a href="#" class="nav__item" data-go="table"><span>Table</span></a>
      </nav>
      <a href="#" class="book" data-go="rooms"><span>Book</span>
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.5M8.6 4.4 12.2 8l-3.6 3.6"></path></svg>
      </a>
    </header>

    <!-- a thin tide line in the empty corner, the quiet memory of the waves: it keeps drifting, and the marker shows the
         hour of the next high tide -->
    <svg class="tide" data-tide viewBox="0 0 320 120" aria-hidden="true">
      <path class="tide__base" d="M0 96H320"></path>
      <path class="tide__line" data-tide-line d=""></path>
      <path class="tide__mark" data-tide-mark d="M0 20V104"></path>
    </svg>
    <p class="tide__label" data-in-tide aria-hidden="true"><span>High tide</span><b data-tide-time>14:32</b></p>

    <div class="pages">
      <section class="page is-on" data-page="stay" aria-label="Stay">
        <p class="eyebrow" data-in>A hotel and bathhouse on the north shore</p>
        <h1 class="title" data-title><span class="line"><span class="w">Set by</span></span><span class="line"><span class="w">the <i>tide</i></span></span></h1>
        <div class="foot">
          <p class="text" data-in>Twenty-two rooms on the dunes, salt baths in the old boathouse and a kitchen that cooks what the boats bring in.</p>
          <div class="card" data-in>
            <span class="card__col"><span class="card__small">Open all year</span><span class="card__mid">22 rooms</span></span>
            <span class="card__cut" aria-hidden="true"></span>
            <span class="card__col card__col--end"><span class="card__big">4.9</span><span class="card__small">from 1,240 guests</span></span>
          </div>
        </div>
      </section>

      <section class="page" data-page="rooms" aria-label="Rooms" hidden>
        <p class="eyebrow" data-in>Rooms and suites</p>
        <h1 class="title" data-title><span class="line"><span class="w">Rooms on</span></span><span class="line"><span class="w">the <i>water</i></span></span></h1>
        <div class="foot">
          <p class="text" data-in>Limewash walls, linen and oak, a window as wide as the bed and the sea right under it.</p>
          <div class="card" data-in>
            <span class="card__col"><span class="card__small">Dune Suite, 48 m&sup2;</span><span class="card__big">&euro;320<small>/ night</small></span></span>
            <span class="card__tag">3 left in May</span>
          </div>
        </div>
      </section>

      <section class="page" data-page="baths" aria-label="Baths" hidden>
        <p class="eyebrow" data-in>The bathhouse</p>
        <h1 class="title" data-title><span class="line"><span class="w">Salt and</span></span><span class="line"><span class="w">slow <i>steam</i></span></span></h1>
        <div class="foot">
          <p class="text" data-in>A wood sauna over the rocks, a cold plunge fed by the sea and a long salt pool for the evening.</p>
          <div class="card" data-in>
            <span class="card__col"><span class="card__small">Sauna</span><span class="card__big">85&deg;</span></span>
            <span class="card__cut" aria-hidden="true"></span>
            <span class="card__col"><span class="card__small">Cold plunge</span><span class="card__big">6&deg;</span></span>
            <span class="card__cut" aria-hidden="true"></span>
            <span class="card__col"><span class="card__small">Salt pool</span><span class="card__big">34&deg;</span></span>
          </div>
        </div>
      </section>

      <section class="page" data-page="table" aria-label="Table" hidden>
        <p class="eyebrow" data-in>The table</p>
        <h1 class="title" data-title><span class="line"><span class="w">Caught at</span></span><span class="line"><span class="w"><i>dawn</i></span></span></h1>
        <div class="foot">
          <p class="text" data-in>Six courses from the morning boats and the salt garden, around one long table.</p>
          <div class="card" data-in>
            <span class="card__col"><span class="card__small">Tonight, 7.30 pm</span><span class="card__mid">Six courses</span></span>
            <span class="card__cut" aria-hidden="true"></span>
            <span class="card__col card__col--end"><span class="card__big">&euro;95</span><span class="card__small">9 seats left</span></span>
          </div>
        </div>
      </section>
    </div>

    <!-- the three waves: one svg, redrawn at every frame. Each wave has a body, a lit crest and a second, fainter line of
         foam just under it -->
    <svg class="sea" data-sea aria-hidden="true">
      <defs>
        <linearGradient id="shade0" x1="0" y1="0" x2="0" y2="1"><stop offset="0" data-s0></stop><stop offset=".3" data-s1></stop><stop offset="1" data-s2></stop></linearGradient>
        <linearGradient id="shade1" x1="0" y1="0" x2="0" y2="1"><stop offset="0" data-s0></stop><stop offset=".3" data-s1></stop><stop offset="1" data-s2></stop></linearGradient>
        <linearGradient id="shade2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" data-s0></stop><stop offset=".3" data-s1></stop><stop offset="1" data-s2></stop></linearGradient>
      </defs>
      <g class="wave" data-wave><path class="wave__body" fill="url(#shade0)"></path><path class="wave__foam"></path><path class="wave__crest"></path></g>
      <g class="wave" data-wave><path class="wave__body" fill="url(#shade1)"></path><path class="wave__foam"></path><path class="wave__crest"></path></g>
      <g class="wave" data-wave><path class="wave__body" fill="url(#shade2)"></path><path class="wave__foam"></path><path class="wave__crest"></path></g>
    </svg>
    <div class="grain" aria-hidden="true"></div>
    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.5l13 7.2-5.6 1.4-2.8 5.4z"></path></svg>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

76 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 “Three-wave transition” 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 dark petrol background, with a soft light from above like the sky over the water and a fine grain over everything, sits the Stay page of Saltmere. At the top the mark, a half sun over two wave lines drawn with a single stroke, the name in a soft serif and the outlined Book button; in the middle the menu, a frosted glass pill with Stay, Rooms, Baths and Table, and under the item of the page a solid pill with a highlight. In the empty corner a thin tide line drifting slowly, with a tick on its highest point and ‘High tide 14:32’. At the bottom the label, the big title in Fraunces, ‘Set by the tide’, with the last word in italics, a rule that draws itself from the left, a line of text and a glass card with ‘22 rooms’ and the 4.9 rating. The words of the title rise out of their line like a swimmer coming up: from under the edge, a little rotated and thinner, they straighten and gain weight on the wght axis, then make a last little bob of two and a half pixels. A drawn pointer goes to the menu and rests on Rooms: two sand-coloured crests show at the bottom, the sea of the page that is coming. On the click the pill runs to the item on a spring and a highlight passes over it; from the bottom a light sand wave rises, soon a warmer one and then a deep one, each with its crest running a different way, a line of light on the edge and a dotted line of foam under it, and one side arriving before the other. The old page is lifted a little by the water coming up. With the screen covered the page underneath is already the new one: the waves ebb away upwards, the deep one first, with their lower edge waving in turn, and uncover the sand page, ‘Rooms on the water’, with the Dune Suite at 320 euros a night. Then Baths, terracotta, with sauna, cold plunge and salt pool with their degrees; then Table, olive, with the six-course dinner; then Stay again.

How it works

One SVG, three waves, redrawn every frame

A single svg as big as the page, with its viewBox in pixels reset on resize, and three groups: the body of the wave, the crest and the foam. Every wave has two numbers, rise (how far its upper edge has climbed) and ebb (how far its lower edge has); GSAP takes them from 0 to 1 and a single gsap.ticker redraws the paths at every frame.

The running crest

Every edge is a base line plus two sine waves running in opposite ways, one almost as long as the screen and one short, with the ticker time in their phase, and a slope that makes one side arrive before the other. The amplitude follows sin(π·p) to the power 0.7: flat at rest, full halfway. The points, one every 14 pixels, go from Catmull-Rom to cubic curves, so the edge is smooth at any width.

Rise, wait, ebb

The three waves rise in 1.05 s on power3.inOut, 0.16 s apart, in the light, middle and deep tones of the page that is coming. Once the last one has covered everything the new page goes underneath; after 0.12 s they ebb away upwards in reverse order, the deep one first, so each one uncovers the one below and the last one uncovers the page.

Light, foam and shadow

The body has a vertical gradient made in JavaScript (the tone 16 % lighter at the top, 12 % darker at the foot) and a soft drop-shadow that lifts one wave off the other; the crest is a white 1.3 px line at 50 %, the foam a row of dots 7 px below. While the wave ebbs, crest and foam move to its lower edge.

The title that comes up and the sea that shows

Every line of the title is a window with hidden overflow: the words rise from yPercent 112 with 3.5 degrees of rotation and Fraunces's wght axis going from 240 to 340, then a 2.5 px bob. On the menu items, with the mouse, the first two waves of the page under the pointer rise to 7 and 4 %: a preview of the sea that is coming.

Values to change

NameFileDefaultWhat it changes
RISEscript.js1.05The seconds each wave takes to rise and cover the screen.
STAGGERscript.js0.16The seconds between one wave setting off and the next.
HOLDscript.js0.12How long the screen stays covered before the waves ebb away.
EBBscript.js0.95The seconds each wave takes to ebb away upwards.
EBB_STAGGERscript.js0.15The seconds between one wave ebbing and the one below it.
CRESTscript.js0.06How tall the crest of the waves is, as a share of the short side of the screen.
SWELLscript.js1.4How fast the crest runs along the wave.
TILTscript.js0.5How much one side of the wave leads the other (0 means level).
TITLE_DELAYscript.js0.3When the new title rises, as a share of the last wave's ebb.
PEEKscript.js1On the menu items the waves of that page show at the bottom (1 on, 0 off).

Try them in the Playground

When to use it

For the website of a seaside hotel, a spa, a restaurant or a brand with a few pages, each in its own colour: when the page change should feel like water rising and ebbing away, and the colour of the next page should show before the content.

On phones

The same transition with adapted sizes: the Book button and the name hide, the menu items narrow with the screen, the title is sized on width and height, the line and the card stack (in the short preview box only the card stays), the tide line gets smaller. The waves have their crest sized on the short side, so they stay in proportion; no sea preview on hover.

With reduced motion

No rising waves and no words coming up: the first tone of the new page fades in over 0.35 s, the page changes underneath, then it fades out and the content fades in; the pill jumps to its place and the tide line stays still.

Pitfalls

  • With scale or translate the wave would have no living crest: it has to be redrawn, but with one ticker for all three and the points capped at 110, or on a wide screen the path gets too heavy.
  • The margin above and below must be bigger than the crest: at rise 1 the upper edge must be fully off screen even at the lowest point of the wave, or a slit of the old page stays visible.
  • The waves ebb in reverse order: if the light one, which lies underneath, ebbed first, nothing would be seen.
  • The gradient cannot rely on color-mix inside an SVG stop in every browser: the lighter and darker tones are worked out in JavaScript.
  • A new click or the hover preview must kill the tweens on the waves before starting, or two tweens write the same rise.

Libraries

GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.

Testing

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