Random Space Facts

Will Kennedy's personal portfolio. This is earlier work, made before Highland Willow. It is not Highland Willow client work.

Random Space Facts is an interactive webpage that displays a new fact about our universe, planets, and the broader cosmos every time the user taps, clicks, or interacts with the screen. The content panel sits above a fully dynamic p5.js “gravity ripple” starfield that responds to touch or mouse input, creating an immersive space-themed background on both desktop and mobile devices.

Users can trigger fact changes by tapping or clicking anywhere on the screen. Touching and holding activates a gravity well that pulls nearby stars toward the interaction point. Releasing triggers a ripple effect that gently pushes the starfield outward. The experience scales automatically to any screen size.

Key Features

  • Randomized Space Facts: Each interaction updates the display with one of dozens of curated facts about planets, stars, and the broader universe.
  • Interactive Gravity Field: Clicking, tapping, or touching creates a temporary gravity point that pulls stars toward your finger or cursor.
  • Ripple Release Effect: Lifting your finger or releasing the mouse produces an expanding ripple that subtly pushes stars away.
  • Shooting Stars: Procedurally generated meteor streaks appear occasionally, adding depth and movement to the background.
  • Mobile-Optimized: The interface detects mobile devices and adjusts star density and interaction handling automatically.
  • Responsive Scaling: The p5.js canvas resizes with the browser window to maintain full-screen coverage.
  • Blurred Glass UI Panel: The text container uses a translucent, blurred “glassmorphism” style to stay readable over the animated starfield.

How It Works

  • Change the Fact: Tap or click anywhere to generate a new random space fact.
  • Create Gravity: Hold your finger or mouse button to pull nearby stars toward the interaction point.
  • Release to Ripple: Let go to produce an expanding ripple that briefly disturbs the starfield.
  • Background Animation: Shooting stars, drifting stars, and ambient motion continue automatically in the background.

All code demos