Paste an interactive star viewer into a static page or CMS block, then choose
display options with HTML attributes.
Learning goal
This first lesson starts with the no-JavaScript embed. You add one viewer
<div>, one optional status element, and one module script.
The viewer already knows how to show stars, respond to drag and keyboard input,
resize with the page, draw constellation layers, and write a small loading
readout.
Live code
Small SkyKit star browser
Edit the HTML attributes, then run it. The preview opens in a sandboxed iframe.
Ready.
Console
Things to try
Change the viewer height from 500px to 700px.
Add data-skykit-magnitude="7".
Add data-skykit-speed="4".
Add data-skykit-exposure="2600".
Add data-skykit-look-at="05h 36m 12.81s, −01° 12′ 06.9″" to start facing Alnilam in Orion's belt.
Try data-skykit-mouse-mode="strafe" for the first-person drag direction, or grab to pull the sky around.
Add data-skykit-constellations="western" to draw constellation boundaries.
Add data-skykit-constellation-art="lazy" to load constellation artwork only when it is needed.
Remove the <pre> and data-skykit-status attribute to make a clean decorative embed.
The viewer is marked with data-skykit-browser. The embed script finds
that element and creates the default SkyKit star viewer there. The status attribute
is optional; it points at a normal HTML element where the viewer can write a small
loading/status readout.
The important point: the beginner embed owns the plumbing. You do not create a
renderer, camera, data source, star drawing layer, animation loop, resize handler,
or cleanup handler in your first SkyKit page.
Source and next steps
Next, get the browser handle.
This first example is intentionally tiny. Once the viewer is on the page, the next
step is to ask SkyKit for the live browser object and move the view with a script.