Theodore Roosevelt Presidential Library Labs

TRPL Labs  /  Embeddable Widget

Embeddable Widget

StarGazer

Hold your phone up to the sky and it names the stars above you.

Screenshot of StarGazer

Try it right here

This loads the live project from its own domain, exactly as a visitor would see it.

What it does

An embeddable night-sky explorer that uses phone motion sensors to identify constellations, planets, and bright stars overhead, with drag-to-look on a desktop. It is built for dark-sky places: a dim palette, an extra-dimming slider, and a red-light mode that preserves night vision.

All of the astronomy is computed on the device, so a single script tag turns any page into a working planetarium with no API keys and no server. Planet positions land within 0.3 degrees of the JPL reference ephemeris.

One thing to read before forking: the Indigenous star knowledge included in the repo is drawn from published sources and every entry is labeled as awaiting tribal partner review. The README is explicit that it should not be reused as-is.

What it can do

  • About 5,000 stars to magnitude 6, all 88 constellations with lines, boundaries, and stories
  • Device-orientation sky pointing with compass-offset correction; drag and pinch on desktop
  • Sun, Moon phase, and Mercury through Neptune from Keplerian elements
  • 85 constellation figures pinned to their stars by three-star affine fit
  • See-through mode showing the rear camera behind a transparent chart — never uploaded
  • Tonight panel with sunset, full dark, moonrise, and eclipses, plus a live aurora estimate

Make it your own

Start by forking the repository into your own organization. Everything below assumes you are working in your fork, not this one.

# clone your fork git clone https://github.com/YOUR-ORG/StarGazer.git cd StarGazer
  1. Fork, install numpy, and run the two build scripts. The three built files are not committed — the deploy workflow produces them.
  2. Set your own location defaults on the embed tag with data-lat, data-lon, and data-place.
  3. Edit the plain JSON content files for constellation paragraphs, dated sky events, meteor showers, and figures. No widget code changes needed.
  4. Replace the wordmark and the brand font and color references.
  5. Move the deploy workflow into place, set Pages source to GitHub Actions, edit CNAME, and add the DNS record. Motion sensors require HTTPS, which Pages provides.
  6. Do not reuse the Indigenous star-knowledge content without your own tribal partner review.

Stuck on a step? Open an issue on the repository. Questions from people adapting these for their own institution are the most useful feedback we get.