ephemeris 0.9.3 · celestial stipple

Ephemeris

Scalable animated representations of amazing things in the sky, drawn as dots!! No dependencies, one script. Ten kinds of body and forty‑two named ones, from the Milky Way to Halley's comet. Colour them with six CSS variables, or run them monochrome.

Playground

click a body below, or pick one

Every control writes the tag on the right. Copy it, paste it, done. Colours only appear in the tag once you change one; everything else is the body's own default.

six css variables, read live

Named bodies

data-orb-body

Recognisable objects, each a mode plus the options and palette that make it that thing. Click one to load it into the playground. Any data attribute still overrides the body's own settings, and the six CSS variables still recolour it.

Solar system

The Sun
sunspots, granulation, corona
Mercury
cratered, lit from the side
Venus
cream clouds, faint bands, spins backwards
Earth
oceans, land, ice, clouds
The Moon
maria, craters, phases
Earth and Moon
the pair, moon on a 14 s orbit
Mars
rust and polar caps
Jupiter
belts and the red spot
Jupiter and the Galilean moons
Io, Europa, Ganymede, Callisto
Saturn
rings and the Cassini gap
Uranus
rings on edge, teal
Neptune
the dark spot, cloud streaks
Pluto
tan, maroon, and the heart
The Solar System
eight planets, the belt, Saturn's ring
Totality
the moon crosses, diamond ring

Comets

Halley
blue ion tail, dust tail
Hale-Bopp
two-tone tails
NEOWISE
golden, fast

Stars

Sirius A/B
white pair, gas stream
Albireo
gold and blue pair
Crab Pulsar
30 turns a second, slowed
Vela Pulsar
slower, wide tilt, violet
SN 1987A
shell out, remnant, again
Cassiopeia A
teal and red, slower

Black holes

Gargantua
Interstellar, ember disk
M87*
the EHT orange ring

Nebulae

Orion Nebula
pink emission nebula
Crab Nebula
filaments, one pulsar inside
Pillars of Creation
Hubble palette, three columns
Carina Nebula
six clouds, six stars

Galaxies

Milky Way
four arms, a barred bulge
Andromeda
two arms, tilted, golden core
Triangulum
M33, loose flocculent spiral
Large Magellanic Cloud
irregular, a bar and a stub arm
Whirlpool
M51, face-on grand design
Pinwheel
M101, face-on, knotted arms
Southern Pinwheel
M83, three arms off a bar
Bode's
M81, warm gold core
Sombrero
M104, edge-on
NGC 1300
the classic barred spiral
Cartwheel
a ring, spokes, a small nucleus
Cigar
M82, edge-on, plumes off the core

Pulsar

mode pulsar · state pinging

A neutron star as a lighthouse: dense spinning core, two beams on a magnetic axis tilted off the spin, dipole field lines riding along. When a beam sweeps the camera the whole thing flares.

pulsar · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
lite
data-orb-lite=1 · half the dots
space
data-orb-space=1
slow, wide tilt
data-orb-spin=1.4 · data-orb-tilt=1.1

Galaxy

mode galaxy · state swirling

A spiral at a tilt: logarithmic arms, a bright flattened bulge, dust scatter, bright knots, the pattern turning slowly. data-orb-arms picks the count: 4 is the Milky Way, 2 is a grand-design like M51. Wide canvases give it more room.

galaxy · 160
4 arms · milky way
88
colour
64
the preset
20
inline
2 arms
data-orb-arms=2
ink
data-orb-ink=1
space
data-orb-space=1
wide
160×88

Nebula

mode nebula · state dreaming

An emission nebula: overlapping gas clouds as soft dots drifting on a slow noise field, stretched into wisps, lit from inside by a few young stars with faint diffraction spikes. Each cloud swirls slowly about its own centre while the whole field drifts; data-orb-spin scales it. data-orb-clouds and data-orb-stars set the counts.

nebula · 160
5 clouds · orion
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
one star
data-orb-clouds=3 · data-orb-stars=1
space
data-orb-space=1
wide
160×88

Black hole

mode blackhole · state pondering

Interstellar's Gargantua. Edge-on accretion disk on Keplerian orbits, far side lensed over the top and under the bottom, photon ring, Doppler-bright on the approaching side. Height sets the shadow, width sets how far the disk reaches (up to 6.5 shadow radii on a 2:1 canvas).

blackhole · 320×160
wide, disk to 6.5 Rs
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
lite
data-orb-lite=1
space
data-orb-space=1
wide + space
160×88 · flags stack

Comet

mode comet · state rushing

Nucleus down-left, two tails streaming up-right away from an off-canvas sun: a broad curved dust tail and a narrow, faster, flickering ion tail. Particles are born at the nucleus and age out. data-orb-spin scales the flow.

