
The colour columns
Hover, SVG
The day’s UV index on a card: a sun travels along the curve of the hours and takes the figure, the level, the colour and the advice with it; moving over the chart picks the hour, and the bar on the axis marks the hours when protection is needed.
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>
<!--
"Daily UV index" 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>Daily UV index</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">
<!-- the day's UV index: a sun travels along the curve of the hours, the figure, the level and the advice
follow it, and the bar on the axis marks the hours in which protection is needed -->
<section class="uv" data-uv aria-label="UV index today">
<header class="uv__head">
<span class="uv__title">UV index</span>
<span class="uv__place">Cala Brisa, <span data-time>12:00</span></span>
</header>
<p class="uv__read" aria-live="polite">
<b class="uv__num" data-num>0</b>
<span class="uv__level"><span data-level></span></span>
</p>
<svg class="uv__chart" data-chart viewBox="0 0 300 128" role="img" aria-label="UV index through the day">
<defs>
<linearGradient id="uv-fill" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="currentColor" stop-opacity="0.26"></stop>
<stop offset="1" stop-color="currentColor" stop-opacity="0"></stop>
</linearGradient>
<clipPath id="uv-past"><rect data-past x="0" y="0" width="0" height="128"></rect></clipPath>
</defs>
<line class="uv__three" data-three x1="12" x2="288" y1="78" y2="78"></line>
<path class="uv__area" data-area fill="url(#uv-fill)" clip-path="url(#uv-past)"></path>
<path class="uv__curve uv__curve--day" data-day pathLength="1"></path>
<path class="uv__curve uv__curve--past" data-curve clip-path="url(#uv-past)"></path>
<line class="uv__hair" data-hair x1="0" x2="0" y1="6" y2="100"></line>
<line class="uv__base" x1="12" x2="288" y1="100" y2="100"></line>
<g data-ticks></g>
<line class="uv__protect" data-protect x1="0" x2="0" y1="108.5" y2="108.5"></line>
<g class="uv__sun" data-sun>
<circle class="uv__halo" data-halo r="12"></circle>
<g data-rays></g>
<circle class="uv__core" r="5"></circle>
</g>
</svg>
<footer class="uv__foot">
<span class="uv__advice"><span data-advice></span></span>
<span class="uv__window" data-window></span>
</footer>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.
15 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 “Daily UV index” from Animorio and fit it into my siteEverything comes from the hour: the index is a bell function between sunrise and sunset, and from it come the sun’s position, the width of the clip that uncovers the solid curve and the area, the figure’s weight on the wght axis, the length of the rays.
When the rounded index changes level, a CSS variable takes the new colour: figure, curve, sun, bar and the light inside the card read it and blend with a transition. Name and advice roll in the direction of the change.
The sun is an SVG group drawn around zero: its position goes into the group’s transform attribute, the slow turn of the rays into the inner group’s, so the rotation is always about its centre.
| Name | File | Default | What it changes |
|---|---|---|---|
PEAK | script.js | 9 | The day’s highest UV index, at midday. |
NOW | script.js | 16.5 | The present time, in decimal hours (16.5 = 16:30). |
SUNRISE | script.js | 6.6 | The time of sunrise. |
SUNSET | script.js | 20.4 | The time of sunset. |
GLIDE | script.js | 0.9 | How many seconds the sun takes to go back to the present hour. |
LOOP | script.js | true | Left alone, a pointer travels through the day. |
In a weather app, on the site of a beach club, a seaside hotel or a mountain hut, on a sunscreen’s page; and wherever a value changes through the day and is read at a given hour: the tide, the energy price, how busy a place is.
The same card: a finger on the chart picks the hour (the page still scrolls vertically) and shortly after lifting it the sun goes back to now. The figure and the chart shrink with the window’s height.
No curve drawing, spinning or rolling: the sun already sits on the present hour and, moving over the chart, figure, level and advice change at once.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.4 KB; the libraries: GSAP 28 KB.
Tested on 18 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.