
The colour columns
Hover, SVG
A city’s sunrise and sunset card, on warm white: a panel of sky with the sun’s dashed arc over the horizon, the sun running along it and the part already done drawn in white. Dragging across the sky moves the hour: the sun runs along the arc and drops below the horizon, the sky goes from the day’s blue to the orange of sunset to the blue of night, the big time changes and a line says how much daylight is left or how long until sunrise. The pill at the top names the moment: morning, golden hour, night. Minimal style.
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>
<!--
"Sunrise and sunset" 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>Sunrise and sunset</title>
<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">
<!-- a sunrise and sunset card: the sun's arc over the horizon, the sun running along it as you drag the hour,
the sky changing colour and a line saying how much daylight is left -->
<section class="ss" data-ss aria-label="Sunrise and sunset">
<header class="ss__head">
<div class="ss__what"><strong>Lisbon</strong><span>Wednesday 2 December</span></div>
<span class="ss__pill"><span class="ss__clip"><span data-outphase>Afternoon</span></span></span>
</header>
<div class="ss__sky" data-sky role="slider" tabindex="0" aria-label="Time of day" aria-valuemin="0" aria-valuemax="24" aria-valuenow="13.67">
<svg class="ss__svg" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true">
<defs>
<clipPath id="ss-above"><rect x="0" y="0" width="320" height="112"></rect></clipPath>
</defs>
<rect data-air x="0" y="0" width="320" height="112"></rect>
<g clip-path="url(#ss-above)">
<path class="ss__arc" d="M40 112A120 84 0 0 1 280 112"></path>
<path class="ss__done" data-done d="M40 112A120 84 0 0 1 280 112" pathLength="1"></path>
</g>
<rect class="ss__ground" data-ground x="0" y="112" width="320" height="38"></rect>
<path class="ss__horizon" d="M0 112h320"></path>
<path class="ss__tick" d="M40 108v8M280 108v8"></path>
<line class="ss__hair" data-hair x1="0" x2="0" y1="0" y2="150"></line>
</svg>
<div class="ss__above" aria-hidden="true"><span class="ss__halo" data-halo></span><span class="ss__sun" data-sun></span></div>
<span class="ss__at ss__at--rise" data-outrise>07:38</span>
<span class="ss__at ss__at--set" data-outset>17:16</span>
</div>
<div class="ss__now">
<p class="ss__time" role="timer"><b data-outtime>13:40</b></p>
<span class="ss__left"><span class="ss__clip ss__clip--left"><span data-outleft>3 h 36 min of daylight left</span></span></span>
</div>
<dl class="ss__facts">
<div><dt>Sunrise</dt><dd data-outrise2>07:38</dd></div>
<div><dt>Sunset</dt><dd data-outset2>17:16</dd></div>
<div><dt>Daylight</dt><dd data-outday>9 h 38 min</dd></div>
</dl>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></svg>
</main>
<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.
23 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Sunrise and sunset” from Animorio and fit it into my siteEverything comes from the hour: the sun’s place, how much arc is drawn, the sky’s colours, the written time, the daylight line and the moment of the day.
By day the fraction between sunrise and sunset becomes an angle on the upper half of an ellipse; by night the sun carries on along the lower half, hidden by the ground.
Ten colours pinned to the hours around sunrise and sunset: between one stop and the next the colour blends. Change the times and the sky follows them.
The sky’s width is the whole day, midnight to midnight: the pointer picks the hour and a short spring takes the number there.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #e8792b | The colour of the low sun and of golden hour. |
RISE | script.js | 7.63 | The time of sunrise, in decimal hours (7.63 = 07:38). |
SET | script.js | 17.27 | The time of sunset, in decimal hours (17.27 = 17:16). |
NOW | script.js | 13.67 | The hour shown at the start. |
LOOP | script.js | true | Left alone, the demo’s pointer takes the sun to sunset, to night and to sunrise. |
In a weather app, on a travel destination page, in the tool of a photographer looking for golden hour, on the page of a holiday home or a mountain hut; the same arc with an hour to drag carries a day’s tide, a plant’s shift, a day’s fast or a solar panel’s battery.
The card is at most 348 pixels wide and about 330 tall. The sky is 150 pixels tall or a third of the screen, whichever is less, and narrows with the card; with a finger the hour moves by dragging sideways, and the page still scrolls vertically.
The sun appears already at the current hour, without climbing from sunrise; when dragging, sun, sky and texts jump to the chosen hour with no spring, and the pill changes in one step. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.
Tested on 2 December 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.
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.