mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Move satellites, launches and the sky with the world time
Layers whose data has a time of its own follow the page's world clock from the start; live feeds such as flights, military, vessels and transit stay live. Launches register the span of the launches loaded, so turning them on brings up the timeline. Each timed layer registers its coverage once and reports none while off, telling the clock after each step has settled. The launch feed keeps its own window, and an orbit ring is drawn again once the world time has moved far from when it was drawn.
This commit is contained in:
1 parent
690a6637e2
commit
3534398771
14 files changed
+123
-45
No files matched your search
@@ -55,6 +55,24 @@ test('away from live only following layers move with the cursor', () => {
|
||||
assert.equal(satellites(), t.wall);
|
||||
});
|
||||
|
||||
test('layers named at creation follow from the start', () => {
|
||||
const t = fakeTime();
|
||||
const clock = createWorldClock({ ...t.options, follow: ['satellites'] });
|
||||
clock.seek(t.wall - 1_000);
|
||||
assert.equal(clock.timeFor('satellites')(), t.wall - 1_000);
|
||||
assert.equal(clock.timeFor('flights')(), t.wall);
|
||||
clock.follow('satellites', false);
|
||||
assert.equal(clock.follows('satellites'), false);
|
||||
});
|
||||
|
||||
test('the page clock moves the layers with a time of their own', async () => {
|
||||
const { worldClock } = await import('./worldClock.js');
|
||||
for (const id of ['sky', 'satellites', 'rocket-launches'])
|
||||
assert.equal(worldClock.follows(id), true, id);
|
||||
for (const id of ['flights', 'military', 'vessels', 'transit'])
|
||||
assert.equal(worldClock.follows(id), false, id);
|
||||
});
|
||||
|
||||
test('continuous play advances the cursor at the rate and pause holds it', () => {
|
||||
const t = fakeTime();
|
||||
const clock = createWorldClock(t.options);
|
||||
|
||||
Reference in new issue
Block a user