An interactive 3D starfield animation built with HTML5 Canvas and vanilla JavaScript. Features a rotating perspective view with wiggling colorful stars moving through 3D space in a dark cosmic environment, enhanced with dynamic color shifting.
requestAnimationFrame
for optimal performanceSimply open index.html
in a web browser. The animation starts automatically and fills the entire viewport.
You can adjust various parameters in constants.js
:
NUM_STARS
: Number of stars (default: 800)MIN_STAR_SIZE
/ MAX_STAR_SIZE
: Star size rangeMIN_SPEED
/ MAX_SPEED
: Star movement speed rangePERSPECTIVE_FACTOR
: Controls depth effect intensityROTATION_SPEED
: How fast the starfield rotatesBG_COLOR
: Background color (dark space theme)WIGGLE_AMPLITUDE
: How far stars wiggle from their base positionWIGGLE_FREQUENCY
: How fast the wiggle oscillatesWIGGLE_PHASE_VARIATION
: Creates different wiggle patterns for each starHUE_SHIFT_SPEED
: How fast the hue shifts (degrees per frame)index.html
: Main HTML structureindex.js
: Animation controllerrenderer.js
: Canvas rendering logicstar.js
: Star generation and propertiesconstants.js
: Configuration parametersstyles.css
: Basic styling for full-screen display