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
VaultScrollSolar Eclipse on Scroll
Navbar Dock LoaderBrowse all 182Curved Horizon on Scroll
  • 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

Solar 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 Moon slides across an orange Sun as you scroll and the page darkens with it
  • A bead flares on the last sliver of Sun, then the corona and stars come out
  • The Moon grows to hold the dark section's heading, then moves off and the light returns
  • The Sun climbs to the top edge of the next day section and leaves a wide glow
  • The corona drifts on its own and leans 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 --ecl-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.

Mark what should animate

A line with data-ecl-line inside an .ecl_mask rises in. Anything else with data-ecl-fade fades up 16px after the lines. Unmarked content just sits in its scene.

Leave room to scroll

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

Variations.

  • Still 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 — data-au-stars="false"
  • Locked to the scroll — data-au-scrub="0"
  • Your palette — override --ecl-brand, --ecl-soft, --ecl-red, --ecl-sky and --ecl-moon on the root, then call refresh()
  • A second line — add another <span class="ecl_mask"><span class="ecl_line" data-ecl-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-ecl-fade

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 script reads the shader colours once. Change the variables, then call window.au.Eclipse.refresh().

No. The corona only redraws while it shows and the stage is on screen; otherwise frames are painted only when the scroll moves.

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll