StarGazer

An embeddable night-sky explorer from the Theodore Roosevelt Presidential Library. On a phone or tablet it uses the motion sensors so you can hold the screen up to the sky and see what you are looking at; on a desktop you drag to look around. This page is the live preview and the embed instructions.

The card above is the embed. It detects whether the device has a motion sensor and offers a full-screen Start button either way.

Embed it

One line, anywhere in a page:

<script src="https://stargazer.labs.trlibrary.com/stargazer.js"></script>

The card renders where the script tag sits. To place it somewhere else, add a container and the script anywhere:

<div data-stargazer></div>
<script src="https://stargazer.labs.trlibrary.com/stargazer.js"></script>

Options on the container:

AttributeExampleMeaning
data-lat / data-londata-lat="46.914" data-lon="-103.524"Fix the observer location. Default is Medora; participants can also use their own location from Settings.
data-placedata-place="Elkhorn Ranch"Label shown for a fixed location.
data-no-auto (on the script tag)Do not insert a card automatically; only render into [data-stargazer] containers.

From JavaScript: StarGazer.open() opens the full-screen sky directly (call it from a click so motion permission and full screen are allowed).

What it shows