Skip to content
animorio
IT
Back to the library

Constellation headline

Text, ScrollCanvas, GSAP, CSS onlyAdvancedCompressed weight: Demo 14 KBGSAP 28 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The opening of an astronomy app, on a photographic night sky we made on a canvas: thousands of stars with their real colours and a soft bloom, the Milky Way as a cloud with its dark dust, the glow of the horizon and the grain. Scrolling, the letters of the headline ‘See the sky the way it was’ light up one by one like stars, and a thin constellation line joins each to the nearest lit letter; the sky turns slowly around the pole star leaving trails behind the brightest stars, and at the end a glass card with Saturn, visible at 23:40, rises from 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>
<!--
  "Constellation headline" 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 observatory headline that lights up into a constellation</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/opsz.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 opening of a made-up observatory app, Kestrel. A night sky photographed by us on a canvas: thousands of stars
       with their real colours and a soft bloom, the Milky Way as a soft cloud with its dust lanes, the glow of the
       horizon and a veil of grain. Scrolling, the letters of the headline light up one by one like stars and a thin
       constellation line joins each new one to the nearest lit letter; the sky turns slowly around Polaris, the
       brightest stars leave a trail, and a glass card with tonight's sighting rises from the bottom. -->
  <main>
    <section class="hero" data-hero>
      <div class="stage" data-stage>
        <canvas class="sky" data-sky aria-hidden="true"></canvas>
        <div class="grain" aria-hidden="true"></div>
        <div class="vignette" aria-hidden="true"></div>

        <div class="polaris" data-polaris aria-hidden="true">
          <svg class="polaris__ring" viewBox="0 0 40 40"><circle cx="20" cy="20" r="17"/></svg>
          <span class="polaris__name">Polaris</span>
        </div>

        <header class="nav" data-nav>
          <a class="brand" href="#">
            <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
              <circle cx="12" cy="12" r="10.25"/>
              <path d="M4.2 15.6a8.6 8.6 0 0 1 15.6 0"/>
              <path d="M12 5.4v2.4M12 5.4l1.1 1.1M12 5.4l-1.1 1.1"/>
            </svg>
            <span>Kestrel</span>
          </a>
          <nav class="nav__links" aria-label="Main">
            <a href="#">Tonight</a>
            <a href="#">Sky atlas</a>
            <a href="#">Archive</a>
          </nav>
          <a class="pill" href="#"><span>Open the app</span></a>
        </header>

        <div class="copy" data-copy>
          <p class="eyebrow" data-eyebrow>Kestrel Ridge Observatory</p>
          <h1 class="title" data-title aria-label="See the sky the way it was">
            <span class="title__line">See the sky</span>
            <span class="title__line">the way it was</span>
          </h1>
          <p class="lede" data-lede>Every night above the ridge since 1912, rewound to the minute.</p>
          <svg class="links" data-links aria-hidden="true"></svg>
        </div>

        <p class="hint" data-hint>
          <svg class="hint__arrow" data-arrow viewBox="0 0 12 16" aria-hidden="true"><path d="M6 1v13M1.5 9.5 6 14l4.5-4.5"/></svg>
          <span>Scroll to light the sky</span>
        </p>

        <div class="dock" data-dock>
          <article class="card" data-card>
            <span class="card__sheen" data-sheen aria-hidden="true"></span>
            <div class="card__main">
              <svg class="planet" viewBox="0 0 48 48" aria-hidden="true" data-in>
                <defs>
                  <linearGradient id="pl-body" x1="0" y1="0" x2="1" y2="1">
                    <stop offset="0" stop-color="#f4e2bd"/>
                    <stop offset=".55" stop-color="#c9a571"/>
                    <stop offset="1" stop-color="#5e4528"/>
                  </linearGradient>
                  <linearGradient id="pl-ring" x1="0" y1="0" x2="1" y2="0">
                    <stop offset="0" stop-color="#e9dcc1" stop-opacity=".25"/>
                    <stop offset=".35" stop-color="#f3e7cf" stop-opacity=".95"/>
                    <stop offset="1" stop-color="#9c8562" stop-opacity=".5"/>
                  </linearGradient>
                  <clipPath id="pl-front"><rect x="0" y="24" width="48" height="24"/></clipPath>
                </defs>
                <ellipse cx="24" cy="24" rx="21" ry="6.2" transform="rotate(-16 24 24)" fill="none" stroke="url(#pl-ring)" stroke-width="2.6" opacity=".55"/>
                <circle cx="24" cy="24" r="10.5" fill="url(#pl-body)"/>
                <path d="M14.6 21.4c6 1.3 12.8 1.3 18.8 0M14 25.6c6.4 1.4 13.6 1.4 20 0" stroke="#7d5f3a" stroke-opacity=".35" stroke-width=".8" fill="none"/>
                <g clip-path="url(#pl-front)" transform="rotate(-16 24 24)">
                  <ellipse cx="24" cy="24" rx="21" ry="6.2" fill="none" stroke="url(#pl-ring)" stroke-width="2.6"/>
                </g>
              </svg>
              <div class="card__text">
                <p class="card__label" data-in>Visible tonight</p>
                <p class="card__title" data-in>Saturn<span class="card__comma">,</span> <b class="card__time" data-time>23:40</b></p>
                <p class="card__meta" data-in>Rises in the southeast, highest after midnight</p>
              </div>
            </div>
            <svg class="chart" data-chart viewBox="0 0 220 86" aria-hidden="true">
              <defs>
                <linearGradient id="ch-fill" x1="0" y1="0" x2="0" y2="1">
                  <stop offset="0" stop-color="#cfdcff" stop-opacity=".18"/>
                  <stop offset="1" stop-color="#cfdcff" stop-opacity="0"/>
                </linearGradient>
              </defs>
              <path class="chart__fill" data-fill d="M10 66 C 50 66, 70 14, 110 14 S 170 66, 210 66 Z" fill="url(#ch-fill)"/>
              <line class="chart__horizon" x1="4" y1="66.5" x2="216" y2="66.5"/>
              <path class="chart__arc" data-arc d="M10 66 C 50 66, 70 14, 110 14 S 170 66, 210 66"/>
              <line class="chart__now" data-now x1="88" y1="66.5" x2="88" y2="20"/>
              <g class="chart__mark" data-mark transform="translate(88 20.5)">
                <circle r="5.5" class="chart__mark-halo"/>
                <circle r="2.6" class="chart__mark-dot"/>
              </g>
              <text class="chart__tick" x="10" y="82">20:00</text>
              <text class="chart__tick chart__tick--now" x="88" y="82" text-anchor="middle">23:40</text>
              <text class="chart__tick" x="210" y="82" text-anchor="end">05:10</text>
            </svg>
            <ul class="stats">
              <li data-in><span>Altitude</span><b>38&deg;</b></li>
              <li data-in><span>Magnitude</span><b>0.8</b></li>
              <li data-in><span>Seeing</span><b>Steady</b></li>
            </ul>
          </article>
        </div>
      </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/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.

47 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 “Constellation headline” 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

The first screen of Kestrel opens, the made-up app of an observatory on a ridge: at the top the mark with the dome, ‘Tonight’, ‘Sky atlas’, ‘Archive’ and the glass ‘Open the app’ pill; in the middle the ‘Kestrel Ridge Observatory’ label, the headline ‘See the sky the way it was’ with its letters still dark, and a line telling the story. Behind is a night sky that looks like a photograph: it develops slowly on arrival, with thousands of stars of different colours (blue, white, yellow, orange), the brightest with the soft bloom of a lens and a faint twinkle that grows near the horizon, the Milky Way across the diagonal like a cloud, warm in the middle and cool at the edges, crossed by dark dust and a few pinkish glows, the sky getting lighter towards the horizon and a moving grain. Top right, a dashed ring marks the pole star. Scrolling, a constellation line leaves the nearest lit letter and reaches the new one, which lights up like a star: a flash of light, a small four-pointed star opening with a bounce, then settling. Letter after letter the headline becomes a drawn constellation. Meanwhile the whole sky turns around Polaris and the brightest stars leave the trails of a long exposure, which grow longer with the scroll. At the end a frosted glass card rises from the bottom on a spring, slightly tilted: ‘Visible tonight’, Saturn drawn with its ring, the time rolling from 20:00 to 23:40, altitude, magnitude and seeing, and beside them the planet's curve across the night sky drawing itself up to the 23:40 mark; a reflection slides over the glass and the light inside the card follows the pointer.

How it works

A still stage and a long scroll

The section is 380vh tall and holds a sticky stage 100vh tall (100lvh where available): everything happens there, driven by the share of the page scrolled, damped every frame so it follows the scroll with a slight delay. Lenis makes the scrolling smooth.

The sky photographed on a canvas

The stars live in polar coordinates around Polaris (radius and angle), with mostly faint brightness and a few strong ones, and a colour taken from five temperatures. Each is drawn with a ready-made sprite, a sharp core and a soft bloom. The Milky Way is a small canvas painted with hundreds of soft blobs along a curved band, with the dust cut out in filaments, and it is drawn large: the stretch softens it like a lens.

The rotation and the trails

Every frame the sky turns around Polaris by an angle made of the scroll plus a slow drift over time: the stars add the angle, the Milky Way only needs a rotation of the context. The brightest stars draw an arc behind them, as long as the scroll's rotation, in four fading strokes: the long exposure.

The letters become stars

The headline is split into letters. Each letter gets a point inside its shape and the nearest lit letter among those before it: so the constellation grows like a tree, not a line. The scroll first carries the line from the old point to the new one, then lights the letter: colour, a text-shadow glow, the small star with a back.out and a flash that fades in 1.5 seconds.

The glass card

When the scroll passes 70% a GSAP timeline starts: the card rises with back.out and a slight perspective tilt, the lines arrive staggered, the time rolls, the curve draws itself with stroke-dashoffset, the 23:40 mark opens and a reflection crosses the glass. Scrolling back the timeline reverses, faster. If needed, the headline rises just enough not to sit under the card.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole sequence takes: 2 is twice as long.
TURNscript.js26How many degrees the sky turns around Polaris over the whole scroll.
DRIFTscript.js0.12Degrees per second the sky turns on its own.
STARSscript.js1How many stars there are.
MILKYscript.js1How bright the Milky Way is.
TRAILSscript.js0.6How visible the star trails are (0 = none).
TWINKLEscript.js1How much the bright stars twinkle.
GLOWscript.js1How much a lit letter glows.
LINEscript.js0.6How visible the constellation line is.
CARD_ATscript.js0.7At what share of the scroll the card rises.
POLE_Xscript.js0.8Where Polaris sits, as a share of the width.
POLE_Yscript.js0.15Where Polaris sits, as a share of the height.

Try them in the Playground

When to use it

As the opening of an astronomy or night-sky app, an observatory, a planetarium, a science museum, a mountain hut or a campsite under a dark sky, a stargazing event or a brand that lives at night. The colours are in :root (--night, --star, --line, --accent), the text is in the HTML headline.

On phones

The same animations at adapted sizes: the headline is measured on width and height, the sky is redrawn to the screen with stars in proportion to its area, the bar keeps the mark and the pill, the card drops the curve and keeps the planet, the time and the three figures; on short screens the line under the headline and the scroll hint disappear.

With reduced motion

The sky is still and does not twinkle, with no trails; scrolling, the letters, the small stars and the lines fade in, already in place, and the card fades in with the curve already drawn. The headline is already where it belongs.

Pitfalls

  • A canvas as large as the rotating sky, at double density, costs millions of pixels: the stars are drawn live with a sprite (they stay sharp at any density), and only the Milky Way, which is soft, lives in a small canvas drawn large.
  • Milky Way dust made with round blobs looks like holes: it has to be cut in long filaments, many small blobs in a row along a winding curve.
  • If the letters change weight as they light up, the headline widens and the constellation lines no longer land on the letters: lighting up only changes colour, glow and a scale that does not push the neighbours.
  • A CSS transition on the pill's transform chases what GSAP writes on arrival and leaves it out of place: the press goes on the inner span.

Libraries

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

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

Testing

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