Dynamic Sky

A living atmosphere for the web. Scrub the day. Ship it in one script.

Time desk
12:00 AM
12:00 AM
12:00 AM11:59 PM

One library. Multiple ways to use.

Embed

Product chrome

Drop the sky into a product surface. Scrub time inside the frame.

Studio
Embedded sky
06:00 PMSky time
06:00 PM
12:00 AM11:59 PM
Compare

Four cities

Locations stay pinned. One scrub moves time across all four skies.

San Francisco37.77N, 122.41W
New York40.71N, 74.01W
Tokyo35.68N, 139.69E
London51.51N, 0.13W
10:00 AM
12:00 AM11:59 PM
By location

Travel

Time stays pinned. Change the place and the atmosphere follows.

New York
Time pinned
40.71N, 74.01W
04:00 PMPinned time

Install

One script from jsDelivr. Two containers. The sky handles the rest.

Scattering Starfield Location Time API Embed
<script src="https://cdn.jsdelivr.net/gh/aakaashjois/dynamic-sky@main/dynamic-sky.js"></script>
<div id="background-sky"></div>
<div id="stars-container"></div>
<script>
  const sky = new DynamicSky();
  sky.init();
</script>

Reference

Code snippets

Short patterns for containers, time, location, and live clocks.

Custom container

const sky = new DynamicSky({
  skyContainer: '#my-sky',
  starsContainer: '#my-stars',
  latitude: 40.7128,
  longitude: -74.0060
});
sky.init();

Programmatic control

const sky = new DynamicSky();
sky.init().then(() => {
  sky.updateSky(sky.minutesToDate(720));
});

Dynamic location

const sky = new DynamicSky();
sky.init().then(() => {
  sky.setLocation(35.6762, 139.6503);
  sky.updateSky(new Date());
});

Auto-updating

const sky = new DynamicSky();
sky.init().then(() => {
  const tick = () => sky.updateSky(new Date());
  tick();
  setInterval(tick, 60000);
});