Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultScrollTotal Eclipse on Scroll
Image Slide TabsBrowse all 182Strip Grow Transition
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Total Eclipse on Scroll

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap
  • ScrollTrigger
  • CustomEase

Setup

npm i gsapregisterPlugin(ScrollTrigger, CustomEase)

More like this

  • Pinned
  • Section transition
  • Glow
  • ScrollTrigger
  • Sticky
  • Canvas
  • WebGL

Features.

  • A grainy, moving Sun thins to a crescent as an unseen Moon bites into it
  • The page falls through a warm dusk instead of fading to grey
  • The last sliver breaks into beads along the Moon's rough edge
  • Corona streamers, stars, two planets and a sunset all round the horizon
  • The Moon grows to hold the dark section's heading, then the light floods back as a huge crescent
  • Corona and stars lean towards the mouse
  • One raw WebGL shader: no three.js, no images
  • Falls back to a plain fade to dark if WebGL is missing or the context is lost
  • Respects prefers-reduced-motion: the sky follows the scroll, nothing drifts, copy appears at once

How to get it right.

Keep the three scenes in order

"before", "after", then "night". The script puts its canvas just before the night scene, so the shader paints over the day scenes and the dark copy sits on top.

Keep the dark copy short

It sits inside the Moon. The script sets --tot-moon-size to the Moon's radius and the copy is capped at 1.7× that. A heading and a line is about the limit on a phone.

Move the planets with CSS

Each .tot_planet is an empty marker; the shader lights a point at its top left corner. Set top and left to move one, or delete a marker to drop its planet.

Leave room to scroll

The track is 600vh. Change --tot-length for a slower or faster pass; the legs keep their shares.

Variations.

  • Still Sun and corona — data-au-drift="0"
  • Bigger or smaller Sun — data-au-size="1.3" or "0.7"; the Moon follows
  • Quieter or brighter corona — data-au-corona="0.5" or "1.6"
  • No stars or planets — data-au-stars="false"
  • Locked to the scroll — data-au-scrub="0"
  • Your palette — override --tot-brand, --tot-soft, --tot-red, --tot-sky and --tot-moon on the root, then call refresh()
  • A second line — add another <span class="tot_mask"><span class="tot_line" data-tot-line>…</span></span> to a title; lines follow 0.08s apart
  • A sentence or a button — add it to the "night" or "after" scene with data-tot-fade
  • A live readout — put <span data-tot-covered></span> anywhere in the root for the covered share of the Sun (0–100), and <span data-tot-clock></span> for a running clock; wrap them in [data-tot-hud] to fade them out as the light returns. --tot-covered and --tot-night on the root (0–1) can drive a gauge and the ink colour

Where it fits.

  • Landing pages — the turn from a hero into a darker feature section and back
  • Launch pages — a dark reveal with one line in the middle
  • Stories and case studies — a chapter break

Frequently asked.

No. The script talks to WebGL directly; GSAP, ScrollTrigger and CustomEase are all it loads.

The canvas is hidden and the dark section fades in and out as a flat colour. The copy and the section swap work the same.

The Moon is invisible by day, as it is in a real eclipse: it only cuts the Sun away. It turns dark as the sky does.

No. The Sun moves all the time, so the shader draws every frame, but only while the stage is on screen.

The script reads the shader colours once. Change the variables, then call window.au.Totality.refresh().

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll