
Ridge line background
Backgrounds, WebGL, Hover
A hand-written WebGL animated background for the hero of an invented mountain hut, Hollin Hut: a real sky made with simple scattering of the air, blue overhead and orange and pink near the horizon, soft noise clouds drifting very slowly and lit from below, the low sun above a far ridge in the haze. The pointer moves the sun a little along the horizon, down behind the ridge, and the light of the whole sky follows it; at the bottom a small dial tells the time, the bearing and whether it is golden hour, sunset or afterglow.
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>
<!--
"Sunset sky 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>Hollin Hut</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/fraunces@5.3.0/full-italic.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/inter-tight@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- the hero of a mountain hut at sunset. A hand-written WebGL shader draws a real sky: simple single scattering
(blue overhead, orange and rose toward the horizon), soft noise clouds drifting very slowly and lit from below,
a far ridge in the haze. The pointer moves the sun a little along the horizon and the light of the whole sky
follows it -->
<section class="stage" data-stage>
<canvas class="sky" aria-hidden="true" data-canvas></canvas>
<div class="fallback" aria-hidden="true"></div>
<header class="bar" data-in>
<span class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
<path d="M3 17.5l6.2-8 3.6 4.4 2.4-2.8 5.8 6.4"/><path d="M2.5 20.5h19" opacity=".5"/>
</svg>
Hollin Hut
</span>
<nav class="nav">
<a class="nav__link nav__link--wide" href="#">The hut</a>
<a class="nav__link nav__link--wide" href="#">Getting here</a>
<a class="nav__link nav__link--pill" href="#" data-pill><span class="pill__face">Book a bed</span></a>
</nav>
</header>
<div class="hero">
<h1 class="title" data-title><span class="title__line">Stay up for</span> <span class="title__line"><em>the last light.</em></span></h1>
<p class="lede" data-in>A stone hut above the tree line, twelve beds and dinner when the sky goes pink.</p>
</div>
<footer class="dial" data-in aria-hidden="true">
<div class="dial__track" data-track>
<span class="dial__ticks"></span>
<span class="dial__sun" data-sunmark>
<svg viewBox="0 0 22 12"><path class="dial__disc" d="M4 11a7 7 0 0 1 14 0"/><path class="dial__line" d="M0 11h22"/></svg>
</span>
</div>
<p class="dial__read">
<span class="dial__phase" data-phase>Golden hour</span>
<span class="dial__time" data-time>17:31</span>
<span class="dial__bearing" data-bearing>WSW 244</span>
</p>
</footer>
<p class="hint" data-in>Move the pointer to walk the sun along the ridge</p>
</section>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
30 values to change
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 “Sunset sky background” from Animorio and fit it into my siteThe background is a hand-written WebGL shader on a single triangle covering the canvas: sky, sun, clouds, ridges and grain. No images and no 3D libraries. Every pixel becomes a viewing direction, with a height above the horizon and an azimuth, as in a camera with a field of about fifty degrees.
The colour of the sky comes from physics in miniature: the air takes away the blue far more than the red (Rayleigh) and the haze takes away everything in grey (Mie). The light of the low sun crosses a lot of air and arrives orange; looking toward the horizon you look through a lot of air and the sky is warm, looking up through little and the sky stays blue. The glow around the sun is the Mie phase, which throws the light forward.
The clouds lie on a plane above us, seen in perspective (one over the sine of the height), and are a fractal noise bent by another noise. For the light the noise is read one step closer to the sun: where the cloud thins toward the sun that side faces it and lights up, orange in front of the sun and pink further away.
The pointer gives a number from 0 to 1 along the path of the sun: on the left it is a hand above the ridge, on the right it has already set behind it. The sun catches up on a heavy damped spring, so the sky never jumps; the dial at the bottom has a lighter spring with a pixel of overshoot, and the phase changes with a small blurred fade.
| Name | File | Default | What it changes |
|---|---|---|---|
START | script.js | 0.32 | Where the sun is when the page opens: 0 high on the left, 1 set on the right. |
SPAN | script.js | 1 | How far along the horizon the pointer can move the sun. |
CLOUDS | script.js | 1 | How much of the sky the clouds cover (0 = clear sky). |
DRIFT | script.js | 1 | How fast the clouds drift. |
GLOW | script.js | 1 | How bright the light of the sun on the sky and on the clouds is. |
HAZE | script.js | 1 | How thick the haze on the horizon is. |
GRAIN | script.js | 0.03 | How strong the grain is. |
SPEED | script.js | 1 | 2 = the loop on its own twice as fast, 0.5 = half. |
LOOP | script.js | true | Repeats the loop on its own. |
As the background of the first screen of a mountain hut, a hotel in the mountains or by the sea, a holiday home, a travel or hiking app, an event at sunset: wherever the warm evening light is wanted instead of a photo, moving with the viewer. The colours are --zenith, --sunlight, --rose, --cloud and --land in the CSS.
The same animations at adapted sizes: the heading is measured on width and height, The hut and Getting here links go and the pill stays, the hint at the bottom right disappears under 900 pixels, the path of the sun narrows to the width of the screen. With a finger the sun follows the gesture.
The sky stays still at sunset, with the sun just above the ridge, and fades in; the pointer does not move the sun and the pill changes its label without motion.
GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Inter Tight (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 11 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.