comet · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
lite
data-orb-lite=1
space
data-orb-space=1
wide
160×88 · longer tail

Saturn

mode saturn · state orbiting

A banded globe with three ring bands and the Cassini gap, tilted about 24°, rings on Keplerian speeds. Back-side ring dots hide behind the planet and dim in its shadow. data-orb-tilt for the ring angle, data-orb-spin for rotation. data-orb-surface swaps the bands for moon, earth or mars; data-orb-phase (0 full, 0.5 new, or cycle) lights it from the side.

saturn · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
rings on edge
data-orb-tilt=1.35
space
data-orb-space=1
jupiter
data-orb-body=jupiter · no rings, a spot
Moon · 160
phases every 12 s

Supernova

mode supernova · state erupting

A star collapses, blows a shell outward, and the shell fades into a filamentary remnant while the core rebuilds. Loops every data-orb-period seconds, default 6.

supernova · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
fast
data-orb-period=3
space
data-orb-space=1
lite
data-orb-lite=1

Binary

mode binary · state pairing

Two stars round a barycentre on a tilted orbit, a hot primary and a cooler secondary, with a stream of gas pulled off the secondary curling into the primary. Faint orbit trails. data-orb-spin sets the period.

binary · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1
slow
data-orb-spin=0.4
space
data-orb-space=1
sirius
data-orb-body=sirius · white pair

Eclipse

mode eclipse · state aligning

A dotted sun with a corona of streamers; the moon crosses it every data-orb-period seconds, default 10. The corona only shows near totality, with prominences at the limb and a diamond ring either side.

eclipse · 160
colour
88
colour
64
the preset
20
inline
ink
data-orb-ink=1 · the moon is absence
fast
data-orb-period=5
space
data-orb-space=1
lite
data-orb-lite=1

Theme it

6 css variables

Set any --orb-* custom property on the canvas or an ancestor. Read every frame, so a theme switch or a hover rule applies live. Each mode has its own defaults; set one variable and the rest keep the mode's default. Ink ignores them.

pulsar · ember
the black hole's colours
galaxy · jade
cold #0A7A5A · glow #20B48A
blackhole · orchid
cold #B0186E · glow #E040A0
pulsar · silver
cold #6A6A6A · glow #9A9A9A
canvas.orb {
  --orb-cold:   #1E56D8;   /* far / receding / outer   */
  --orb-mid:    #7FB0FF;   /* mid                      */
  --orb-hot:    #EAF3FF;   /* near / approaching / core */
  --orb-glow:   #3D7BFF;   /* halo + haze              */
  --orb-ring:   #F2F8FF;   /* photon ring (blackhole)  */
  --orb-shadow: #000000;   /* the hole (blackhole)     */
}

Use it. One script, then any canvas with class orb. Height is the preset, width lets a mode stretch. Everything else is a data attribute.

<script src="src/ephemeris.js"></script>

<canvas class=orb width=64 height=64 data-orb-mode=pulsar></canvas>
<canvas class=orb width=64 height=64 data-orb-state=swirling></canvas>
<canvas class=orb width=128 height=64 data-orb-mode=blackhole
        data-orb-lite=1 data-orb-space=1></canvas>

// added later? wire them up
Ephemeris.register(someRoot);
  • data-orb-body milky-way · andromeda · orion · saturn · halley … (42, grouped above)
  • data-orb-mode blackhole · pulsar · galaxy · nebula · comet · saturn · supernova · binary · eclipse · orrery, or the matching data-orb-state
  • data-orb-ink=1 monochrome dots that follow the page theme
  • data-orb-lite=1 half the particles · data-orb-space=1 dark ground with stars
  • data-orb-arms · data-orb-clouds, data-orb-stars · data-orb-spin, data-orb-tilt · data-orb-period · data-orb-surface, data-orb-phase

Or drive it yourself. Every mode is a plain function, (ctx, size, t, dark, opts), so it drops into an existing orb engine too.

Ephemeris.draw('galaxy', ctx, 64, t, dark, {
  arms: 2, lite: true,
  palette: { cold:[10,122,90], mid:[95,216,176], hot:[232,255,246],
             glow:[32,180,138], ring:[255,255,255], shadow:[0,0,0] }
});

// into an engine with the same signature
Orbs.MODE_DRAWS.pulsar = Ephemeris.MODES.pulsar.draw;
Orbs.STATE_TO_MODE.pinging = 'pulsar';
  • Paused off-screen and on hidden tabs; DPR capped at 2
  • Reduced motion draws one still frame, repainted on theme change
  • Dot size follows the engine's (size/300)^0.6; counts follow size