Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adaptive quality in `BaseEngine`: an EMA of frame time nudges a dpr multiplier (down to 0.55) with cooldown hysteresis so weak GPUs get a softer image instead of dropped frames.
- Richer visuals: deeper offset-lit ocean, wider atmospheric rim with a crisp shell line, 4-layer beams, twin impact rings, 3-pass aurora, warmer city lights.
- Calmer defaults and pacing: rotation 4°/s, activity 2.4/s, meteor frequency 40%, slower/longer-lived meteors and beams.
- Renamed the widget's own branding from "games.directory" to **Orbit** across UI titles, logos and file headers. The embed API global is now `window.__ORBIT_SCENE__` (was `__GD_SCENE__`) and the persisted panel keys are `orbit-scene` / `orbit-scene-open` (was `gd-globe-*`) — a breaking change for existing embeds and saved settings.
- Moved the local-server / usage note off the root chooser page into [`docs/USAGE.md`](docs/USAGE.md).

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion canvas/cinema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — Canvas2D cinematic layers
/* Orbit — Canvas2D cinematic layers
*
* The wow extras: the Moon, the rare comet, constellations, the ocean sun
* glint, the HQ heartbeat and the city-surge marker. Same layer contract as
Expand Down
2 changes: 1 addition & 1 deletion canvas/draw.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — shared Canvas2D draw helpers
/* Orbit — shared Canvas2D draw helpers
*
* Tiny rendering utilities used by both canvas/layers.js (the core layers)
* and canvas/cinema.js (the cinematic extras). Rendering only — no geometry,
Expand Down
2 changes: 1 addition & 1 deletion canvas/engine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — Canvas2D engine
/* Orbit — Canvas2D engine
*
* Thin subclass of BaseEngine (shared/engine.js): all the shared machinery lives
* there; here we only wire the canvas-specific hooks. Each frame clears the
Expand Down
9 changes: 3 additions & 6 deletions canvas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>games.directory · Activity Globe (Canvas)</title>
<title>Orbit · Activity Globe (Canvas)</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand All @@ -18,16 +18,13 @@
<div class="stars stars2"></div>

<div class="stage">
<canvas
id="globe-canvas"
aria-label="Rotating globe of live games.directory activity"
></canvas>
<canvas id="globe-canvas" aria-label="Rotating globe of live activity"></canvas>
</div>

<div class="brand">
<div class="mark">
<div class="glyph">g</div>
<div class="name"><b>games</b>.directory</div>
<div class="name"><b>Orbit</b></div>
</div>
<div class="tag">Live activity · worldwide</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion canvas/layers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — Canvas2D render layers
/* Orbit — Canvas2D render layers
*
* Each layer is { name, z, rebuildOn?, build?, resize?, simulate?, visible?, draw }.
* Layers draw in ascending z. To add an effect, write a factory and add it to
Expand Down
6 changes: 3 additions & 3 deletions canvas/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* games.directory globe — Canvas2D entry point
/* Orbit — Canvas2D entry point
*
* Modes:
* • clean (default) — the production hero: globe + brand + live ticker, no controls.
* • demo (?demo) — adds the FPS meter and the full control / "Scene & effects" panel.
*
* Scene source (all validated against the schema before use):
* • window.__GD_SCENE__ inline embed from the platform (highest priority)
* • window.__ORBIT_SCENE__ inline embed from the platform (highest priority)
* • ?config=<url> fetch the per-deployment config JSON
* • ?demo the demo's own localStorage
* • otherwise schema defaults
Expand Down Expand Up @@ -33,7 +33,7 @@ const data = { HQ, ACTIVITY_TYPES, CITIES, landFeature: null };
const scene = await resolveScene({
demo,
configUrl: params.get('config'),
inline: window.__GD_SCENE__,
inline: window.__ORBIT_SCENE__,
});
const engine = new Engine({ canvas, scene, sim, data });
registerDefaultLayers(engine);
Expand Down
16 changes: 14 additions & 2 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ Orbit runs in two modes, served from a static file server (see
- **Demo** — add `?demo` (`/canvas/?demo`): adds the FPS meter and the full
control + **Scene & effects** panel for tuning. The chooser links here.

The bare `/canvas/` or `/svg/` URL is the clean hero (globe only, no controls);
the `?demo` links add live controls + FPS.

## Running locally

The world map is fetched at runtime, so Orbit needs to be served over HTTP (not
opened as a `file://` path). Any static server works, e.g.:

```
python3 -m http.server 8000 # → http://localhost:8000
```

## Controls

Everything is user-tunable live via the **Scene & effects** panel (in demo mode),
Expand All @@ -25,7 +37,7 @@ cities, and activity types (label / colour / weight). Then embed the clean hero:
```html
<!-- inline config the platform embeds before the globe loads -->
<script>
window.__GD_SCENE__ = { aurora: { intensity: 0.6 } /* …schema fields… */ };
window.__ORBIT_SCENE__ = { aurora: { intensity: 0.6 } /* …schema fields… */ };
</script>
<iframe src="/canvas/" title="Activity globe"></iframe>
```
Expand All @@ -52,7 +64,7 @@ contract with the games.directory platform:

At runtime the scene is resolved by `resolveScene()` in this precedence:

1. **`window.__GD_SCENE__`** — an inline config object the platform embeds;
1. **`window.__ORBIT_SCENE__`** — an inline config object the platform embeds;
2. **`?config=<url>`** — fetched per-deployment config JSON (from your API);
3. **`?demo`** — the demo panel's own `localStorage`;
4. otherwise — schema defaults.
Expand Down
32 changes: 4 additions & 28 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>games.directory · Activity Globe — Canvas vs SVG</title>
<title>Orbit · Activity Globe — Canvas vs SVG</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand Down Expand Up @@ -199,19 +199,6 @@
border: 0;
font-weight: 600;
}
.foot {
font-family: var(--mono);
font-size: 11.5px;
color: var(--muted);
margin-top: 34px;
line-height: 1.7;
}
.foot code {
background: rgba(255, 255, 255, 0.06);
padding: 2px 6px;
border-radius: 5px;
color: var(--ink);
}

/* ---- side-by-side view ---- */
body.compare .wrap {
Expand Down Expand Up @@ -301,8 +288,8 @@
<!-- chooser -->
<main class="wrap">
<div class="brand">
<div class="glyph">g</div>
<div class="name"><b>games</b>.directory · Activity Globe</div>
<div class="glyph">o</div>
<div class="name"><b>Orbit</b> · Activity Globe</div>
</div>
<h1>One globe, <span class="grad">two render engines.</span></h1>
<p class="lede">
Expand Down Expand Up @@ -340,23 +327,12 @@ <h2>SVG</h2>
<button class="btn primary" id="compare">◧ Compare side-by-side</button>
<a class="btn" href="COMPARISON.md">Read the write-up</a>
</div>

<p class="foot">
Needs a static server (the world map is fetched at runtime):
<code>python3 -m http.server 8000</code> → <code>http://localhost:8000</code><br />
The links above open <b>demo mode</b> (<code>?demo</code>) with live controls + FPS. The
bare <code>canvas/</code> or <code>svg/</code> URL is the <b>clean hero</b> — globe only, no
controls.<br />
Customise HQ / cities / activity types in <code>shared/data.js</code>; scene settings come
from the platform (<code>?config=&lt;url&gt;</code> or <code>window.__GD_SCENE__</code>),
bounded by <code>shared/scene-schema.js</code>.
</p>
</main>

<!-- side-by-side -->
<section class="stage">
<div class="bar">
<span class="name"><b>games</b>.directory · side-by-side</span>
<span class="name"><b>Orbit</b> · side-by-side</span>
<span class="spacer"></span>
<a class="btn" href="index.html">← Back to chooser</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions legacy/data.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* games.directory globe — data layer
/* Orbit — data layer
* HQ, activity types, and real-world city coordinates ([lng, lat]).
* Coordinates are accurate; the projection places them precisely on the sphere.
*/

window.GD = window.GD || {};

// games.directory HQ — London, UK
GD.HQ = { name: 'games.directory HQ', city: 'London', lnglat: [-0.1276, 51.5074] };
// Orbit HQ — London, UK
GD.HQ = { name: 'Orbit HQ', city: 'London', lnglat: [-0.1276, 51.5074] };

// Activity types. `color` is the live, user-editable beam colour.
GD.ACTIVITY_TYPES = [
Expand Down
10 changes: 5 additions & 5 deletions legacy/globe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — engine
/* Orbit — engine
* Accurate rotating orthographic globe (D3 geo) with dotted land,
* and great-circle "activity beams" that fire from real city
* coordinates and converge on HQ. Rendered in SVG.
Expand Down Expand Up @@ -60,14 +60,14 @@
};
var scene = Object.assign({}, SCENE_DEFAULTS);
try {
var saved = JSON.parse(localStorage.getItem('gd-globe-scene') || '{}');
var saved = JSON.parse(localStorage.getItem('orbit-scene') || '{}');
Object.keys(saved).forEach(function (k) {
if (k in scene) scene[k] = saved[k];
});
} catch (e) {}
function saveScene() {
try {
localStorage.setItem('gd-globe-scene', JSON.stringify(scene));
localStorage.setItem('orbit-scene', JSON.stringify(scene));
} catch (e) {}
}
var DENSITY_STEP = { sparse: 3.8, med: 3.0, dense: 2.4 };
Expand Down Expand Up @@ -1410,15 +1410,15 @@
else host.setAttribute('hidden', '');
gear.setAttribute('aria-pressed', open ? 'true' : 'false');
try {
localStorage.setItem('gd-globe-scene-open', open ? '1' : '0');
localStorage.setItem('orbit-scene-open', open ? '1' : '0');
} catch (e) {}
}
gear.addEventListener('click', function () {
setOpen(host.hasAttribute('hidden'));
});
var wasOpen = false;
try {
wasOpen = localStorage.getItem('gd-globe-scene-open') === '1';
wasOpen = localStorage.getItem('orbit-scene-open') === '1';
} catch (e) {}
if (wasOpen) setOpen(true);
}
Expand Down
6 changes: 3 additions & 3 deletions legacy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>games.directory · Live Activity Globe</title>
<title>Orbit · Live Activity Globe</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand Down Expand Up @@ -953,7 +953,7 @@
<div class="stars stars2"></div>

<div class="stage">
<svg id="globe-svg" aria-label="Rotating globe of live games.directory activity">
<svg id="globe-svg" aria-label="Rotating globe of live activity">
<defs>
<radialGradient id="sphere-grad" cx="40%" cy="36%" r="75%">
<stop offset="0%" stop-color="#0e1d33" />
Expand Down Expand Up @@ -1033,7 +1033,7 @@
<div class="brand">
<div class="mark">
<div class="glyph">g</div>
<div class="name"><b>games</b>.directory</div>
<div class="name"><b>Orbit</b></div>
</div>
<div class="tag">Live activity · worldwide</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions shared/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — configuration
/* Orbit — configuration
*
* The tunable *scene* settings and their bounds live in scene-schema.js (the
* platform-facing contract). This module derives the runtime defaults from it,
Expand Down Expand Up @@ -33,8 +33,8 @@ export const AURORA_SCHEMES = {
};

export const STORAGE = {
scene: 'gd-globe-scene',
sceneOpen: 'gd-globe-scene-open',
scene: 'orbit-scene',
sceneOpen: 'orbit-scene-open',
};

// ---- demo-mode persistence (localStorage) ------------------------------
Expand Down
4 changes: 2 additions & 2 deletions shared/data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — content layer (shared by both renderers)
/* Orbit — content layer (shared by both renderers)
*
* This is the file to edit to make the globe your own: point HQ at your
* location, list the cities activity should originate from, and define the
Expand All @@ -10,7 +10,7 @@

// Where every beam converges.
export const HQ = {
name: 'games.directory HQ',
name: 'Orbit HQ',
city: 'London',
lnglat: [-0.1276, 51.5074],
};
Expand Down
2 changes: 1 addition & 1 deletion shared/engine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — BaseEngine (shared by both renderers)
/* Orbit — BaseEngine (shared by both renderers)
*
* All the backend-agnostic machinery lives here: the event bus, the ordered
* layer registry, the clock, auto-rotation, the beam-spawn cadence, drag-to-spin
Expand Down
2 changes: 1 addition & 1 deletion shared/fps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — FPS meter overlay (shared)
/* Orbit — FPS meter overlay (shared)
*
* Smoothed frames-per-second plus frame time, so the canvas and SVG builds can
* be compared honestly. Call tick(now) once per rendered frame.
Expand Down
2 changes: 1 addition & 1 deletion shared/geo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — projection & sun (shared by both renderers)
/* Orbit — projection & sun (shared by both renderers)
*
* Wraps d3.geoOrthographic but adds a hand-rolled fast forward-projection for
* the thousands of land dots / spikes that must project every frame. d3's
Expand Down
2 changes: 1 addition & 1 deletion shared/geometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — geometry (shared by both renderers)
/* Orbit — geometry (shared by both renderers)
*
* Pure functions that turn the projection + scene into coordinates. No DOM, no
* canvas, no rendering — each renderer takes these points/arrays and paints them
Expand Down
2 changes: 1 addition & 1 deletion shared/scene-schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — scene SCHEMA (single source of truth)
/* Orbit — scene SCHEMA (single source of truth)
*
* SCENE_SCHEMA is plain, JSON-serialisable data: the complete, bounded set of
* tunable scene settings, grouped into sections. It is the contract between the
Expand Down
2 changes: 1 addition & 1 deletion shared/sim.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — simulation (shared by both renderers)
/* Orbit — simulation (shared by both renderers)
*
* Renderer-agnostic decisions and physics, operating on plain numbers. The
* renderers own the visual objects (canvas data / svg nodes) but defer *what
Expand Down
2 changes: 1 addition & 1 deletion shared/ui.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — shared chrome (backend-agnostic).
/* Orbit — shared chrome (backend-agnostic).
* Renderer-specific styling lives in canvas/canvas.css and svg/scene.css. */
:root {
--bg: #04050b;
Expand Down
2 changes: 1 addition & 1 deletion shared/ui.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — UI wiring (shared by both renderers)
/* Orbit — UI wiring (shared by both renderers)
*
* The panel, activity list and ticker are pure DOM and backend-agnostic: they
* mutate the live `scene` / `sim` / activity-state objects the engine reads,
Expand Down
2 changes: 1 addition & 1 deletion shared/util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — small pure helpers (shared by both renderers) */
/* Orbit — small pure helpers (shared by both renderers) */

export const DEG = Math.PI / 180;
export const TAU = Math.PI * 2;
Expand Down
2 changes: 1 addition & 1 deletion svg/engine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — SVG engine
/* Orbit — SVG engine
*
* Thin subclass of BaseEngine (shared/engine.js). The SVG-specific hooks: nodes
* persist between frames (no clear), so renderFrame() just lets every layer mutate
Expand Down
6 changes: 3 additions & 3 deletions svg/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>games.directory · Activity Globe (SVG)</title>
<title>Orbit · Activity Globe (SVG)</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand All @@ -18,7 +18,7 @@
<div class="stars stars2"></div>

<div class="stage">
<svg id="globe-svg" aria-label="Rotating globe of live games.directory activity">
<svg id="globe-svg" aria-label="Rotating globe of live activity">
<defs>
<radialGradient id="sphere-grad" cx="40%" cy="36%" r="75%">
<stop offset="0%" stop-color="#0e1d33" />
Expand Down Expand Up @@ -98,7 +98,7 @@
<div class="brand">
<div class="mark">
<div class="glyph">g</div>
<div class="name"><b>games</b>.directory</div>
<div class="name"><b>Orbit</b></div>
</div>
<div class="tag">Live activity · worldwide</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion svg/layers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* games.directory globe — SVG render layers
/* Orbit — SVG render layers
*
* Every visual element is a self-contained layer object:
* { name, z, rebuildOn?, build(e), resize?(e), simulate?(e), draw(e) }
Expand Down
Loading