Star Field Parallax
Stars at three depths, the near ones travelling faster.
The canvas in this preview is the file shown here. The surrounding demo shell only provides context and is not part of the copied code.
import { useEffect, useRef } from "react";
/**
* Vibary · Star Field Parallax
*
* Stars at three depths, the near ones travelling faster. The technique
* is the discreteness: three clearly separated planes rather than a
* smooth spread of speeds. Give every star its own random speed and theAbout this effect
A slow travelling sky for a night mode, a sleep timer, or a screen that is on but resting. What makes it read as depth is that the planes are discrete: three groups, each with its own speed, size and brightness, rather than a smooth spread of random speeds — a continuous spread reads as noise sliding about, while three separations resolve instantly. Only the nearest plane twinkles, for the same reason: twinkle applied to every star is just flicker. Stars take the inherited text color by default, so the field survives a theme flip instead of disappearing on a light page.