Stories: GEV scenes as stories on the live globe

A Stories button (top right) opens Explore: a feed of GEV scenes over
GEV's own Cesium globe, with a pin per story. Explore opens at country
level over the first story and, while idle, flies on from story to story
for a minute. A picked story is framed in the middle of the view; a pin
plays its story on a second click. The Story page plays the scene through
SceneDirector with a timeline, chapters, key moments, sources and
background, then Close (or Back) puts the person's camera, clock, layers,
style and AUTHORING selection back. Open in GEV hands the scene to the
Scenes panel at its current shot.

Stories lists the scenes GEV ships with a camera path (while they are in
the project), the scenes saved with SAVE TO STORIES in AUTHORING, and the
person's other scenes as drafts. The person's own stories live in the
project on this device, so they have no Share; a link to a story that is
not here opens Explore and says so. Each shipped story's
context comes from what GEV knows: what it shows, the place each shot goes,
and each layer's data sources as DATA_SOURCES.md lists them; the Nepal
story carries the event pack's facts and CC BY-NC sources. Card images are
a captured THUMBNAIL or drawn from the keyless Esri World Imagery.

AUTHORING has no scene picker: it starts with no scene, NEW SCENE (or
CAPTURE SHOT) makes one, and Stories' Open in GEV selects one. Before SAVE
TO STORIES it offers topic tags and THUMBNAIL. A scene's stories flag,
storyThumb and storyTags are saved with the project and kept through
export and import.

Only the closed state loads with the page; the screens, styles, story data
and controller load on first open. Stories keeps its place in the query
(one history entry per screen) and holds the share link's hash writes
while open. Keyboard input and voice tools stay with Stories while it is
open. Explore's pins move on every drawn frame without asking for frames;
the idle tour and tile settling are bounded.

All strings are translated in the 13 locales.
This commit is contained in:
Manjunath committed 2026-11-16 20:12:10 +05:30
1 parent da81cf743b
commit 5418438339
77 files changed
+14975 -260

No files matched your search

+154 -8
View File
@@ -658,6 +658,106 @@ owner (open state, filters, the rows they show, Remove all) and the text
helpers the view renders, so every label follows the locale. Only the modal
open/close and focus moves are imperative.
## Stories — November 13, 2026
A Stories button (top right, `#hStories`) opens Explore: a feed of stories
over GEV's own Cesium globe with their pins, then a Story screen with a
timeline, chapters and context. Every GEV page loads only what the
closed state needs: the boot shell (`src/stories/boot.js`), the store,
`StoriesView.vue` with the Stories button, first-visit popup and
back-to-story toast, and their styles (`stories-entry.css`). The screens
(`ExploreScreen.vue`, `StoryScreen.vue` and their parts), their styles
(`stories.css`), the story data (`storyMeta.js`, `catalog.js`) and the
controller are separate chunks fetched together on first open, on a
`?stories=` / `?story=` link, or on Back or Forward into Stories; a failed
fetch is reported and the next attempt tries again. Stories keeps its place
in the query, not the share-state hash, with one history entry per screen;
Close steps back over those entries, so Back afterwards does not reopen it,
and share links carry only the Stories place (`stories` / `story`), not the
sender's camera, layers or other settings. GEV's share link keeps
`history.state` when it rewrites the hash, so Stories' entries survive.
Every story is a GEV scene, played on the person's own Cesium globe through
`SceneDirector`, with its labels, embedded media, A/B imagery split (marked
`data-globe-overlay`) and data-pack cards kept while the rest of GEV is
hidden. Explore lists the scenes the person saved to Stories from AUTHORING
first (`SceneDirector.storyScenes()`, refreshed on every `stories-changed`),
then the person's other scenes with a shot as drafts
(`SceneDirector.draftScenes()`, marked DRAFT), then the
scenes GEV ships with a camera path while they are in the project
(`SceneDirector.hasScene`). A saved scene brings the card image and topics
picked for it in AUTHORING; the topic chips use AUTHORING's tag names and
order. Explore opens at country level
(2,500 km) over the first story and, while idle, flies on to the next story
every few seconds, for a minute after the last touch (never with a story
picked or with reduced motion). A picked story's place is framed in the
middle of the view at an angle. After each landing the globe keeps drawing
only until its tiles have loaded (at most 10 s). Each story's pin, in the
world overlay's label style (`src/overlays/worldOverlayTokens.js`), is placed
from Cesium's own projection on every drawn frame, written straight to the
pin's transform, and hidden behind the globe; the pins ask for no frames of
their own. Card images are drawn from the keyless Esri World Imagery tiles
around the story's place (`src/stories/thumbs.js`) unless the scene has its
own; with any other base imagery the card shows its placeholder, and a card
drawn from Esri earlier is dropped. A shot
tied to an anchor rather than a place pins the whole-globe view.
A shipped story's context comes from what GEV knows about it
(`src/stories/catalog.js`): what it shows, the place each shot goes, and,
for each layer it turns on, what the layer shows and the data sources
DATA_SOURCES.md lists for it. The Nepal story carries the event pack's own
facts and sources (Vantor imagery and the GeoPera reconstruction, CC BY-NC
4.0), and its key moments are the chapters that show them. Topic chips and
region choices are the ones the listed stories carry. Closing Stories after
a story played puts AUTHORING's own selection back (usually none);
Open in GEV leaves the story's scene selected there.
Opening Stories claims the camera through the shared navigation policy, so
orbit, a tracked contact or a flight end, and Cockpit refuses with the
policy's own toast ("Exit cockpit to open Stories"). Those owners are not
started again on Close: the camera and clock come back, a follow or orbit
does not. While Stories is open it owns the keyboard (`src/stories/keyboard.js`):
a key pressed in Stories stops at its root, and a key pressed anywhere else
stops at the window, so none of GEV's document-level shortcuts act behind it,
except on a playing GEV scene's own on-globe controls (`data-globe-overlay`);
the capture-phase listeners (hold Space to talk, a surface's Tab trap, the
wildlife card's Escape) check `body.stories-mode` themselves. Voice tool calls
are refused while `stories-mode` is set ("Close Stories first").
The address bar names only the story while Stories is open: the share link
holds its hash writes (`ShareLinkManager.holdWrites`, which first writes a
change still waiting for its debounce, so the view Stories saves is current).
Close works in this order. Stories' screens go and GEV is back on screen, but
`stories-mode` (keyboard guard, voice refusal) stays. The director is waited
on until idle (`SceneDirector.whenIdle`: no run and no pending LOAD, seek or
interaction; at most 15 s). The camera and clock are put back, unless a
camera owner took over during the wait (a drag on the globe, a layer's
focus). History steps back over Stories' entries; once that lands (or after
2 s if it never does), the saved share state is re-applied directly
(`ShareLinkManager.restore`, since the share link skips a hash it already
knows) and the share link writes the live view again. Back out of Stories
re-applies it the same way, and Back to Explore from a story re-applies it
once the scene has torn down, with the address still naming only Stories.
"Open in GEV" (GEV scene stories only) closes the
same way but keeps the place and look: nothing is put back, the scene and its
current shot are selected (`SceneDirector.selectShot`) and the Scenes panel
opens for authoring; Back then goes to the page before Stories. A Close or
open made while a traversal is landing runs once it has landed; a second Back
to Explore is ignored. Reopening Stories while a closed GEV scene is still
tearing down keeps the view from before Stories as the one Close restores.
Inside an inline embed Stories is not offered: the URL and history are the
host's.
The Stories button sits left of whatever holds GEV's top-right corner: the
ACTIVE STYLE readout, or GEV Hosted's account avatar. The first-visit popup
is a labelled region that does not take focus. The story page's rail offers
Open in GEV and Share only. A scene of the person's own (saved or draft)
shows as theirs ("You") and has no Share: the project lives on this device,
so a link to it would open nothing elsewhere; a link to a story that is not
here opens Explore and says so. GEV's own credit line stays on screen throughout, inside the
Stories map while a scene plays (`creditPlacement` in
`src/stories/format.js`).
## Utilities panel — October 29, 2026
UTILITIES is its own left-side panel, between Data Layers and Scenes, with
@@ -1271,7 +1371,7 @@ Native `<select>` controls declare a dark colour scheme and explicit option
colours, so the browser-painted option list matches the panel it drops out of.
The scheme is declared on the controls rather than on the document root, so
hand-tuned scrollbar and text-input skins are unchanged. Applies to the HUD
layout, Authoring, CCTV camera, Radio filter and Draw colour menus.
layout, CCTV camera, Radio filter and Draw colour menus.
Vessel snapshot completeness is separate from freshness. A current snapshot with
rejected or duplicate records shows PARTIAL with accepted/received counts; stale
@@ -2158,14 +2258,60 @@ native double-click rename. Replacing rows revokes their old listeners. Disposal
late file and failed-action completions cannot update removed presentation.
The panel is titled Authoring and is laid out in four labelled steps: SCENE
(picker on its own row, NEW SCENE, DELETE), SHOTS (+ CAPTURE SHOT, UPDATE SHOT,
the numbered shot list and a select/rename hint), PREVIEW (PLAY, STOP, NEXT) and
SAVE & SHARE (EXPORT, IMPORT, RUN LOG, then the EDIT DETAILS / SHARE SCENE row).
(the name of the scene being edited, read-only on its own row, or "No scene
yet"; then NEW SCENE and DELETE), SHOTS (+ CAPTURE SHOT, UPDATE SHOT, the
numbered shot list and a select/rename hint), PREVIEW (PLAY, STOP, NEXT) and
SAVE & SHARE (a row of Stories tag chips; the thumbnail preview, CAPTURE
THUMBNAIL and SAVE TO STORIES on one row; then EXPORT, IMPORT, RUN LOG, then
the EDIT DETAILS / SHARE SCENE row). There is no scene picker, and on load no
scene is selected: the panel reads "No scene yet" with an empty shot list. The
built-in scenes stay in the project, where Stories plays them, but are never
selected on their own. A scene becomes current through NEW SCENE, through
CAPTURE SHOT with no scene (which asks for a name as NEW SCENE does, creates
the scene and captures into it; the director's `captureShot()` names it
"Scene N" itself), or when it is selected elsewhere (Stories' "Open in GEV"
calls `SceneDirector.selectShot`), and the name follows that selection.
Deleting the current scene goes back to no scene. An IMPORT keeps the scene
being edited when the file still has it, else selects the file's first scene
that is not a built-in one, else none. Playback still moves the selection to
the shot it plays, as before.
SAVE TO STORIES marks the scene as published to the Stories page and then reads
REMOVE FROM STORIES, which clears the mark; the status line confirms either.
The mark is the scene's `stories: true` field, saved with the project and kept
through reload, EXPORT and IMPORT; projects without it load unchanged. The
director's `setSceneInStories(sceneId, on)` sets or clears it (refusing a scene
without shots) and `storyScenes()` lists the marked scenes that have shots, in
project order, as `{ id, title, camera, shotCount, thumb, tags }` with the
first shot's camera. Every change to that list (the mark, a scene or its last
shot deleted, a shot captured into a marked scene or its first shot updated, a
marked scene's thumbnail or tags changed, an import) publishes
`stories-changed`.
Deleting a marked scene's last shot clears its mark.
THUMBNAIL keeps the globe as it is drawn now as the scene's Stories
card image: it requests a render and reads the Cesium canvas inside that
frame's `postRender` (the WebGL canvas does not preserve its drawing buffer),
centre-crops it to 16:9, scales it to 320 × 180 and stores a JPEG data URL
(quality 0.82, lowered only if the image would pass the limit) as the scene's
`storyThumb`, shown as a 64 × 36 preview beside the button; the status line
reads "Thumbnail captured". The tag chips (Floods, Wildfires, Storms,
Earthquakes, Flights, Maritime, Space, Conflict, Infrastructure, Climate,
from `STORY_TAGS` in `src/scenes/storyTags.js`, shown translated) are toggle
buttons with `aria-pressed`; a scene keeps up to five as `storyTags` (English
keys), and once it has five the other chips are disabled. Both fields are
optional and validated by the scene document (`storyThumb` a base64 JPEG or
PNG data URL of at most 300,000 characters, the one text allowed past the
usual 65,536 characters; `storyTags` up to five different keys from `STORY_TAGS`), and
are kept through save, reload, EXPORT, IMPORT and the shared scene JSON. Share
links never carry scene documents, so neither reaches a URL. `storyScenes()`
reports them as `thumb` (`''` when none was captured) and `tags`.
Every button in the step rows has a tooltip, and the status line is a polite
live region. Outside playback a button that would do nothing is disabled:
DELETE and CAPTURE SHOT without a scene, UPDATE SHOT without a selected shot,
PLAY and NEXT when no scene in the project has a shot (both continue into the
following scenes). During playback the authoring and file actions stay disabled
DELETE, THUMBNAIL, the tag chips and SAVE TO STORIES without a scene,
UPDATE SHOT without a selected shot, SAVE TO STORIES when the scene has no
shots, PLAY and NEXT without a scene or when no scene in the project has a shot
(both continue into the following scenes), EDIT DETAILS without a selected shot
and SHARE SCENE without a scene. EXPORT stays available, since it writes the
whole project. During playback the authoring and file actions stay disabled
and STOP is enabled, as before; RUN LOG follows the last run, and EDIT DETAILS /
SHARE SCENE keep their own checks. PLAY uses the `scene|PLAY` catalog entry,
apart from the radio's PLAY.
@@ -8925,7 +9071,7 @@ when their footprints touch or contain one another, never across a seam toleranc
### Shared native dropdowns and numeric fields
- Scene and CCTV selects share the default `gev-field` surface. HUD layout
- CCTV selects use the default `gev-field` surface. HUD layout
retains compact density; Draw's colour is a row of swatches, not a select. Radio filter, tuner gain and FM frequency
use the same base while retaining their feature-specific skins and layout.
- The CCTV inline number editor is rendered by its pose chip component with
+1 -1
View File
@@ -155,7 +155,7 @@ a feature supplying only its accent.
keep their imperative entry points until their owners are components:
the rail cards and card blocks (`src/ui/rail/`) render through
Vue's synchronous `render()` behind `createRailCards()` and
`createRailCardBlocks()`. Order: Scenes (done: `SceneOptions` and
`createRailCardBlocks()`. Order: Scenes (done: the scene name and
`SceneShotList` over the `gev-scenes` store; the panel's buttons, status
line, progress bar and the runtime chip render the panel SceneControls
presents there, and the buttons and file chooser call its actions), Weather (done: the owner
+1
View File
@@ -39,6 +39,7 @@
<div class="gev-view" data-gev-view="provider-settings"></div>
<!-- Intelligence HUD Overlay -->
<div class="gev-view" data-gev-view="intel-hud"></div>
<div id="gev-stories-host" class="gev-view" data-gev-view="stories"></div>
<!-- Loading screen -->
<div id="loading-screen">
+27
View File
@@ -320,6 +320,9 @@
"src/ui/scenes.js",
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/scenes/storyThumb.test.mjs",
"src/scenes/storyThumb.js",
"src/scenes/storyTags.js",
"src/ui/sceneControls.test.mjs",
"scripts/qa-scene-controls.mjs",
"scripts/qa-action-buttons.mjs",
@@ -1318,6 +1321,30 @@
"src/ui/stores/owners.test.mjs",
"src/ui/stores/panels.test.mjs",
"src/ui/stores/status.js",
"src/stories/catalog.js",
"src/stories/format.js",
"src/stories/gevLogo.js",
"src/stories/storyMeta.js",
"src/stories/thumbs.js",
"src/stories/thumbs.test.mjs",
"src/stories/controller.js",
"src/stories/gevPlayer.js",
"src/stories/gevPlayer.test.mjs",
"src/stories/boot.js",
"src/stories/keyboard.js",
"src/stories/keyboard.test.mjs",
"src/stories/boot.test.mjs",
"src/stories/controller.test.mjs",
"src/ui/storiesCredit.test.mjs",
"src/ui/styles/stories.css",
"src/ui/styles/stories-entry.css",
"src/ui/views/stories/ExploreScreen.vue",
"src/ui/views/stories/StoriesHeader.vue",
"src/ui/views/stories/StoryContext.vue",
"src/ui/views/stories/StoryRail.vue",
"src/ui/views/stories/StoryScreen.vue",
"src/ui/views/stories/StoryTimeline.vue",
"src/ui/stores/stories.js",
"src/ui/statusChipsView.test.mjs",
"src/ui/statusChipOwners.test.mjs",
"src/ui/toast.js",
+42 -9
View File
@@ -77,6 +77,19 @@
"src/app/application.js",
"src/ui/vueRuntime.js",
"src/ui/views/index.js",
"src/ui/views/StoriesView.vue",
"src/ui/views/stories/StoryContext.vue",
"src/ui/views/stories/StoriesHeader.vue",
"src/ui/views/stories/ExploreScreen.vue",
"src/ui/views/stories/StoryScreen.vue",
"src/ui/views/stories/StoryRail.vue",
"src/ui/views/stories/StoryTimeline.vue",
"src/ui/stores/stories.js",
"src/ui/styles/stories.css",
"src/stories/format.js",
"src/stories/keyboard.js",
"src/stories/storyMeta.js",
"src/stories/gevLogo.js",
"src/ui/views/CockpitView.vue",
"src/ui/views/panels/CockpitProgress.vue",
"src/cockpitProgress.js",
@@ -123,7 +136,6 @@
"src/ui/views/ProviderSettingsView.vue",
"src/ui/views/SceneChromeView.vue",
"src/ui/views/WelcomeView.vue",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/stores/scenes.js",
"src/ui/scenePresentation.js",
@@ -236,7 +248,8 @@
"src/ui/kit/UiIcon.vue",
"src/ui/stores/worldTime.js",
"src/ui/views/panels/WorldTimeline.vue",
"src/ui/surfaceKeyboard.js"
"src/ui/surfaceKeyboard.js",
"src/scenes/storyTags.js"
],
"external": ["vue", "pinia", "vue-i18n"]
},
@@ -1212,7 +1225,6 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/i18n/index.js",
"src/i18n/locale.js",
@@ -1416,7 +1428,6 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/scenes.js",
"src/ui/shareFollow.js",
@@ -1655,7 +1666,9 @@
"src/director/sharing/preview.js",
"src/i18n/marker.js",
"src/director/sharing/lifetime.js",
"src/director/authoring.js"
"src/director/authoring.js",
"src/scenes/storyTags.js",
"src/scenes/storyThumb.js"
],
"external": []
},
@@ -1714,7 +1727,6 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/contextModePolicy.js",
"src/director/clock.js",
@@ -1786,7 +1798,9 @@
"src/render/cesium/zoomOutGuard.js",
"src/render/cesium/sceneOcclusionProbe.js",
"src/render/occlusion/depthProbe.js",
"src/data/detectionOcclusion.js"
"src/data/detectionOcclusion.js",
"src/scenes/storyTags.js",
"src/scenes/storyThumb.js"
],
"external": ["cesium", "vue", "pinia", "vue-i18n", "kdbush"]
},
@@ -4116,6 +4130,24 @@
"src/render/cesium/applicationViewer.js",
"src/render/cesium/ctrlWheelZoom.js",
"src/render/cesium/starrySky.js",
"src/stories/catalog.js",
"src/stories/format.js",
"src/stories/keyboard.js",
"src/stories/storyMeta.js",
"src/stories/gevLogo.js",
"src/stories/boot.js",
"src/stories/controller.js",
"src/stories/gevPlayer.js",
"src/stories/thumbs.js",
"src/ui/views/StoriesView.vue",
"src/ui/views/stories/StoryContext.vue",
"src/ui/views/stories/StoriesHeader.vue",
"src/ui/views/stories/ExploreScreen.vue",
"src/ui/views/stories/StoryScreen.vue",
"src/ui/views/stories/StoryRail.vue",
"src/ui/views/stories/StoryTimeline.vue",
"src/ui/stores/stories.js",
"src/ui/styles/stories.css",
"src/sky/stars.js",
"src/app/atmosphereCompat.js",
"src/bloom.js",
@@ -4664,7 +4696,6 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/scenes.js",
"src/ui/shareFollow.js",
@@ -5366,7 +5397,9 @@
"src/layers/flights/placed.js",
"src/data/placementProvider.js",
"src/data/courseFromFixes.js",
"src/time/frameWait.js"
"src/time/frameWait.js",
"src/scenes/storyTags.js",
"src/scenes/storyThumb.js"
],
"external": [
"hls.js",
+19 -67
View File
@@ -36,7 +36,6 @@ try {
);
const inventory = await page.evaluate(() => {
const selects = [
'scene-select',
'cctv-camera-select',
'hud-layout-select',
'radio-filter',
@@ -45,7 +44,7 @@ try {
return {
ids: selects.map((node) => node.id),
shared:
selects.length === 5 &&
selects.length === 4 &&
selects.every((node) => node.classList.contains('gev-field')),
native: selects.every(
(node) =>
@@ -57,7 +56,7 @@ try {
};
});
check(
'all five panel dropdowns retain native select semantics and shared surface',
'all four panel dropdowns retain native select semantics and shared surface',
inventory.shared && inventory.native,
inventory,
);
@@ -76,12 +75,6 @@ try {
persist: false,
syncShare: false,
});
window.__qaFormChanges = [];
document
.getElementById('scene-select')
.addEventListener('change', (event) =>
window.__qaFormChanges.push(event.target.value),
);
});
const ownerSetup = await page.evaluate(() => {
const owner = window.__godsEyeView.styleManager._cctvControls;
@@ -176,7 +169,7 @@ try {
window.__qaFormCalls = [];
document.getElementById('cctv-camera-select').disabled = true;
});
await page.focus('#scene-select');
await page.focus('#hud-layout-select');
await page.focus('#cctv-camera-select');
check(
'disabled native selects cannot receive keyboard focus',
@@ -288,7 +281,7 @@ try {
for (const width of [1440, 620, 390]) {
await page.setViewport({ width, height: 900 });
const layout = await page.evaluate(() => {
const ids = ['scene-select', 'cctv-camera-select', 'hud-layout-select'];
const ids = ['cctv-camera-select', 'hud-layout-select'];
return ids.map((id) => {
const node = document.getElementById(id),
rect = node.getBoundingClientRect(),
@@ -317,7 +310,7 @@ try {
document.documentElement.dataset.uiTheme = 'cyber';
});
const cyber = await page.$eval(
'#scene-select',
'#cctv-camera-select',
(node) => getComputedStyle(node).backgroundColor,
);
check(
@@ -340,62 +333,23 @@ try {
window.__qaFormCalls.length === 2,
),
);
// Scene selection can restore application settings. Exercise it after the
// fixture-owned CCTV phase so those asynchronous effects cannot replace ports.
page.once('dialog', (dialog) => dialog.accept('Baseline selection fixture'));
await page.click('#scene-new-btn');
await page.waitForFunction(() =>
[...document.querySelectorAll('#scene-select option')].some(
(option) => option.textContent === 'Baseline selection fixture',
),
);
// Authoring has no scene picker: NEW SCENE selects the scene it creates and
// the panel names it. Exercise it after the fixture-owned CCTV phase.
page.once('dialog', (dialog) => dialog.accept('QA selection fixture'));
await page.click('#scene-new-btn');
await page.waitForFunction(
() => document.querySelectorAll('#scene-select option').length > 1,
() =>
document.getElementById('scene-name')?.textContent ===
'QA selection fixture',
);
const targetSceneId = await page.$eval(
'#scene-select',
(node) =>
[...node.options].find(
(option) => option.textContent === 'QA selection fixture',
).value,
);
const baselineSceneId = await page.$eval(
'#scene-select',
(node) =>
[...node.options].find(
(option) => option.textContent === 'Baseline selection fixture',
).value,
);
await page.select('#scene-select', baselineSceneId);
await page.waitForFunction(
(id) => window.__godsEyeView.sceneDirector._getSelectedScene().id !== id,
{},
targetSceneId,
);
await page.evaluate(() => {
window.__qaFormChanges = [];
});
await page.focus('#scene-select');
// Typeahead is native even when headless Chrome does not drive OS popups.
await page.keyboard.press('q');
const sceneSelection = await page.evaluate(() => ({
id: document.getElementById('scene-select').value,
selected: window.__godsEyeView.sceneDirector._getSelectedScene().id,
changes: window.__qaFormChanges,
focus: document.activeElement.id,
outline: getComputedStyle(document.activeElement).outlineStyle,
}));
check(
'native typeahead reaches the Scene owner and keeps focus',
sceneSelection.id === targetSceneId &&
sceneSelection.selected === targetSceneId &&
sceneSelection.changes.at(-1) === targetSceneId &&
sceneSelection.focus === 'scene-select',
sceneSelection,
'NEW SCENE selects and names the new scene',
await page.evaluate(
() =>
window.__godsEyeView.sceneDirector._getSelectedScene().title ===
'QA selection fixture' && !document.getElementById('scene-select'),
),
);
check('keyboard focus remains visible', sceneSelection.outline === 'solid');
const localized = new URL(page.url());
localized.searchParams.set('lang', 'ru');
await page.goto(localized.href, { waitUntil: 'domcontentloaded' });
@@ -420,11 +374,9 @@ try {
});
});
const translated = await page.evaluate(() => {
const nodes = [
'scene-select',
'cctv-camera-select',
'hud-layout-select',
].map((id) => document.getElementById(id));
const nodes = ['cctv-camera-select', 'hud-layout-select'].map((id) =>
document.getElementById(id),
);
return (
document.documentElement.lang === 'ru' &&
nodes.every(
+4 -5
View File
@@ -48,9 +48,7 @@ try {
await page.click('[data-collapse-target="scene-panel"]');
await page.click('#scene-new-btn');
await page.waitForFunction(
() =>
document.querySelector('#scene-select option:checked')?.textContent ===
'QA Scene',
() => document.querySelector('#scene-name')?.textContent === 'QA Scene',
);
check(
'New creates and selects a persisted empty scene',
@@ -368,7 +366,7 @@ try {
await page.screenshot({ path: path.join(shots, 'narrow.png') });
check(
'Scene controls stay inside the narrow viewport',
await page.$eval('#scene-select', (element) => {
await page.$eval('#scene-name', (element) => {
const rect = element.getBoundingClientRect();
return rect.width > 0 && rect.left >= 0 && rect.right <= innerWidth;
}),
@@ -398,7 +396,8 @@ try {
await page.evaluate(
() =>
window.__godsEyeView.sceneDirector._project.scenes.length > 0 &&
document.querySelectorAll('#scene-select option').length > 0,
document.querySelector('#scene-name')?.textContent ===
window.__godsEyeView.sceneDirector._getSelectedScene()?.title,
),
);
check(
+17
View File
@@ -1,4 +1,7 @@
import { onFollowChanged } from '../data/followed.js';
import { bootStories } from '../stories/boot.js';
import { t } from '../i18n/index.js';
import { useStoriesStore } from '../ui/stores/stories.js';
import { SceneDirector } from '../scenes/director.js';
import { initAnnotations } from '../annotations/index.js';
import { initDrawTool } from '../annotations/drawTool.js';
@@ -76,6 +79,20 @@ export function createApplicationTools({
}),
);
onSceneDirector?.(sceneDirector);
// Stories: GEV scenes on this globe, from a Stories button. Its screens,
// styles, story data and controller load on first use.
const stories = bootStories({
// Inline in a host page, the URL and history are the host's.
available: !isEmbeddedInline(),
viewer,
director: sceneDirector,
store: useStoriesStore(applicationPinia()),
onLoadFailed: () =>
styleManager._showToast?.(
t('Stories could not load. Check the connection and try again.'),
),
});
defer(() => stories.destroy());
const annotations = initAnnotations({
viewer,
tileset,
+3
View File
@@ -265,6 +265,9 @@ function ownBoxEntries() {
// The phone shell is its own layout; mobileShell.test.mjs pins its
// attribution clearance.
if (part.startsWith('body.mobile-shell')) continue;
// So is Stories, with GEV's chrome stepped aside; storiesCredit.test.mjs
// pins its attribution placement.
if (part.startsWith('body.stories-mode')) continue;
entries.push({ rule, part });
}
}
+4
View File
@@ -641,6 +641,8 @@ export function placeCard(card, leader, anchor) {
function createRoot(documentRef, viewer) {
const root = documentRef.createElement('div');
root.id = 'bhote-koshi-embedded-media-root';
// Drawn over the globe for the scene: Stories keeps it while one plays.
root.setAttribute('data-globe-overlay', '');
root.setAttribute('aria-live', 'polite');
(viewer?.container || documentRef.body)?.append(root);
return root;
@@ -1120,6 +1122,8 @@ export function createBhoteKoshiEmbeddedMedia({
footer.append(title, status, link);
const body = documentRef.createElement('div');
body.className = 'bhote-embedded-callout-body';
// The card takes taps (its container and leader do not); Stories keeps that.
body.setAttribute('data-overlay-input', '');
body.append(player, footer);
card.append(leader, body);
root.append(card);
+30 -1
View File
@@ -16,6 +16,8 @@ import { validateSceneDataPacks } from './packs/manifest.js';
import { validateSceneCameras } from './cameraDocument.js';
export { SCENE_DOCUMENT_LIMITS, SceneDocumentError } from './documentFields.js';
import { validateSceneInteractions } from './interactions/document.js';
import { STORY_TAG_LIMIT, isStoryTagList } from '../scenes/storyTags.js';
import { STORY_THUMB_MAX_LENGTH, isStoryThumb } from '../scenes/storyThumb.js';
export const SCENE_DOCUMENT_VERSION = 6;
function visual(value, path, legacy) {
@@ -58,7 +60,12 @@ function visual(value, path, legacy) {
/** Validate a parsed scene project without mutating it or applying any state. */
export function validateSceneDocument(project) {
jsonTree(project, '$', { nodes: 0 });
jsonTree(project, '$', {
nodes: 0,
// A Stories card thumbnail is the one text allowed past the usual limit.
longText: (path) =>
/^\$\.scenes\.\d+\.storyThumb$/.test(path) ? STORY_THUMB_MAX_LENGTH : 0,
});
fields(project, '$', [
'version',
'createdAt',
@@ -84,12 +91,34 @@ export function validateSceneDocument(project) {
'releaseLayerIds',
'appliedShotPacks',
'shots',
'stories',
'storyThumb',
'storyTags',
...(version >= 4 ? ['anchors'] : []),
...(version >= 5 ? ['dataPacks'] : []),
]);
uniqueId(scene, path, sceneIds);
optional(scene, 'title', path, (v, p) => string(v, p, 4096));
optional(scene, 'releaseLayerIds', path, ids);
// Published to the Stories page; absent when it is not.
optional(scene, 'stories', path, (value, field) => {
if (value !== true) fail(field, 'expected true');
});
// The Stories card's thumbnail and tags; absent until the author sets them.
optional(scene, 'storyThumb', path, (value, field) => {
if (!isStoryThumb(value))
fail(
field,
`expected a JPEG or PNG data URL, at most ${STORY_THUMB_MAX_LENGTH} characters`,
);
});
optional(scene, 'storyTags', path, (value, field) => {
if (!isStoryTagList(value))
fail(
field,
`expected at most ${STORY_TAG_LIMIT} different Stories tags`,
);
});
optional(scene, 'appliedShotPacks', path, (packs, field) => {
array(packs, field);
const packIds = new Set();
+4 -1
View File
@@ -71,7 +71,10 @@ export function jsonTree(value, path, budget, depth = 0) {
fail(path, 'project complexity limit exceeded');
if (value === null || typeof value === 'boolean') return;
if (typeof value === 'string') {
if (value.length > SCENE_DOCUMENT_LIMITS.string)
if (
value.length > SCENE_DOCUMENT_LIMITS.string &&
value.length > (budget.longText?.(path) ?? 0)
)
fail(path, 'text is too long');
return;
}
+187 -2
View File
@@ -3391,7 +3391,6 @@
"scene|PLAY": "تشغيل",
"Create and edit scenes": "إنشاء المشاهد وتعديلها",
"SCENE": "المشهد",
"Scene": "المشهد",
"Start a new, empty scene": "بدء مشهد جديد فارغ",
"NEW SCENE": "مشهد جديد",
"Delete this scene and all of its shots": "حذف هذا المشهد وكل لقطاته",
@@ -3980,5 +3979,191 @@
"Search layers…": "ابحث في الطبقات…",
"Layer groups": "مجموعات الطبقات",
"Jump to {name}": "الانتقال إلى {name}",
"No layers match": "لا توجد طبقات مطابقة"
"No layers match": "لا توجد طبقات مطابقة",
"A GEV scene, played on the live globe.": "مشهد من GEV يُعرض على الكرة الأرضية المباشرة.",
"Drag the map to explore · Resume any time": "اسحب الخريطة للاستكشاف · استأنف في أي وقت",
"Region": "المنطقة",
"Europe": "أوروبا",
"Middle East": "الشرق الأوسط",
"South Asia": "جنوب آسيا",
"East Asia": "شرق آسيا",
"Length": "المدة",
"Under 1 min": "أقل من دقيقة",
"1 min or more": "دقيقة أو أكثر",
"Shots": "لقطات",
"Layers on": "طبقات مفعّلة",
"Stories": "القصص",
"NEW": "جديد",
"GEV Stories": "قصص GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "عروض تفاعلية منتقاة لما يحدث على الأرض. شغّل إحداها، وتحكّم بالخريطة متى شئت، ثم تابع القصة من حيث توقفت.",
"Browse stories": "تصفّح القصص",
"Not now": "ليس الآن",
"Opened in GEV": "فُتحت في GEV",
"Back to story": "العودة إلى القصة",
"GEV Stories explore": "استكشاف قصص GEV",
"Resize story list": "تغيير حجم قائمة القصص",
"Story list size. Drag, or press to change": "حجم قائمة القصص. اسحب أو اضغط للتغيير",
"{n} of {count} stories": {
"zero": "{n} من {count} قصة",
"one": "{n} من {count} قصة",
"two": "{n} من {count} قصة",
"few": "{n} من {count} قصص",
"many": "{n} من {count} قصة",
"other": "{n} من {count} قصة"
},
"Sort stories": "ترتيب القصص",
"Newest": "الأحدث",
"Longest": "الأطول",
"A–Z": "أ–ي",
"{count} filters on": {
"zero": "{count} مرشح مفعّل",
"one": "مرشح واحد مفعّل ({count})",
"two": "مرشحان مفعّلان ({count})",
"few": "{count} مرشحات مفعّلة",
"many": "{count} مرشحًا مفعّلًا",
"other": "{count} مرشح مفعّل"
},
"Filters": "المرشحات",
"Search stories": "البحث في القصص",
"Search stories, places, creators": "ابحث في القصص والأماكن والمنشئين",
"Clear search": "مسح البحث",
"Topics": "المواضيع",
"Filter stories": "تصفية القصص",
"Show {count} stories": {
"zero": "عرض {count} قصة",
"one": "عرض قصة واحدة ({count})",
"two": "عرض قصتين ({count})",
"few": "عرض {count} قصص",
"many": "عرض {count} قصة",
"other": "عرض {count} قصة"
},
"No stories match": "لا توجد قصص مطابقة",
"Try another word or clear the filters.": "جرّب كلمة أخرى أو امسح المرشحات.",
"Clear all": "مسح الكل",
"STORY": "قصة",
"Play {title}": "تشغيل {title}",
"Play story": "تشغيل القصة",
"Preview {title}": "معاينة {title}",
"Click to preview": "انقر للمعاينة",
"Click to play": "انقر للتشغيل",
"Tap to play": "المس للتشغيل",
"Pick a story or a pin to preview it here": "اختر قصة أو دبوسًا لمعاينته هنا",
"Story": "القصة",
"{what} link copied": "تم نسخ رابط {what}",
"Copy this link: {url}": "انسخ هذا الرابط: {url}",
"Back to stories": "العودة إلى القصص",
"Back to the globe": "العودة إلى الكرة الأرضية",
"Breadcrumb": "مسار التنقل",
"Globe": "الكرة الأرضية",
"Share": "مشاركة",
"Back to GEV": "العودة إلى GEV",
"Chapter {n}": "الفصل {n}",
"Context. Swipe up or press to open": "السياق. اسحب لأعلى أو اضغط للفتح",
"Context. Swipe down or press to close": "السياق. اسحب لأسفل أو اضغط للإغلاق",
"Search this story": "البحث في هذه القصة",
"Voice search (not in this build)": "البحث الصوتي (غير متاح في هذا الإصدار)",
"Search results": "نتائج البحث",
"Nothing in this story matches.": "لا شيء في هذه القصة يطابق البحث.",
"Chapters": "الفصول",
"now": "الآن",
"About": "حول",
"by {creator}": "بواسطة {creator}",
"Key moments": "اللحظات الرئيسية",
"Sources": "المصادر",
"Background": "الخلفية",
"Related stories": "قصص ذات صلة",
"Story link copied": "تم نسخ رابط القصة",
"You": "أنت",
"Open this moment in GEV": "فتح هذه اللحظة في GEV",
"Open": "فتح",
"Share this story": "مشاركة هذه القصة",
"GEV Story": "قصة GEV",
"Story card": "بطاقة القصة",
"Chapter": "الفصل",
"CHAPTER {n} / {total}": "الفصل {n} / {total}",
"ON THE MAP": "على الخريطة",
"Right now": "الآن",
"RIGHT NOW": "الآن",
"Minimise card": "تصغير البطاقة",
"Expand card": "توسيع البطاقة",
"Card pages": "صفحات البطاقة",
"Resize context panel": "تغيير حجم لوحة السياق",
"Swipe up for context": "اسحب لأعلى لعرض السياق",
"Chapter start": "بداية الفصل",
"Resume story": "استئناف القصة",
"Story time": "وقت القصة",
"chapter": "الفصل",
"Key moment: {label}": "لحظة رئيسية: {label}",
"Jump to live": "الانتقال إلى المباشر",
"Unmute": "إلغاء الكتم",
"Mute": "كتم الصوت",
"Exit expanded map": "الخروج من الخريطة الموسّعة",
"Expand map": "توسيع الخريطة",
"Exit cockpit to open Stories": "اخرج من القمرة لفتح القصص",
"Stories could not load. Check the connection and try again.": "تعذّر تحميل القصص. تحقّق من الاتصال ثم حاول مرة أخرى.",
"Shot {n} of {total}": "لقطة {n} من {total}",
"GEV scene": "مشهد GEV",
"No scene yet": "لا يوجد مشهد بعد",
"SAVE TO STORIES": "حفظ في STORIES",
"REMOVE FROM STORIES": "إزالة من STORIES",
"Show this scene on the Stories page": "عرض هذا المشهد في صفحة Stories",
"Take this scene off the Stories page": "إزالة هذا المشهد من صفحة Stories",
"Saved to Stories": "حُفظ في Stories",
"Removed from Stories": "أُزيل من Stories",
"A scene you made in GEV, played on the live globe.": "مشهد صنعته في GEV، يُعرض على الكرة الأرضية الحية.",
"Floods": "فيضانات",
"Wildfires": "حرائق الغابات",
"Storms": "عواصف",
"Earthquakes": "زلازل",
"Maritime": "بحري",
"Space": "الفضاء",
"Conflict": "نزاعات",
"Climate": "المناخ",
"Thumbnail could not be captured": "تعذّر التقاط الصورة المصغّرة",
"Thumbnail captured": "تم التقاط الصورة المصغّرة",
"Stories tags": "وسوم القصص",
"Story thumbnail": "الصورة المصغّرة للقصة",
"Use the current view as the Stories card image": "استخدم العرض الحالي صورةً لبطاقة القصص",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "تأتي مواقع الطائرات من ADS-B: لقطة OpenSky Network العالمية، مع adsb.lol حيث لا تتوفر بيانات لدى OpenSky.",
"Live-flight fallback (ODbL 1.0)": "مصدر احتياطي للرحلات المباشرة (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "تُحسب مدارات الأقمار الصناعية من العناصر المدارية الحالية لدى CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "تأتي الزلازل من البث المباشر لهيئة المسح الجيولوجي الأمريكية.",
"Traffic": "حركة المرور",
"Road traffic; live congestion needs your own TomTom key.": "حركة مرور الطرق؛ يتطلب الازدحام المباشر مفتاح TomTom خاصًا بك.",
"Live traffic flow, with your own key": "تدفق حركة المرور المباشر، بمفتاحك الخاص",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "حركة الطيران المباشرة حول العالم: المحيط الأطلسي وأوروبا واليابان وسان فرانسيسكو.",
"The Atlantic": "المحيط الأطلسي",
"Western Europe": "أوروبا الغربية",
"Japan": "اليابان",
"San Francisco Bay Area": "منطقة خليج سان فرانسيسكو",
"Pull back over the Atlantic": "الابتعاد فوق المحيط الأطلسي",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "الأقمار الصناعية في مداراتها، تُشاهَد فوق فلوريدا وأفريقيا وطوكيو وباريس.",
"Over Florida": "فوق فلوريدا",
"Over Africa": "فوق أفريقيا",
"Over Tokyo": "فوق طوكيو",
"Over Paris": "فوق باريس",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "زلازل حديثة بالمظهر الحراري: كاليفورنيا واليابان ونيوزيلندا وقبالة البرتغال.",
"California": "كاليفورنيا",
"New Zealand": "نيوزيلندا",
"Off Portugal": "قبالة البرتغال",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "الرحلات والأقمار الصناعية وحركة المرور معًا فوق نيويورك ولوس أنجلوس ولندن.",
"New York, closer": "نيويورك، عن قرب",
"New York, closer still": "نيويورك، عن قرب أكثر",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "كل الطبقات المباشرة معًا، مع الابتعاد من طوكيو إلى الكوكب بأكمله.",
"Tokyo, pulling back": "طوكيو، مع الابتعاد",
"Japan and East Asia": "اليابان وشرق آسيا",
"South China Sea": "بحر الصين الجنوبي",
"The whole globe": "الكرة الأرضية كاملة",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "فيضان Bhote Koshi الانفجاري في نيبال في 26 أغسطس 2026، متتبَّعًا أسفل الوادي حتى Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "مسار الفيضان المُعاد بناؤه (CC BY-NC 4.0)",
"THUMBNAIL": "صورة مصغّرة",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "لقطة عالمية للرحلات المباشرة (ترخيص غير تجاري للبحث والتعليم)",
"Satellite element sets and catalogue (U.S. government data)": "العناصر المدارية للأقمار الصناعية وفهرسها (بيانات حكومة الولايات المتحدة)",
"Satellite operators, owners and purposes": "مشغلو الأقمار الصناعية ومالكوها وأغراضها",
"Earthquake feed (U.S. public domain)": "بث الزلازل (ملكية عامة في الولايات المتحدة)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "صور الأقمار الصناعية التاريخية وما بعد الحدث (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "تصوير مرئي لفيضان Bhote Koshi الانفجاري في 26 أغسطس 2026، وليس نموذجًا رسميًا للمخاطر. المشاهد التاريخية (2021) وما بعد الحدث هي صور Vantor WorldView؛ ومسار النهر هو إعادة بناء من GeoPera. ترتبط مقاطع الشهود بمنشوراتها الأصلية، وأوقات تصويرها غير مُتحقَّق منها.",
"That story is not available here": "هذه القصة غير متاحة هنا",
"DRAFT": "مسودة",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "مسودة لم تُحفظ كقصة بعد. استخدم «حفظ في STORIES» في «الإنشاء» لحفظها."
}
+175 -2
View File
@@ -3099,7 +3099,6 @@
"AUTHORING": "SZENEN",
"Create and edit scenes": "Szenen erstellen und bearbeiten",
"SCENE": "SZENE",
"Scene": "Szene",
"NEW SCENE": "NEUE SZENE",
"Start a new, empty scene": "Neue, leere Szene beginnen",
"DELETE": "LÖSCHEN",
@@ -3632,5 +3631,179 @@
"Search layers…": "Ebenen suchen…",
"Layer groups": "Ebenengruppen",
"Jump to {name}": "Zu {name} springen",
"No layers match": "Keine passenden Ebenen"
"No layers match": "Keine passenden Ebenen",
"A GEV scene, played on the live globe.": "Eine GEV-Szene, abgespielt auf dem Live-Globus.",
"Drag the map to explore · Resume any time": "Karte ziehen zum Erkunden · Jederzeit fortsetzen",
"Region": "Region",
"Europe": "Europa",
"Middle East": "Naher Osten",
"South Asia": "Südasien",
"East Asia": "Ostasien",
"Length": "Länge",
"Under 1 min": "Unter 1 Min.",
"1 min or more": "1 Min. oder mehr",
"Shots": "Einstellungen",
"Layers on": "Aktive Ebenen",
"Stories": "Storys",
"NEW": "NEU",
"GEV Stories": "GEV Storys",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Kuratierte, interaktive Ansichten dessen, was auf der Erde passiert. Spielen Sie eine ab, übernehmen Sie jederzeit die Karte und setzen Sie die Story danach fort.",
"Browse stories": "Storys durchsuchen",
"Not now": "Nicht jetzt",
"Opened in GEV": "In GEV geöffnet",
"Back to story": "Zurück zur Story",
"GEV Stories explore": "GEV Storys entdecken",
"Resize story list": "Größe der Story-Liste ändern",
"Story list size. Drag, or press to change": "Größe der Story-Liste. Ziehen oder drücken zum Ändern",
"{n} of {count} stories": {
"one": "{n} von {count} Story",
"other": "{n} von {count} Storys"
},
"Sort stories": "Storys sortieren",
"Newest": "Neueste",
"Longest": "Längste",
"A–Z": "A–Z",
"{count} filters on": {
"one": "{count} Filter aktiv",
"other": "{count} Filter aktiv"
},
"Filters": "Filter",
"Search stories": "Storys durchsuchen",
"Search stories, places, creators": "Storys, Orte, Ersteller suchen",
"Clear search": "Suche leeren",
"Topics": "Themen",
"Filter stories": "Storys filtern",
"Show {count} stories": {
"one": "{count} Story anzeigen",
"other": "{count} Storys anzeigen"
},
"No stories match": "Keine passenden Storys",
"Try another word or clear the filters.": "Anderes Wort versuchen oder Filter zurücksetzen.",
"Clear all": "Alle zurücksetzen",
"STORY": "STORY",
"Play {title}": "{title} abspielen",
"Play story": "Story abspielen",
"Preview {title}": "Vorschau: {title}",
"Click to preview": "Klicken für Vorschau",
"Click to play": "Klicken zum Abspielen",
"Tap to play": "Tippen zum Abspielen",
"Pick a story or a pin to preview it here": "Story oder Markierung für die Vorschau hier auswählen",
"Story": "Story",
"{what} link copied": "{what}-Link kopiert",
"Copy this link: {url}": "Diesen Link kopieren: {url}",
"Back to stories": "Zurück zu den Storys",
"Back to the globe": "Zurück zum Globus",
"Breadcrumb": "Navigationspfad",
"Globe": "Globus",
"Share": "Teilen",
"Back to GEV": "Zurück zu GEV",
"Chapter {n}": "Kapitel {n}",
"Context. Swipe up or press to open": "Kontext. Nach oben wischen oder drücken zum Öffnen",
"Context. Swipe down or press to close": "Kontext. Nach unten wischen oder drücken zum Schließen",
"Search this story": "Diese Story durchsuchen",
"Voice search (not in this build)": "Sprachsuche (in diesem Build nicht verfügbar)",
"Search results": "Suchergebnisse",
"Nothing in this story matches.": "Nichts in dieser Story passt.",
"Chapters": "Kapitel",
"now": "jetzt",
"About": "Info",
"by {creator}": "von {creator}",
"Key moments": "Schlüsselmomente",
"Sources": "Quellen",
"Background": "Hintergrund",
"Related stories": "Ähnliche Storys",
"Story link copied": "Story-Link kopiert",
"You": "Sie",
"Open this moment in GEV": "Diesen Moment in GEV öffnen",
"Open": "Öffnen",
"Share this story": "Diese Story teilen",
"GEV Story": "GEV-Story",
"Story card": "Story-Karte",
"Chapter": "Kapitel",
"CHAPTER {n} / {total}": "KAPITEL {n} / {total}",
"ON THE MAP": "AUF DER KARTE",
"Right now": "Gerade jetzt",
"RIGHT NOW": "GERADE JETZT",
"Minimise card": "Karte minimieren",
"Expand card": "Karte ausklappen",
"Card pages": "Kartenseiten",
"Resize context panel": "Größe des Kontextbereichs ändern",
"Swipe up for context": "Nach oben wischen für Kontext",
"Chapter start": "Kapitelanfang",
"Resume story": "Story fortsetzen",
"Story time": "Story-Zeit",
"chapter": "Kapitel",
"Key moment: {label}": "Schlüsselmoment: {label}",
"Jump to live": "Zu live springen",
"Unmute": "Ton an",
"Mute": "Stumm",
"Exit expanded map": "Vergrößerte Karte verlassen",
"Expand map": "Karte vergrößern",
"Exit cockpit to open Stories": "Cockpit verlassen, um Storys zu öffnen",
"Stories could not load. Check the connection and try again.": "Storys konnten nicht geladen werden. Prüfen Sie die Verbindung und versuchen Sie es erneut.",
"Shot {n} of {total}": "Aufnahme {n} von {total}",
"GEV scene": "GEV-Szene",
"No scene yet": "Noch keine Szene",
"SAVE TO STORIES": "IN STORIES SPEICHERN",
"REMOVE FROM STORIES": "AUS STORIES ENTFERNEN",
"Show this scene on the Stories page": "Diese Szene auf der Stories-Seite zeigen",
"Take this scene off the Stories page": "Diese Szene von der Stories-Seite nehmen",
"Saved to Stories": "In Stories gespeichert",
"Removed from Stories": "Aus Stories entfernt",
"A scene you made in GEV, played on the live globe.": "Eine Szene, die du in GEV erstellt hast, abgespielt auf dem Live-Globus.",
"Floods": "Überschwemmungen",
"Wildfires": "Waldbrände",
"Storms": "Stürme",
"Earthquakes": "Erdbeben",
"Maritime": "Seefahrt",
"Space": "Weltraum",
"Conflict": "Konflikte",
"Climate": "Klima",
"Thumbnail could not be captured": "Vorschaubild konnte nicht aufgenommen werden",
"Thumbnail captured": "Vorschaubild aufgenommen",
"Stories tags": "Stories-Schlagwörter",
"Story thumbnail": "Vorschaubild der Story",
"Use the current view as the Stories card image": "Die aktuelle Ansicht als Bild der Stories-Karte verwenden",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Flugzeugpositionen stammen aus ADS-B: dem weltweiten Snapshot des OpenSky Network, ergänzt durch adsb.lol, wo OpenSky keine Daten hat.",
"Live-flight fallback (ODbL 1.0)": "Live-Flug-Ersatzquelle (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Satellitenbahnen werden aus den aktuellen Bahnelementen von CelesTrak berechnet.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Erdbeben stammen aus dem Live-Feed des U.S. Geological Survey.",
"Traffic": "Verkehr",
"Road traffic; live congestion needs your own TomTom key.": "Straßenverkehr; Live-Staudaten brauchen einen eigenen TomTom-Schlüssel.",
"Live traffic flow, with your own key": "Live-Verkehrsfluss, mit eigenem Schlüssel",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Live-Flugverkehr weltweit: Atlantik, Europa, Japan und San Francisco.",
"The Atlantic": "Der Atlantik",
"Western Europe": "Westeuropa",
"Japan": "Japan",
"San Francisco Bay Area": "Bucht von San Francisco",
"Pull back over the Atlantic": "Über dem Atlantik herauszoomen",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Satelliten im Orbit, beobachtet über Florida, Afrika, Tokio und Paris.",
"Over Florida": "Über Florida",
"Over Africa": "Über Afrika",
"Over Tokyo": "Über Tokio",
"Over Paris": "Über Paris",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Aktuelle Erdbeben in der Wärmebildansicht: Kalifornien, Japan, Neuseeland und vor Portugal.",
"California": "Kalifornien",
"New Zealand": "Neuseeland",
"Off Portugal": "Vor Portugal",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Flüge, Satelliten und Verkehr zusammen über New York, Los Angeles und London.",
"New York, closer": "New York, näher",
"New York, closer still": "New York, noch näher",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Alle Live-Ebenen auf einmal, von Tokio hinaus bis zum ganzen Planeten.",
"Tokyo, pulling back": "Tokio, herauszoomen",
"Japan and East Asia": "Japan und Ostasien",
"South China Sea": "Südchinesisches Meer",
"The whole globe": "Der ganze Globus",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "Die Ausbruchsflut am Bhote Koshi in Nepal vom 26. August 2026, talabwärts verfolgt bis Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Rekonstruierter Flutpfad (CC BY-NC 4.0)",
"THUMBNAIL": "VORSCHAUBILD",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Weltweiter Live-Flug-Snapshot (Lizenz für nichtkommerzielle Forschung und Lehre)",
"Satellite element sets and catalogue (U.S. government data)": "Satelliten-Bahnelemente und Katalog (Daten der US-Regierung)",
"Satellite operators, owners and purposes": "Betreiber, Eigentümer und Zwecke von Satelliten",
"Earthquake feed (U.S. public domain)": "Erdbeben-Feed (gemeinfrei in den USA)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Historische Satellitenbilder und Bilder nach dem Ereignis (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Eine Visualisierung der Ausbruchsflut am Bhote Koshi vom 26. August 2026, kein offizielles Gefahrenmodell. Die historischen Ansichten (2021) und die Ansichten nach dem Ereignis sind Vantor-WorldView-Bilder; der Flussverlauf ist die Rekonstruktion von GeoPera. Augenzeugenclips verlinken auf ihre ursprünglichen Beiträge, ihre Aufnahmezeiten sind nicht überprüft.",
"That story is not available here": "Diese Story ist hier nicht verfügbar",
"DRAFT": "ENTWURF",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Ein Entwurf, noch nicht als Story gespeichert. Mit IN STORIES SPEICHERN unter SZENEN speicherst du ihn."
}
+178 -2
View File
@@ -3194,7 +3194,6 @@
"AUTHORING": "CREACIÓN",
"Create and edit scenes": "Crea y edita escenas",
"SCENE": "ESCENA",
"Scene": "Escena",
"NEW SCENE": "NUEVA ESCENA",
"Start a new, empty scene": "Empieza una escena nueva y vacía",
"DELETE": "ELIMINAR",
@@ -3719,5 +3718,182 @@
"Search layers…": "Buscar capas…",
"Layer groups": "Grupos de capas",
"Jump to {name}": "Ir a {name}",
"No layers match": "Ninguna capa coincide"
"No layers match": "Ninguna capa coincide",
"A GEV scene, played on the live globe.": "Una escena de GEV, reproducida en el globo en vivo.",
"Drag the map to explore · Resume any time": "Arrastra el mapa para explorar · Reanuda cuando quieras",
"Region": "Región",
"Europe": "Europa",
"Middle East": "Oriente Medio",
"South Asia": "Asia meridional",
"East Asia": "Asia oriental",
"Length": "Duración",
"Under 1 min": "Menos de 1 min",
"1 min or more": "1 min o más",
"Shots": "Planos",
"Layers on": "Capas activas",
"Stories": "Historias",
"NEW": "NUEVO",
"GEV Stories": "Historias de GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Vistas interactivas y seleccionadas de lo que está pasando en la Tierra. Reproduce una, toma el control del mapa cuando quieras y luego retoma la historia.",
"Browse stories": "Explorar historias",
"Not now": "Ahora no",
"Opened in GEV": "Abierto en GEV",
"Back to story": "Volver a la historia",
"GEV Stories explore": "Explorar Historias de GEV",
"Resize story list": "Cambiar el tamaño de la lista de historias",
"Story list size. Drag, or press to change": "Tamaño de la lista de historias. Arrastra o pulsa para cambiarlo",
"{n} of {count} stories": {
"one": "{n} de {count} historia",
"many": "{n} de {count} de historias",
"other": "{n} de {count} historias"
},
"Sort stories": "Ordenar historias",
"Newest": "Más recientes",
"Longest": "Más largas",
"A–Z": "A–Z",
"{count} filters on": {
"one": "{count} filtro activo",
"many": "{count} de filtros activos",
"other": "{count} filtros activos"
},
"Filters": "Filtros",
"Search stories": "Buscar historias",
"Search stories, places, creators": "Buscar historias, lugares, creadores",
"Clear search": "Borrar búsqueda",
"Topics": "Temas",
"Filter stories": "Filtrar historias",
"Show {count} stories": {
"one": "Mostrar {count} historia",
"many": "Mostrar {count} de historias",
"other": "Mostrar {count} historias"
},
"No stories match": "Ninguna historia coincide",
"Try another word or clear the filters.": "Prueba otra palabra o borra los filtros.",
"Clear all": "Borrar todo",
"STORY": "HISTORIA",
"Play {title}": "Reproducir {title}",
"Play story": "Reproducir historia",
"Preview {title}": "Vista previa de {title}",
"Click to preview": "Haz clic para la vista previa",
"Click to play": "Haz clic para reproducir",
"Tap to play": "Toca para reproducir",
"Pick a story or a pin to preview it here": "Elige una historia o un marcador para verla aquí",
"Story": "Historia",
"{what} link copied": "Enlace de {what} copiado",
"Copy this link: {url}": "Copia este enlace: {url}",
"Back to stories": "Volver a las historias",
"Back to the globe": "Volver al globo",
"Breadcrumb": "Ruta de navegación",
"Globe": "Globo",
"Share": "Compartir",
"Back to GEV": "Volver a GEV",
"Chapter {n}": "Capítulo {n}",
"Context. Swipe up or press to open": "Contexto. Desliza hacia arriba o pulsa para abrir",
"Context. Swipe down or press to close": "Contexto. Desliza hacia abajo o pulsa para cerrar",
"Search this story": "Buscar en esta historia",
"Voice search (not in this build)": "Búsqueda por voz (no disponible en esta versión)",
"Search results": "Resultados de búsqueda",
"Nothing in this story matches.": "Nada en esta historia coincide.",
"Chapters": "Capítulos",
"now": "ahora",
"About": "Acerca de",
"by {creator}": "por {creator}",
"Key moments": "Momentos clave",
"Sources": "Fuentes",
"Background": "Antecedentes",
"Related stories": "Historias relacionadas",
"Story link copied": "Enlace de la historia copiado",
"You": "Tú",
"Open this moment in GEV": "Abrir este momento en GEV",
"Open": "Abrir",
"Share this story": "Compartir esta historia",
"GEV Story": "Historia de GEV",
"Story card": "Ficha de la historia",
"Chapter": "Capítulo",
"CHAPTER {n} / {total}": "CAPÍTULO {n} / {total}",
"ON THE MAP": "EN EL MAPA",
"Right now": "Ahora mismo",
"RIGHT NOW": "AHORA MISMO",
"Minimise card": "Minimizar ficha",
"Expand card": "Ampliar ficha",
"Card pages": "Páginas de la ficha",
"Resize context panel": "Cambiar el tamaño del panel de contexto",
"Swipe up for context": "Desliza hacia arriba para ver el contexto",
"Chapter start": "Inicio del capítulo",
"Resume story": "Reanudar historia",
"Story time": "Hora de la historia",
"chapter": "capítulo",
"Key moment: {label}": "Momento clave: {label}",
"Jump to live": "Ir al directo",
"Unmute": "Activar sonido",
"Mute": "Silenciar",
"Exit expanded map": "Salir del mapa ampliado",
"Expand map": "Ampliar mapa",
"Exit cockpit to open Stories": "Sal de la cabina para abrir Historias",
"Stories could not load. Check the connection and try again.": "No se pudieron cargar las Historias. Comprueba la conexión e inténtalo de nuevo.",
"Shot {n} of {total}": "Plano {n} de {total}",
"GEV scene": "Escena de GEV",
"No scene yet": "Aún no hay escena",
"SAVE TO STORIES": "GUARDAR EN STORIES",
"REMOVE FROM STORIES": "QUITAR DE STORIES",
"Show this scene on the Stories page": "Mostrar esta escena en la página Stories",
"Take this scene off the Stories page": "Quitar esta escena de la página Stories",
"Saved to Stories": "Guardada en Stories",
"Removed from Stories": "Quitada de Stories",
"A scene you made in GEV, played on the live globe.": "Una escena que creaste en GEV, reproducida en el globo en vivo.",
"Floods": "Inundaciones",
"Wildfires": "Incendios forestales",
"Storms": "Tormentas",
"Earthquakes": "Terremotos",
"Maritime": "Marítimo",
"Space": "Espacio",
"Conflict": "Conflictos",
"Climate": "Clima",
"Thumbnail could not be captured": "No se pudo capturar la miniatura",
"Thumbnail captured": "Miniatura capturada",
"Stories tags": "Etiquetas de Stories",
"Story thumbnail": "Miniatura de la historia",
"Use the current view as the Stories card image": "Usar la vista actual como imagen de la tarjeta de Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Las posiciones de los aviones vienen de ADS-B: la instantánea mundial de OpenSky Network, con adsb.lol donde OpenSky no tiene datos.",
"Live-flight fallback (ODbL 1.0)": "Respaldo de vuelos en vivo (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Las órbitas de los satélites se calculan con los elementos orbitales actuales de CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Los terremotos vienen del feed en vivo del Servicio Geológico de EE. UU.",
"Traffic": "Tráfico",
"Road traffic; live congestion needs your own TomTom key.": "Tráfico vial; la congestión en vivo requiere tu propia clave de TomTom.",
"Live traffic flow, with your own key": "Flujo de tráfico en vivo, con tu propia clave",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Tráfico aéreo en vivo en todo el mundo: el Atlántico, Europa, Japón y San Francisco.",
"The Atlantic": "El Atlántico",
"Western Europe": "Europa occidental",
"Japan": "Japón",
"San Francisco Bay Area": "Bahía de San Francisco",
"Pull back over the Atlantic": "Alejarse sobre el Atlántico",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Satélites en órbita, vistos desde Florida, África, Tokio y París.",
"Over Florida": "Sobre Florida",
"Over Africa": "Sobre África",
"Over Tokyo": "Sobre Tokio",
"Over Paris": "Sobre París",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Terremotos recientes con la vista térmica: California, Japón, Nueva Zelanda y frente a Portugal.",
"California": "California",
"New Zealand": "Nueva Zelanda",
"Off Portugal": "Frente a Portugal",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Vuelos, satélites y tráfico juntos sobre Nueva York, Los Ángeles y Londres.",
"New York, closer": "Nueva York, más cerca",
"New York, closer still": "Nueva York, aún más cerca",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Todas las capas en vivo a la vez, alejándose de Tokio hasta todo el planeta.",
"Tokyo, pulling back": "Tokio, alejándose",
"Japan and East Asia": "Japón y Asia oriental",
"South China Sea": "Mar de China Meridional",
"The whole globe": "Todo el globo",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "La inundación por desborde del Bhote Koshi del 26 de agosto de 2026 en Nepal, seguida valle abajo hasta Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Recorrido reconstruido de la inundación (CC BY-NC 4.0)",
"THUMBNAIL": "MINIATURA",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Instantánea mundial de vuelos en vivo (licencia no comercial para investigación y educación)",
"Satellite element sets and catalogue (U.S. government data)": "Elementos orbitales y catálogo de satélites (datos del Gobierno de EE. UU.)",
"Satellite operators, owners and purposes": "Operadores, propietarios y finalidades de los satélites",
"Earthquake feed (U.S. public domain)": "Feed de terremotos (dominio público de EE. UU.)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Imágenes satelitales históricas y posteriores al evento (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Una visualización de la inundación por desborde del Bhote Koshi del 26 de agosto de 2026, no un modelo oficial de riesgos. Las vistas históricas (2021) y posteriores al evento son imágenes de Vantor WorldView; el recorrido del río es la reconstrucción de GeoPera. Los clips de testigos enlazan a sus publicaciones originales, y sus horas de captura no están verificadas.",
"That story is not available here": "Esa historia no está disponible aquí",
"DRAFT": "BORRADOR",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Un borrador, aún no guardado como historia. Usa GUARDAR EN STORIES en CREACIÓN para guardarlo."
}
+178 -2
View File
@@ -3174,7 +3174,6 @@
"AUTHORING": "CRÉATION",
"Create and edit scenes": "Créer et modifier des scènes",
"SCENE": "SCÈNE",
"Scene": "Scène",
"NEW SCENE": "NOUVELLE SCÈNE",
"Start a new, empty scene": "Commencer une nouvelle scène vide",
"DELETE": "SUPPRIMER",
@@ -3719,5 +3718,182 @@
"Search layers…": "Rechercher des couches…",
"Layer groups": "Groupes de couches",
"Jump to {name}": "Aller à {name}",
"No layers match": "Aucune couche ne correspond"
"No layers match": "Aucune couche ne correspond",
"A GEV scene, played on the live globe.": "Une scène GEV, lue sur le globe en direct.",
"Drag the map to explore · Resume any time": "Faites glisser la carte pour explorer · Reprenez à tout moment",
"Region": "Région",
"Europe": "Europe",
"Middle East": "Moyen-Orient",
"South Asia": "Asie du Sud",
"East Asia": "Asie de l’Est",
"Length": "Durée",
"Under 1 min": "Moins de 1 min",
"1 min or more": "1 min ou plus",
"Shots": "Plans",
"Layers on": "Couches actives",
"Stories": "Récits",
"NEW": "NOUVEAU",
"GEV Stories": "Récits GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Des vues interactives et éditorialisées de ce qui se passe sur Terre. Lancez-en un, prenez la main sur la carte quand vous voulez, puis reprenez le récit.",
"Browse stories": "Parcourir les récits",
"Not now": "Pas maintenant",
"Opened in GEV": "Ouvert dans GEV",
"Back to story": "Retour au récit",
"GEV Stories explore": "Explorer les récits GEV",
"Resize story list": "Redimensionner la liste des récits",
"Story list size. Drag, or press to change": "Taille de la liste des récits. Faites glisser ou appuyez pour modifier",
"{n} of {count} stories": {
"one": "{n} sur {count} récit",
"many": "{n} sur {count} récits",
"other": "{n} sur {count} récits"
},
"Sort stories": "Trier les récits",
"Newest": "Plus récents",
"Longest": "Plus longs",
"A–Z": "A–Z",
"{count} filters on": {
"one": "{count} filtre actif",
"many": "{count} filtres actifs",
"other": "{count} filtres actifs"
},
"Filters": "Filtres",
"Search stories": "Rechercher des récits",
"Search stories, places, creators": "Rechercher récits, lieux, créateurs",
"Clear search": "Effacer la recherche",
"Topics": "Thèmes",
"Filter stories": "Filtrer les récits",
"Show {count} stories": {
"one": "Afficher {count} récit",
"many": "Afficher {count} récits",
"other": "Afficher {count} récits"
},
"No stories match": "Aucun récit ne correspond",
"Try another word or clear the filters.": "Essayez un autre mot ou effacez les filtres.",
"Clear all": "Tout effacer",
"STORY": "RÉCIT",
"Play {title}": "Lire {title}",
"Play story": "Lire le récit",
"Preview {title}": "Aperçu : {title}",
"Click to preview": "Cliquez pour un aperçu",
"Click to play": "Cliquez pour lire",
"Tap to play": "Appuyez pour lire",
"Pick a story or a pin to preview it here": "Choisissez un récit ou un repère pour l’afficher en aperçu ici",
"Story": "Récit",
"{what} link copied": "Lien copié : {what}",
"Copy this link: {url}": "Copiez ce lien : {url}",
"Back to stories": "Retour aux récits",
"Back to the globe": "Retour au globe",
"Breadcrumb": "Fil d’Ariane",
"Globe": "Globe",
"Share": "Partager",
"Back to GEV": "Retour à GEV",
"Chapter {n}": "Chapitre {n}",
"Context. Swipe up or press to open": "Contexte. Balayez vers le haut ou appuyez pour ouvrir",
"Context. Swipe down or press to close": "Contexte. Balayez vers le bas ou appuyez pour fermer",
"Search this story": "Rechercher dans ce récit",
"Voice search (not in this build)": "Recherche vocale (absente de cette version)",
"Search results": "Résultats de recherche",
"Nothing in this story matches.": "Rien ne correspond dans ce récit.",
"Chapters": "Chapitres",
"now": "maintenant",
"About": "À propos",
"by {creator}": "par {creator}",
"Key moments": "Moments clés",
"Sources": "Sources",
"Background": "Arrière-plan",
"Related stories": "Récits associés",
"Story link copied": "Lien du récit copié",
"You": "Vous",
"Open this moment in GEV": "Ouvrir ce moment dans GEV",
"Open": "Ouvrir",
"Share this story": "Partager ce récit",
"GEV Story": "Récit GEV",
"Story card": "Fiche du récit",
"Chapter": "Chapitre",
"CHAPTER {n} / {total}": "CHAPITRE {n} / {total}",
"ON THE MAP": "SUR LA CARTE",
"Right now": "En ce moment",
"RIGHT NOW": "EN CE MOMENT",
"Minimise card": "Réduire la fiche",
"Expand card": "Agrandir la fiche",
"Card pages": "Pages de la fiche",
"Resize context panel": "Redimensionner le panneau de contexte",
"Swipe up for context": "Balayez vers le haut pour le contexte",
"Chapter start": "Début du chapitre",
"Resume story": "Reprendre le récit",
"Story time": "Heure du récit",
"chapter": "chapitre",
"Key moment: {label}": "Moment clé : {label}",
"Jump to live": "Revenir au direct",
"Unmute": "Réactiver le son",
"Mute": "Couper le son",
"Exit expanded map": "Quitter la carte agrandie",
"Expand map": "Agrandir la carte",
"Exit cockpit to open Stories": "Quittez le cockpit pour ouvrir les Récits",
"Stories could not load. Check the connection and try again.": "Impossible de charger les Récits. Vérifiez la connexion et réessayez.",
"Shot {n} of {total}": "Plan {n} sur {total}",
"GEV scene": "Scène GEV",
"No scene yet": "Aucune scène pour l'instant",
"SAVE TO STORIES": "ENREGISTRER DANS STORIES",
"REMOVE FROM STORIES": "RETIRER DE STORIES",
"Show this scene on the Stories page": "Afficher cette scène sur la page Stories",
"Take this scene off the Stories page": "Retirer cette scène de la page Stories",
"Saved to Stories": "Enregistrée dans Stories",
"Removed from Stories": "Retirée de Stories",
"A scene you made in GEV, played on the live globe.": "Une scène que vous avez créée dans GEV, jouée sur le globe en direct.",
"Floods": "Inondations",
"Wildfires": "Feux de forêt",
"Storms": "Tempêtes",
"Earthquakes": "Séismes",
"Maritime": "Maritime",
"Space": "Espace",
"Conflict": "Conflits",
"Climate": "Climat",
"Thumbnail could not be captured": "Impossible de capturer la miniature",
"Thumbnail captured": "Miniature capturée",
"Stories tags": "Tags Stories",
"Story thumbnail": "Miniature du récit",
"Use the current view as the Stories card image": "Utiliser la vue actuelle comme image de la carte Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Les positions des avions viennent de l'ADS-B : l'instantané mondial d'OpenSky Network, complété par adsb.lol là où OpenSky n'a rien.",
"Live-flight fallback (ODbL 1.0)": "Source de secours pour les vols en direct (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Les orbites des satellites sont calculées à partir des éléments orbitaux actuels de CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Les séismes viennent du flux en direct de l'U.S. Geological Survey.",
"Traffic": "Trafic",
"Road traffic; live congestion needs your own TomTom key.": "Trafic routier ; les embouteillages en direct nécessitent votre propre clé TomTom.",
"Live traffic flow, with your own key": "Trafic en direct, avec votre propre clé",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Le trafic aérien en direct dans le monde : l'Atlantique, l'Europe, le Japon et San Francisco.",
"The Atlantic": "L'Atlantique",
"Western Europe": "Europe de l'Ouest",
"Japan": "Japon",
"San Francisco Bay Area": "Baie de San Francisco",
"Pull back over the Atlantic": "Recul au-dessus de l'Atlantique",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Les satellites en orbite, vus depuis la Floride, l'Afrique, Tokyo et Paris.",
"Over Florida": "Au-dessus de la Floride",
"Over Africa": "Au-dessus de l'Afrique",
"Over Tokyo": "Au-dessus de Tokyo",
"Over Paris": "Au-dessus de Paris",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Séismes récents en vue thermique : Californie, Japon, Nouvelle-Zélande et au large du Portugal.",
"California": "Californie",
"New Zealand": "Nouvelle-Zélande",
"Off Portugal": "Au large du Portugal",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Vols, satellites et trafic ensemble au-dessus de New York, Los Angeles et Londres.",
"New York, closer": "New York, plus près",
"New York, closer still": "New York, encore plus près",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Toutes les couches en direct à la fois, en reculant de Tokyo jusqu'à la planète entière.",
"Tokyo, pulling back": "Tokyo, en reculant",
"Japan and East Asia": "Japon et Asie de l'Est",
"South China Sea": "Mer de Chine méridionale",
"The whole globe": "Le globe entier",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "La crue par débâcle de la Bhote Koshi du 26 août 2026 au Népal, suivie le long de la vallée jusqu'à Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Tracé reconstitué de la crue (CC BY-NC 4.0)",
"THUMBNAIL": "MINIATURE",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Instantané mondial des vols en direct (licence non commerciale de recherche et d'enseignement)",
"Satellite element sets and catalogue (U.S. government data)": "Éléments orbitaux et catalogue des satellites (données du gouvernement des États-Unis)",
"Satellite operators, owners and purposes": "Opérateurs, propriétaires et usages des satellites",
"Earthquake feed (U.S. public domain)": "Flux des séismes (domaine public aux États-Unis)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Images satellite historiques et postérieures à l'événement (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Une visualisation de la crue par débâcle de la Bhote Koshi du 26 août 2026, et non un modèle officiel de risque. Les vues historiques (2021) et postérieures à l'événement sont des images Vantor WorldView ; le tracé de la rivière est la reconstitution de GeoPera. Les vidéos de témoins renvoient à leurs publications d'origine, et leurs heures de prise de vue ne sont pas vérifiées.",
"That story is not available here": "Ce récit n'est pas disponible ici",
"DRAFT": "BROUILLON",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Un brouillon, pas encore enregistré comme récit. Utilisez ENREGISTRER DANS STORIES dans CRÉATION pour l'enregistrer."
}
+178 -2
View File
@@ -2335,7 +2335,6 @@
"Directions, drawing and your own files": "דרכי הגעה, שרטוט והקבצים שלך",
"Create and edit scenes": "יצירה ועריכה של סצנות",
"SCENE": "סצנה",
"Scene": "סצנה",
"Start a new, empty scene": "התחלת סצנה חדשה וריקה",
"NEW SCENE": "סצנה חדשה",
"Delete this scene and all of its shots": "מחיקת סצנה זו וכל שוטיה",
@@ -3719,5 +3718,182 @@
"Search layers…": "חיפוש שכבות…",
"Layer groups": "קבוצות שכבות",
"Jump to {name}": "מעבר אל {name}",
"No layers match": "אין שכבות תואמות"
"No layers match": "אין שכבות תואמות",
"A GEV scene, played on the live globe.": "סצנת GEV המוצגת על הגלובוס החי.",
"Drag the map to explore · Resume any time": "גרור את המפה כדי לחקור · אפשר להמשיך בכל עת",
"Region": "אזור",
"Europe": "אירופה",
"Middle East": "המזרח התיכון",
"South Asia": "דרום אסיה",
"East Asia": "מזרח אסיה",
"Length": "אורך",
"Under 1 min": "פחות מדקה",
"1 min or more": "דקה ומעלה",
"Shots": "שוטים",
"Layers on": "שכבות פעילות",
"Stories": "סיפורים",
"NEW": "חדש",
"GEV Stories": "סיפורי GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "תצוגות אינטראקטיביות ונבחרות של מה שקורה על כדור הארץ. הפעל אחת, השתלט על המפה מתי שתרצה, ואז חזור לסיפור.",
"Browse stories": "עיון בסיפורים",
"Not now": "לא עכשיו",
"Opened in GEV": "נפתח ב-GEV",
"Back to story": "חזרה לסיפור",
"GEV Stories explore": "גילוי סיפורי GEV",
"Resize story list": "שינוי גודל רשימת הסיפורים",
"Story list size. Drag, or press to change": "גודל רשימת הסיפורים. גרור או לחץ כדי לשנות",
"{n} of {count} stories": {
"one": "{n} מתוך סיפור {count}",
"two": "{n} מתוך {count} סיפורים",
"other": "{n} מתוך {count} סיפורים"
},
"Sort stories": "מיון סיפורים",
"Newest": "החדשים ביותר",
"Longest": "הארוכים ביותר",
"A–Z": "א–ת",
"{count} filters on": {
"one": "מסנן {count} פעיל",
"two": "{count} מסננים פעילים",
"other": "{count} מסננים פעילים"
},
"Filters": "מסננים",
"Search stories": "חיפוש סיפורים",
"Search stories, places, creators": "חיפוש סיפורים, מקומות, יוצרים",
"Clear search": "ניקוי החיפוש",
"Topics": "נושאים",
"Filter stories": "סינון סיפורים",
"Show {count} stories": {
"one": "הצגת סיפור {count}",
"two": "הצגת {count} סיפורים",
"other": "הצגת {count} סיפורים"
},
"No stories match": "אין סיפורים תואמים",
"Try another word or clear the filters.": "נסה מילה אחרת או נקה את המסננים.",
"Clear all": "ניקוי הכול",
"STORY": "סיפור",
"Play {title}": "הפעלת {title}",
"Play story": "הפעלת הסיפור",
"Preview {title}": "תצוגה מקדימה של {title}",
"Click to preview": "לחץ לתצוגה מקדימה",
"Click to play": "לחץ להפעלה",
"Tap to play": "הקש להפעלה",
"Pick a story or a pin to preview it here": "בחר סיפור או סיכה כדי לראות תצוגה מקדימה כאן",
"Story": "סיפור",
"{what} link copied": "הקישור ל{what} הועתק",
"Copy this link: {url}": "העתק את הקישור: {url}",
"Back to stories": "חזרה לסיפורים",
"Back to the globe": "חזרה לגלובוס",
"Breadcrumb": "נתיב ניווט",
"Globe": "גלובוס",
"Share": "שיתוף",
"Back to GEV": "חזרה ל-GEV",
"Chapter {n}": "פרק {n}",
"Context. Swipe up or press to open": "הקשר. החלק למעלה או לחץ כדי לפתוח",
"Context. Swipe down or press to close": "הקשר. החלק למטה או לחץ כדי לסגור",
"Search this story": "חיפוש בסיפור הזה",
"Voice search (not in this build)": "חיפוש קולי (לא בגרסה הזאת)",
"Search results": "תוצאות חיפוש",
"Nothing in this story matches.": "אין התאמות בסיפור הזה.",
"Chapters": "פרקים",
"now": "עכשיו",
"About": "אודות",
"by {creator}": "מאת {creator}",
"Key moments": "רגעי מפתח",
"Sources": "מקורות",
"Background": "רקע",
"Related stories": "סיפורים קשורים",
"Story link copied": "הקישור לסיפור הועתק",
"You": "אתה",
"Open this moment in GEV": "פתיחת הרגע הזה ב-GEV",
"Open": "פתיחה",
"Share this story": "שיתוף הסיפור",
"GEV Story": "סיפור GEV",
"Story card": "כרטיס הסיפור",
"Chapter": "פרק",
"CHAPTER {n} / {total}": "פרק {n} / {total}",
"ON THE MAP": "על המפה",
"Right now": "ברגע זה",
"RIGHT NOW": "ברגע זה",
"Minimise card": "מזעור הכרטיס",
"Expand card": "הרחבת הכרטיס",
"Card pages": "דפי הכרטיס",
"Resize context panel": "שינוי גודל לוח ההקשר",
"Swipe up for context": "החלק למעלה להקשר",
"Chapter start": "תחילת הפרק",
"Resume story": "המשך הסיפור",
"Story time": "זמן הסיפור",
"chapter": "פרק",
"Key moment: {label}": "רגע מפתח: {label}",
"Jump to live": "מעבר לזמן אמת",
"Unmute": "ביטול השתקה",
"Mute": "השתקה",
"Exit expanded map": "יציאה מהמפה המורחבת",
"Expand map": "הרחבת המפה",
"Exit cockpit to open Stories": "צא מתא הטייס כדי לפתוח את הסיפורים",
"Stories could not load. Check the connection and try again.": "לא ניתן לטעון את הסיפורים. בדוק את החיבור ונסה שוב.",
"Shot {n} of {total}": "שוט {n} מתוך {total}",
"GEV scene": "סצנת GEV",
"No scene yet": "עדיין אין סצנה",
"SAVE TO STORIES": "שמירה ב-STORIES",
"REMOVE FROM STORIES": "הסרה מ-STORIES",
"Show this scene on the Stories page": "הצגת הסצנה בדף Stories",
"Take this scene off the Stories page": "הסרת הסצנה מדף Stories",
"Saved to Stories": "נשמרה ב-Stories",
"Removed from Stories": "הוסרה מ-Stories",
"A scene you made in GEV, played on the live globe.": "סצנה שיצרת ב-GEV, מוצגת על הגלובוס החי.",
"Floods": "שיטפונות",
"Wildfires": "שריפות יער",
"Storms": "סערות",
"Earthquakes": "רעידות אדמה",
"Maritime": "ימי",
"Space": "חלל",
"Conflict": "סכסוכים",
"Climate": "אקלים",
"Thumbnail could not be captured": "לא ניתן היה ללכוד את התמונה הממוזערת",
"Thumbnail captured": "התמונה הממוזערת נלכדה",
"Stories tags": "תגיות סיפורים",
"Story thumbnail": "תמונה ממוזערת של הסיפור",
"Use the current view as the Stories card image": "להשתמש בתצוגה הנוכחית כתמונת הכרטיס בסיפורים",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "מיקומי המטוסים מגיעים מ-ADS-B: תמונת המצב העולמית של OpenSky Network, ו-adsb.lol היכן שאין ל-OpenSky נתונים.",
"Live-flight fallback (ODbL 1.0)": "מקור גיבוי לטיסות חיות (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "מסלולי הלוויינים מחושבים מרכיבי המסלול העדכניים של CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "רעידות האדמה מגיעות מהפיד החי של הסקר הגאולוגי של ארה״ב.",
"Traffic": "תנועה",
"Road traffic; live congestion needs your own TomTom key.": "תנועה בכבישים; עומסי תנועה חיים דורשים מפתח TomTom משלך.",
"Live traffic flow, with your own key": "זרימת תנועה חיה, עם מפתח משלך",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "תנועה אווירית חיה ברחבי העולם: האוקיינוס האטלנטי, אירופה, יפן וסן פרנסיסקו.",
"The Atlantic": "האוקיינוס האטלנטי",
"Western Europe": "מערב אירופה",
"Japan": "יפן",
"San Francisco Bay Area": "אזור מפרץ סן פרנסיסקו",
"Pull back over the Atlantic": "התרחקות מעל האוקיינוס האטלנטי",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "לוויינים במסלול, נצפים מעל פלורידה, אפריקה, טוקיו ופריז.",
"Over Florida": "מעל פלורידה",
"Over Africa": "מעל אפריקה",
"Over Tokyo": "מעל טוקיו",
"Over Paris": "מעל פריז",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "רעידות אדמה אחרונות במראה התרמי: קליפורניה, יפן, ניו זילנד ומול חופי פורטוגל.",
"California": "קליפורניה",
"New Zealand": "ניו זילנד",
"Off Portugal": "מול חופי פורטוגל",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "טיסות, לוויינים ותנועה יחד מעל ניו יורק, לוס אנג׳לס ולונדון.",
"New York, closer": "ניו יורק, קרוב יותר",
"New York, closer still": "ניו יורק, קרוב עוד יותר",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "כל השכבות החיות בבת אחת, בהתרחקות מטוקיו אל כל כדור הארץ.",
"Tokyo, pulling back": "טוקיו, בהתרחקות",
"Japan and East Asia": "יפן ומזרח אסיה",
"South China Sea": "ים סין הדרומי",
"The whole globe": "כל הגלובוס",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "שיטפון הפריצה ב-Bhote Koshi בנפאל ב-26 באוגוסט 2026, במורד העמק עד Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "מסלול השיטפון המשוחזר (CC BY-NC 4.0)",
"THUMBNAIL": "תמונה ממוזערת",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "תמונת מצב עולמית של טיסות חיות (רישיון למחקר וחינוך שלא למטרות מסחריות)",
"Satellite element sets and catalogue (U.S. government data)": "רכיבי מסלול וקטלוג לוויינים (נתוני ממשלת ארה\"ב)",
"Satellite operators, owners and purposes": "מפעילי לוויינים, בעליהם ומטרותיהם",
"Earthquake feed (U.S. public domain)": "פיד רעידות אדמה (נחלת הכלל בארה\"ב)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "תצלומי לוויין היסטוריים ומלאחר האירוע (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "הדמיה של שיטפון הפריצה ב-Bhote Koshi ב-26 באוגוסט 2026, ולא מודל סיכונים רשמי. המראות ההיסטוריים (2021) ומלאחר האירוע הם צילומי Vantor WorldView; מסלול הנהר הוא השחזור של GeoPera. קטעי העדים מקשרים לפוסטים המקוריים שלהם, וזמני הצילום שלהם לא אומתו.",
"That story is not available here": "הסיפור הזה אינו זמין כאן",
"DRAFT": "טיוטה",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "טיוטה שעדיין לא נשמרה כסיפור. השתמשו ב„שמירה ב-STORIES” ב„יצירה” כדי לשמור אותה."
}
+178 -2
View File
@@ -3174,7 +3174,6 @@
"AUTHORING": "CREAZIONE",
"Create and edit scenes": "Crea e modifica le scene",
"SCENE": "SCENA",
"Scene": "Scena",
"NEW SCENE": "NUOVA SCENA",
"Start a new, empty scene": "Inizia una nuova scena vuota",
"DELETE": "ELIMINA",
@@ -3719,5 +3718,182 @@
"Search layers…": "Cerca livelli…",
"Layer groups": "Gruppi di livelli",
"Jump to {name}": "Vai a {name}",
"No layers match": "Nessun livello corrisponde"
"No layers match": "Nessun livello corrisponde",
"A GEV scene, played on the live globe.": "Una scena GEV, riprodotta sul globo live.",
"Drag the map to explore · Resume any time": "Trascina la mappa per esplorare · Riprendi quando vuoi",
"Region": "Regione",
"Europe": "Europa",
"Middle East": "Medio Oriente",
"South Asia": "Asia meridionale",
"East Asia": "Asia orientale",
"Length": "Durata",
"Under 1 min": "Meno di 1 min",
"1 min or more": "1 min o più",
"Shots": "Inquadrature",
"Layers on": "Livelli attivi",
"Stories": "Storie",
"NEW": "NUOVO",
"GEV Stories": "Storie GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Viste interattive e selezionate di ciò che accade sulla Terra. Avviane una, prendi il controllo della mappa quando vuoi, poi riprendi la storia.",
"Browse stories": "Sfoglia le storie",
"Not now": "Non ora",
"Opened in GEV": "Aperto in GEV",
"Back to story": "Torna alla storia",
"GEV Stories explore": "Esplora Storie GEV",
"Resize story list": "Ridimensiona l'elenco delle storie",
"Story list size. Drag, or press to change": "Dimensione dell'elenco delle storie. Trascina o premi per cambiarla",
"{n} of {count} stories": {
"one": "{n} di {count} storia",
"many": "{n} di {count} di storie",
"other": "{n} di {count} storie"
},
"Sort stories": "Ordina le storie",
"Newest": "Più recenti",
"Longest": "Più lunghe",
"A–Z": "A–Z",
"{count} filters on": {
"one": "{count} filtro attivo",
"many": "{count} di filtri attivi",
"other": "{count} filtri attivi"
},
"Filters": "Filtri",
"Search stories": "Cerca storie",
"Search stories, places, creators": "Cerca storie, luoghi, autori",
"Clear search": "Cancella ricerca",
"Topics": "Argomenti",
"Filter stories": "Filtra le storie",
"Show {count} stories": {
"one": "Mostra {count} storia",
"many": "Mostra {count} di storie",
"other": "Mostra {count} storie"
},
"No stories match": "Nessuna storia corrisponde",
"Try another word or clear the filters.": "Prova con un'altra parola o cancella i filtri.",
"Clear all": "Cancella tutto",
"STORY": "STORIA",
"Play {title}": "Riproduci {title}",
"Play story": "Riproduci la storia",
"Preview {title}": "Anteprima di {title}",
"Click to preview": "Fai clic per l'anteprima",
"Click to play": "Fai clic per riprodurre",
"Tap to play": "Tocca per riprodurre",
"Pick a story or a pin to preview it here": "Scegli una storia o un segnaposto per vederne l'anteprima qui",
"Story": "Storia",
"{what} link copied": "Link di {what} copiato",
"Copy this link: {url}": "Copia questo link: {url}",
"Back to stories": "Torna alle storie",
"Back to the globe": "Torna al globo",
"Breadcrumb": "Percorso di navigazione",
"Globe": "Globo",
"Share": "Condividi",
"Back to GEV": "Torna a GEV",
"Chapter {n}": "Capitolo {n}",
"Context. Swipe up or press to open": "Contesto. Scorri verso l'alto o premi per aprire",
"Context. Swipe down or press to close": "Contesto. Scorri verso il basso o premi per chiudere",
"Search this story": "Cerca in questa storia",
"Voice search (not in this build)": "Ricerca vocale (non in questa build)",
"Search results": "Risultati della ricerca",
"Nothing in this story matches.": "Nulla in questa storia corrisponde.",
"Chapters": "Capitoli",
"now": "ora",
"About": "Informazioni",
"by {creator}": "di {creator}",
"Key moments": "Momenti chiave",
"Sources": "Fonti",
"Background": "Contesto",
"Related stories": "Storie correlate",
"Story link copied": "Link della storia copiato",
"You": "Tu",
"Open this moment in GEV": "Apri questo momento in GEV",
"Open": "Apri",
"Share this story": "Condividi questa storia",
"GEV Story": "Storia GEV",
"Story card": "Scheda della storia",
"Chapter": "Capitolo",
"CHAPTER {n} / {total}": "CAPITOLO {n} / {total}",
"ON THE MAP": "SULLA MAPPA",
"Right now": "In questo momento",
"RIGHT NOW": "IN QUESTO MOMENTO",
"Minimise card": "Riduci la scheda",
"Expand card": "Espandi la scheda",
"Card pages": "Pagine della scheda",
"Resize context panel": "Ridimensiona il pannello contesto",
"Swipe up for context": "Scorri verso l'alto per il contesto",
"Chapter start": "Inizio del capitolo",
"Resume story": "Riprendi la storia",
"Story time": "Ora della storia",
"chapter": "capitolo",
"Key moment: {label}": "Momento chiave: {label}",
"Jump to live": "Vai alla diretta",
"Unmute": "Riattiva audio",
"Mute": "Disattiva audio",
"Exit expanded map": "Esci dalla mappa espansa",
"Expand map": "Espandi la mappa",
"Exit cockpit to open Stories": "Esci dal cockpit per aprire le Storie",
"Stories could not load. Check the connection and try again.": "Impossibile caricare le Storie. Controlla la connessione e riprova.",
"Shot {n} of {total}": "Scatto {n} di {total}",
"GEV scene": "Scena GEV",
"No scene yet": "Ancora nessuna scena",
"SAVE TO STORIES": "SALVA IN STORIES",
"REMOVE FROM STORIES": "RIMUOVI DA STORIES",
"Show this scene on the Stories page": "Mostra questa scena nella pagina Stories",
"Take this scene off the Stories page": "Togli questa scena dalla pagina Stories",
"Saved to Stories": "Salvata in Stories",
"Removed from Stories": "Rimossa da Stories",
"A scene you made in GEV, played on the live globe.": "Una scena che hai creato in GEV, riprodotta sul globo dal vivo.",
"Floods": "Alluvioni",
"Wildfires": "Incendi boschivi",
"Storms": "Tempeste",
"Earthquakes": "Terremoti",
"Maritime": "Marittimo",
"Space": "Spazio",
"Conflict": "Conflitti",
"Climate": "Clima",
"Thumbnail could not be captured": "Impossibile acquisire la miniatura",
"Thumbnail captured": "Miniatura acquisita",
"Stories tags": "Tag delle Stories",
"Story thumbnail": "Miniatura della storia",
"Use the current view as the Stories card image": "Usa la vista attuale come immagine della scheda nelle Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Le posizioni degli aerei provengono dall'ADS-B: lo snapshot mondiale di OpenSky Network, con adsb.lol dove OpenSky non ha dati.",
"Live-flight fallback (ODbL 1.0)": "Fonte di riserva per i voli live (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Le orbite dei satelliti sono calcolate dagli elementi orbitali attuali di CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "I terremoti provengono dal feed live dell'U.S. Geological Survey.",
"Traffic": "Traffico",
"Road traffic; live congestion needs your own TomTom key.": "Traffico stradale; la congestione live richiede una tua chiave TomTom.",
"Live traffic flow, with your own key": "Flusso del traffico live, con una tua chiave",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Traffico aereo live in tutto il mondo: l'Atlantico, l'Europa, il Giappone e San Francisco.",
"The Atlantic": "L'Atlantico",
"Western Europe": "Europa occidentale",
"Japan": "Giappone",
"San Francisco Bay Area": "Baia di San Francisco",
"Pull back over the Atlantic": "Allontanarsi sopra l'Atlantico",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Satelliti in orbita, osservati sopra la Florida, l'Africa, Tokyo e Parigi.",
"Over Florida": "Sopra la Florida",
"Over Africa": "Sopra l'Africa",
"Over Tokyo": "Sopra Tokyo",
"Over Paris": "Sopra Parigi",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Terremoti recenti nella vista termica: California, Giappone, Nuova Zelanda e al largo del Portogallo.",
"California": "California",
"New Zealand": "Nuova Zelanda",
"Off Portugal": "Al largo del Portogallo",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Voli, satelliti e traffico insieme sopra New York, Los Angeles e Londra.",
"New York, closer": "New York, più vicino",
"New York, closer still": "New York, ancora più vicino",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Tutti i livelli live insieme, allontanandosi da Tokyo fino all'intero pianeta.",
"Tokyo, pulling back": "Tokyo, allontanandosi",
"Japan and East Asia": "Giappone e Asia orientale",
"South China Sea": "Mar Cinese Meridionale",
"The whole globe": "L'intero globo",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "L'alluvione da rottura del Bhote Koshi del 26 agosto 2026 in Nepal, seguita giù per la valle fino a Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Percorso ricostruito dell'alluvione (CC BY-NC 4.0)",
"THUMBNAIL": "MINIATURA",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Snapshot mondiale dei voli live (licenza non commerciale per ricerca e istruzione)",
"Satellite element sets and catalogue (U.S. government data)": "Elementi orbitali e catalogo dei satelliti (dati del governo degli Stati Uniti)",
"Satellite operators, owners and purposes": "Operatori, proprietari e finalità dei satelliti",
"Earthquake feed (U.S. public domain)": "Feed dei terremoti (pubblico dominio negli Stati Uniti)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Immagini satellitari storiche e successive all'evento (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Una visualizzazione dell'alluvione da rottura del Bhote Koshi del 26 agosto 2026, non un modello ufficiale di pericolosità. Le viste storiche (2021) e successive all'evento sono immagini Vantor WorldView; il percorso del fiume è la ricostruzione di GeoPera. I video dei testimoni rimandano ai post originali, e i loro orari di ripresa non sono verificati.",
"That story is not available here": "Questa storia non è disponibile qui",
"DRAFT": "BOZZA",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Una bozza, non ancora salvata come storia. Usa SALVA IN STORIES in CREAZIONE per salvarla."
}
+172 -2
View File
@@ -3024,7 +3024,6 @@
"AUTHORING": "シーン作成",
"Create and edit scenes": "シーンを作成・編集",
"SCENE": "シーン",
"Scene": "シーン",
"NEW SCENE": "新規シーン",
"Start a new, empty scene": "空の新しいシーンを作成",
"DELETE": "削除",
@@ -3545,5 +3544,176 @@
"Search layers…": "レイヤーを検索…",
"Layer groups": "レイヤーのグループ",
"Jump to {name}": "{name} へ移動",
"No layers match": "一致するレイヤーはありません"
"No layers match": "一致するレイヤーはありません",
"A GEV scene, played on the live globe.": "ライブの地球儀で再生する GEV シーン。",
"Drag the map to explore · Resume any time": "地図をドラッグして探索 · いつでも再開できます",
"Region": "地域",
"Europe": "ヨーロッパ",
"Middle East": "中東",
"South Asia": "南アジア",
"East Asia": "東アジア",
"Length": "長さ",
"Under 1 min": "1分未満",
"1 min or more": "1分以上",
"Shots": "ショット",
"Layers on": "オンのレイヤー",
"Stories": "ストーリー",
"NEW": "新着",
"GEV Stories": "GEV ストーリー",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "地球で起きていることを厳選して伝えるインタラクティブなビュー。再生中いつでも地図を自由に操作し、またストーリーに戻れます。",
"Browse stories": "ストーリーを見る",
"Not now": "後で",
"Opened in GEV": "GEV で開きました",
"Back to story": "ストーリーに戻る",
"GEV Stories explore": "GEV ストーリーを探す",
"Resize story list": "ストーリー一覧のサイズを変更",
"Story list size. Drag, or press to change": "ストーリー一覧のサイズ。ドラッグするか押して変更",
"{n} of {count} stories": {
"other": "{count}件中 {n}件のストーリー"
},
"Sort stories": "ストーリーを並べ替え",
"Newest": "新しい順",
"Longest": "長い順",
"A–Z": "名前順",
"{count} filters on": {
"other": "{count}件のフィルター適用中"
},
"Filters": "フィルター",
"Search stories": "ストーリーを検索",
"Search stories, places, creators": "ストーリー、場所、作成者を検索",
"Clear search": "検索をクリア",
"Topics": "トピック",
"Filter stories": "ストーリーを絞り込む",
"Show {count} stories": {
"other": "{count}件のストーリーを表示"
},
"No stories match": "一致するストーリーはありません",
"Try another word or clear the filters.": "別の語句を試すか、フィルターをクリアしてください。",
"Clear all": "すべてクリア",
"STORY": "ストーリー",
"Play {title}": "{title}を再生",
"Play story": "ストーリーを再生",
"Preview {title}": "{title}をプレビュー",
"Click to preview": "クリックでプレビュー",
"Click to play": "クリックで再生",
"Tap to play": "タップで再生",
"Pick a story or a pin to preview it here": "ストーリーかピンを選ぶと、ここでプレビューできます",
"Story": "ストーリー",
"{what} link copied": "{what}のリンクをコピーしました",
"Copy this link: {url}": "このリンクをコピー: {url}",
"Back to stories": "ストーリー一覧に戻る",
"Back to the globe": "地球儀に戻る",
"Breadcrumb": "パンくずリスト",
"Globe": "地球儀",
"Share": "共有",
"Back to GEV": "GEV に戻る",
"Chapter {n}": "第{n}章",
"Context. Swipe up or press to open": "コンテキスト。上にスワイプするか押して開く",
"Context. Swipe down or press to close": "コンテキスト。下にスワイプするか押して閉じる",
"Search this story": "このストーリー内を検索",
"Voice search (not in this build)": "音声検索 (このビルドでは未対応)",
"Search results": "検索結果",
"Nothing in this story matches.": "このストーリーに一致するものはありません。",
"Chapters": "章",
"now": "現在",
"About": "概要",
"by {creator}": "作成者: {creator}",
"Key moments": "重要な場面",
"Sources": "出典",
"Background": "背景",
"Related stories": "関連ストーリー",
"Story link copied": "ストーリーのリンクをコピーしました",
"You": "あなた",
"Open this moment in GEV": "この場面を GEV で開く",
"Open": "開く",
"Share this story": "このストーリーを共有",
"GEV Story": "GEV ストーリー",
"Story card": "ストーリーカード",
"Chapter": "章",
"CHAPTER {n} / {total}": "第{n}章 / {total}",
"ON THE MAP": "地図上",
"Right now": "現在",
"RIGHT NOW": "現在",
"Minimise card": "カードを最小化",
"Expand card": "カードを展開",
"Card pages": "カードのページ",
"Resize context panel": "コンテキストパネルのサイズを変更",
"Swipe up for context": "上にスワイプしてコンテキストを表示",
"Chapter start": "章の始まり",
"Resume story": "ストーリーを再開",
"Story time": "ストーリー時刻",
"chapter": "章",
"Key moment: {label}": "重要な場面: {label}",
"Jump to live": "ライブに移動",
"Unmute": "ミュート解除",
"Mute": "ミュート",
"Exit expanded map": "拡大地図を終了",
"Expand map": "地図を拡大",
"Exit cockpit to open Stories": "ストーリーを開くにはコックピットを終了してください",
"Stories could not load. Check the connection and try again.": "ストーリーを読み込めませんでした。接続を確認して、もう一度お試しください。",
"Shot {n} of {total}": "ショット {n}/{total}",
"GEV scene": "GEVシーン",
"No scene yet": "シーンはまだありません",
"SAVE TO STORIES": "STORIESに保存",
"REMOVE FROM STORIES": "STORIESから外す",
"Show this scene on the Stories page": "このシーンをStoriesページに表示",
"Take this scene off the Stories page": "このシーンをStoriesページから外す",
"Saved to Stories": "Storiesに保存しました",
"Removed from Stories": "Storiesから外しました",
"A scene you made in GEV, played on the live globe.": "GEV で作成したシーン。ライブの地球儀で再生します。",
"Floods": "洪水",
"Wildfires": "山火事",
"Storms": "暴風雨",
"Earthquakes": "地震",
"Maritime": "海事",
"Space": "宇宙",
"Conflict": "紛争",
"Climate": "気候",
"Thumbnail could not be captured": "サムネイルを取得できませんでした",
"Thumbnail captured": "サムネイルを取得しました",
"Stories tags": "ストーリーのタグ",
"Story thumbnail": "ストーリーのサムネイル",
"Use the current view as the Stories card image": "現在の表示をストーリーカードの画像にする",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "航空機の位置は ADS-B から取得します。OpenSky Network の全世界スナップショットを使い、OpenSky にデータがない場所は adsb.lol で補います。",
"Live-flight fallback (ODbL 1.0)": "ライブフライトの代替ソース (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "衛星の軌道は CelesTrak の最新の軌道要素から計算します。",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "地震は米国地質調査所 (USGS) のライブフィードから取得します。",
"Traffic": "交通",
"Road traffic; live congestion needs your own TomTom key.": "道路交通。ライブの渋滞情報には自分の TomTom キーが必要です。",
"Live traffic flow, with your own key": "ライブの交通流 (自分のキーを使用)",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "世界のライブ航空交通:大西洋、ヨーロッパ、日本、サンフランシスコ。",
"The Atlantic": "大西洋",
"Western Europe": "西ヨーロッパ",
"Japan": "日本",
"San Francisco Bay Area": "サンフランシスコ・ベイエリア",
"Pull back over the Atlantic": "大西洋上空で引きの視点へ",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "軌道上の衛星を、フロリダ、アフリカ、東京、パリの上空から見る。",
"Over Florida": "フロリダ上空",
"Over Africa": "アフリカ上空",
"Over Tokyo": "東京上空",
"Over Paris": "パリ上空",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "サーマル表示で見る最近の地震:カリフォルニア、日本、ニュージーランド、ポルトガル沖。",
"California": "カリフォルニア",
"New Zealand": "ニュージーランド",
"Off Portugal": "ポルトガル沖",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "ニューヨーク、ロサンゼルス、ロンドン上空のフライト、衛星、交通をまとめて表示。",
"New York, closer": "ニューヨーク、さらに近く",
"New York, closer still": "ニューヨーク、もっと近く",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "すべてのライブレイヤーを同時に表示し、東京から地球全体へ引いていく。",
"Tokyo, pulling back": "東京から引いていく",
"Japan and East Asia": "日本と東アジア",
"South China Sea": "南シナ海",
"The whole globe": "地球全体",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "2026年8月26日にネパールで起きた Bhote Koshi の決壊洪水を、谷を下って Trishuli まで追う。",
"Reconstructed flood path (CC BY-NC 4.0)": "再現した洪水の経路 (CC BY-NC 4.0)",
"THUMBNAIL": "サムネイル",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "全世界のライブフライトのスナップショット (非商用の研究・教育ライセンス)",
"Satellite element sets and catalogue (U.S. government data)": "衛星の軌道要素とカタログ (米国政府データ)",
"Satellite operators, owners and purposes": "衛星の運用者、所有者、用途",
"Earthquake feed (U.S. public domain)": "地震フィード (米国のパブリックドメイン)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "過去および事後の衛星画像 (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "2026年8月26日の Bhote Koshi 決壊洪水の可視化であり、公式のハザードモデルではありません。過去 (2021年) と事後の画像は Vantor WorldView の画像で、川の経路は GeoPera による再現です。目撃者の動画は元の投稿にリンクしており、撮影時刻は検証されていません。",
"That story is not available here": "そのストーリーはここでは利用できません",
"DRAFT": "下書き",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "まだストーリーとして保存されていない下書きです。シーン作成の「STORIESに保存」で保存できます。"
}
+178 -2
View File
@@ -3174,7 +3174,6 @@
"AUTHORING": "CRIAÇÃO",
"Create and edit scenes": "Criar e editar cenas",
"SCENE": "CENA",
"Scene": "Cena",
"NEW SCENE": "NOVA CENA",
"Start a new, empty scene": "Começar uma nova cena vazia",
"DELETE": "EXCLUIR",
@@ -3719,5 +3718,182 @@
"Search layers…": "Pesquisar camadas…",
"Layer groups": "Grupos de camadas",
"Jump to {name}": "Ir para {name}",
"No layers match": "Nenhuma camada corresponde"
"No layers match": "Nenhuma camada corresponde",
"A GEV scene, played on the live globe.": "Uma cena do GEV, reproduzida no globo ao vivo.",
"Drag the map to explore · Resume any time": "Arraste o mapa para explorar · Retome quando quiser",
"Region": "Região",
"Europe": "Europa",
"Middle East": "Oriente Médio",
"South Asia": "Sul da Ásia",
"East Asia": "Leste Asiático",
"Length": "Duração",
"Under 1 min": "Menos de 1 min",
"1 min or more": "1 min ou mais",
"Shots": "Planos",
"Layers on": "Camadas ativas",
"Stories": "Histórias",
"NEW": "NOVO",
"GEV Stories": "Histórias do GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Visões interativas e selecionadas do que está acontecendo na Terra. Reproduza uma, assuma o mapa quando quiser e depois retome a história.",
"Browse stories": "Explorar histórias",
"Not now": "Agora não",
"Opened in GEV": "Aberto no GEV",
"Back to story": "Voltar à história",
"GEV Stories explore": "Explorar Histórias do GEV",
"Resize story list": "Redimensionar a lista de histórias",
"Story list size. Drag, or press to change": "Tamanho da lista de histórias. Arraste ou pressione para alterar",
"{n} of {count} stories": {
"one": "{n} de {count} história",
"many": "{n} de {count} de histórias",
"other": "{n} de {count} histórias"
},
"Sort stories": "Ordenar histórias",
"Newest": "Mais recentes",
"Longest": "Mais longas",
"A–Z": "A–Z",
"{count} filters on": {
"one": "{count} filtro ativo",
"many": "{count} de filtros ativos",
"other": "{count} filtros ativos"
},
"Filters": "Filtros",
"Search stories": "Buscar histórias",
"Search stories, places, creators": "Buscar histórias, lugares, criadores",
"Clear search": "Limpar busca",
"Topics": "Temas",
"Filter stories": "Filtrar histórias",
"Show {count} stories": {
"one": "Mostrar {count} história",
"many": "Mostrar {count} de histórias",
"other": "Mostrar {count} histórias"
},
"No stories match": "Nenhuma história corresponde",
"Try another word or clear the filters.": "Tente outra palavra ou limpe os filtros.",
"Clear all": "Limpar tudo",
"STORY": "HISTÓRIA",
"Play {title}": "Reproduzir {title}",
"Play story": "Reproduzir história",
"Preview {title}": "Prévia de {title}",
"Click to preview": "Clique para ver a prévia",
"Click to play": "Clique para reproduzir",
"Tap to play": "Toque para reproduzir",
"Pick a story or a pin to preview it here": "Escolha uma história ou um marcador para ver a prévia aqui",
"Story": "História",
"{what} link copied": "Link de {what} copiado",
"Copy this link: {url}": "Copie este link: {url}",
"Back to stories": "Voltar às histórias",
"Back to the globe": "Voltar ao globo",
"Breadcrumb": "Trilha de navegação",
"Globe": "Globo",
"Share": "Compartilhar",
"Back to GEV": "Voltar ao GEV",
"Chapter {n}": "Capítulo {n}",
"Context. Swipe up or press to open": "Contexto. Deslize para cima ou pressione para abrir",
"Context. Swipe down or press to close": "Contexto. Deslize para baixo ou pressione para fechar",
"Search this story": "Buscar nesta história",
"Voice search (not in this build)": "Busca por voz (não disponível nesta versão)",
"Search results": "Resultados da busca",
"Nothing in this story matches.": "Nada nesta história corresponde.",
"Chapters": "Capítulos",
"now": "agora",
"About": "Sobre",
"by {creator}": "por {creator}",
"Key moments": "Momentos-chave",
"Sources": "Fontes",
"Background": "Contexto",
"Related stories": "Histórias relacionadas",
"Story link copied": "Link da história copiado",
"You": "Você",
"Open this moment in GEV": "Abrir este momento no GEV",
"Open": "Abrir",
"Share this story": "Compartilhar esta história",
"GEV Story": "História do GEV",
"Story card": "Cartão da história",
"Chapter": "Capítulo",
"CHAPTER {n} / {total}": "CAPÍTULO {n} / {total}",
"ON THE MAP": "NO MAPA",
"Right now": "Agora mesmo",
"RIGHT NOW": "AGORA MESMO",
"Minimise card": "Minimizar cartão",
"Expand card": "Ampliar cartão",
"Card pages": "Páginas do cartão",
"Resize context panel": "Redimensionar o painel de contexto",
"Swipe up for context": "Deslize para cima para ver o contexto",
"Chapter start": "Início do capítulo",
"Resume story": "Retomar história",
"Story time": "Horário da história",
"chapter": "capítulo",
"Key moment: {label}": "Momento-chave: {label}",
"Jump to live": "Ir para o ao vivo",
"Unmute": "Ativar som",
"Mute": "Silenciar",
"Exit expanded map": "Sair do mapa ampliado",
"Expand map": "Ampliar mapa",
"Exit cockpit to open Stories": "Saia da cabine para abrir Histórias",
"Stories could not load. Check the connection and try again.": "Não foi possível carregar as Histórias. Verifique a conexão e tente novamente.",
"Shot {n} of {total}": "Plano {n} de {total}",
"GEV scene": "Cena do GEV",
"No scene yet": "Nenhuma cena ainda",
"SAVE TO STORIES": "SALVAR EM STORIES",
"REMOVE FROM STORIES": "REMOVER DE STORIES",
"Show this scene on the Stories page": "Mostrar esta cena na página Stories",
"Take this scene off the Stories page": "Tirar esta cena da página Stories",
"Saved to Stories": "Salva em Stories",
"Removed from Stories": "Removida de Stories",
"A scene you made in GEV, played on the live globe.": "Uma cena que você criou no GEV, reproduzida no globo ao vivo.",
"Floods": "Inundações",
"Wildfires": "Incêndios florestais",
"Storms": "Tempestades",
"Earthquakes": "Terremotos",
"Maritime": "Marítimo",
"Space": "Espaço",
"Conflict": "Conflitos",
"Climate": "Clima",
"Thumbnail could not be captured": "Não foi possível capturar a miniatura",
"Thumbnail captured": "Miniatura capturada",
"Stories tags": "Tags do Stories",
"Story thumbnail": "Miniatura da história",
"Use the current view as the Stories card image": "Usar a vista atual como imagem do cartão no Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "As posições das aeronaves vêm do ADS-B: o instantâneo mundial da OpenSky Network, com o adsb.lol onde a OpenSky não tem dados.",
"Live-flight fallback (ODbL 1.0)": "Alternativa para voos ao vivo (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "As órbitas dos satélites são calculadas a partir dos elementos orbitais atuais da CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Os terremotos vêm do feed ao vivo do Serviço Geológico dos EUA.",
"Traffic": "Trânsito",
"Road traffic; live congestion needs your own TomTom key.": "Trânsito nas ruas; o congestionamento ao vivo requer sua própria chave da TomTom.",
"Live traffic flow, with your own key": "Fluxo de trânsito ao vivo, com sua própria chave",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Tráfego aéreo ao vivo pelo mundo: o Atlântico, a Europa, o Japão e San Francisco.",
"The Atlantic": "O Atlântico",
"Western Europe": "Europa Ocidental",
"Japan": "Japão",
"San Francisco Bay Area": "Baía de San Francisco",
"Pull back over the Atlantic": "Afastar sobre o Atlântico",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Satélites em órbita, vistos sobre a Flórida, a África, Tóquio e Paris.",
"Over Florida": "Sobre a Flórida",
"Over Africa": "Sobre a África",
"Over Tokyo": "Sobre Tóquio",
"Over Paris": "Sobre Paris",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Terremotos recentes na visão térmica: Califórnia, Japão, Nova Zelândia e ao largo de Portugal.",
"California": "Califórnia",
"New Zealand": "Nova Zelândia",
"Off Portugal": "Ao largo de Portugal",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Voos, satélites e trânsito juntos sobre Nova York, Los Angeles e Londres.",
"New York, closer": "Nova York, mais perto",
"New York, closer still": "Nova York, ainda mais perto",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Todas as camadas ao vivo de uma vez, afastando-se de Tóquio até o planeta inteiro.",
"Tokyo, pulling back": "Tóquio, afastando-se",
"Japan and East Asia": "Japão e Leste Asiático",
"South China Sea": "Mar da China Meridional",
"The whole globe": "O globo inteiro",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "A inundação por rompimento do Bhote Koshi de 26 de agosto de 2026 no Nepal, acompanhada vale abaixo até Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Trajeto reconstruído da inundação (CC BY-NC 4.0)",
"THUMBNAIL": "MINIATURA",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Instantâneo mundial de voos ao vivo (licença não comercial para pesquisa e educação)",
"Satellite element sets and catalogue (U.S. government data)": "Elementos orbitais e catálogo de satélites (dados do governo dos EUA)",
"Satellite operators, owners and purposes": "Operadores, proprietários e finalidades dos satélites",
"Earthquake feed (U.S. public domain)": "Feed de terremotos (domínio público nos EUA)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Imagens de satélite históricas e pós-evento (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Uma visualização da inundação por rompimento do Bhote Koshi de 26 de agosto de 2026, não um modelo oficial de risco. As vistas históricas (2021) e pós-evento são imagens Vantor WorldView; o trajeto do rio é a reconstrução da GeoPera. Os vídeos de testemunhas levam às publicações originais, e os horários de captura não foram verificados.",
"That story is not available here": "Essa história não está disponível aqui",
"DRAFT": "RASCUNHO",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Um rascunho, ainda não salvo como história. Use SALVAR EM STORIES em CRIAÇÃO para salvá-lo."
}
+181 -2
View File
@@ -3269,7 +3269,6 @@
"AUTHORING": "РЕДАКТОР",
"Create and edit scenes": "Создание и редактирование сцен",
"SCENE": "СЦЕНА",
"Scene": "Сцена",
"NEW SCENE": "НОВАЯ СЦЕНА",
"Start a new, empty scene": "Создать новую пустую сцену",
"DELETE": "УДАЛИТЬ",
@@ -3806,5 +3805,185 @@
"Search layers…": "Поиск слоёв…",
"Layer groups": "Группы слоёв",
"Jump to {name}": "Перейти к «{name}»",
"No layers match": "Нет подходящих слоёв"
"No layers match": "Нет подходящих слоёв",
"A GEV scene, played on the live globe.": "Сцена GEV, воспроизводимая на живом глобусе.",
"Drag the map to explore · Resume any time": "Перетаскивайте карту для обзора · Продолжить можно в любой момент",
"Region": "Регион",
"Europe": "Европа",
"Middle East": "Ближний Восток",
"South Asia": "Южная Азия",
"East Asia": "Восточная Азия",
"Length": "Длительность",
"Under 1 min": "Меньше 1 мин",
"1 min or more": "1 мин и больше",
"Shots": "Кадры",
"Layers on": "Включённые слои",
"Stories": "Истории",
"NEW": "НОВОЕ",
"GEV Stories": "Истории GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Подобранные интерактивные обзоры того, что происходит на Земле. Запустите историю, берите карту под свой контроль когда угодно, а затем продолжите просмотр.",
"Browse stories": "Смотреть истории",
"Not now": "Не сейчас",
"Opened in GEV": "Открыто в GEV",
"Back to story": "Назад к истории",
"GEV Stories explore": "Обзор историй GEV",
"Resize story list": "Изменить размер списка историй",
"Story list size. Drag, or press to change": "Размер списка историй. Перетащите или нажмите, чтобы изменить",
"{n} of {count} stories": {
"one": "{n} из {count} истории",
"few": "{n} из {count} историй",
"many": "{n} из {count} историй",
"other": "{n} из {count} истории"
},
"Sort stories": "Сортировка историй",
"Newest": "Новые",
"Longest": "Самые длинные",
"A–Z": "А–Я",
"{count} filters on": {
"one": "{count} фильтр включён",
"few": "{count} фильтра включено",
"many": "{count} фильтров включено",
"other": "{count} фильтра включено"
},
"Filters": "Фильтры",
"Search stories": "Поиск историй",
"Search stories, places, creators": "Поиск историй, мест, авторов",
"Clear search": "Очистить поиск",
"Topics": "Темы",
"Filter stories": "Фильтр историй",
"Show {count} stories": {
"one": "Показать {count} историю",
"few": "Показать {count} истории",
"many": "Показать {count} историй",
"other": "Показать {count} истории"
},
"No stories match": "Нет подходящих историй",
"Try another word or clear the filters.": "Попробуйте другое слово или сбросьте фильтры.",
"Clear all": "Сбросить всё",
"STORY": "ИСТОРИЯ",
"Play {title}": "Воспроизвести: {title}",
"Play story": "Воспроизвести историю",
"Preview {title}": "Предпросмотр: {title}",
"Click to preview": "Нажмите для предпросмотра",
"Click to play": "Нажмите для воспроизведения",
"Tap to play": "Коснитесь для воспроизведения",
"Pick a story or a pin to preview it here": "Выберите историю или метку, чтобы посмотреть её здесь",
"Story": "История",
"{what} link copied": "Ссылка скопирована: {what}",
"Copy this link: {url}": "Скопируйте эту ссылку: {url}",
"Back to stories": "Назад к историям",
"Back to the globe": "Назад к глобусу",
"Breadcrumb": "Навигационная цепочка",
"Globe": "Глобус",
"Share": "Поделиться",
"Back to GEV": "Назад в GEV",
"Chapter {n}": "Глава {n}",
"Context. Swipe up or press to open": "Контекст. Проведите вверх или нажмите, чтобы открыть",
"Context. Swipe down or press to close": "Контекст. Проведите вниз или нажмите, чтобы закрыть",
"Search this story": "Поиск по истории",
"Voice search (not in this build)": "Голосовой поиск (нет в этой сборке)",
"Search results": "Результаты поиска",
"Nothing in this story matches.": "В этой истории ничего не найдено.",
"Chapters": "Главы",
"now": "сейчас",
"About": "Об истории",
"by {creator}": "автор: {creator}",
"Key moments": "Ключевые моменты",
"Sources": "Источники",
"Background": "Предыстория",
"Related stories": "Похожие истории",
"Story link copied": "Ссылка на историю скопирована",
"You": "Вы",
"Open this moment in GEV": "Открыть этот момент в GEV",
"Open": "Открыть",
"Share this story": "Поделиться историей",
"GEV Story": "История GEV",
"Story card": "Карточка истории",
"Chapter": "Глава",
"CHAPTER {n} / {total}": "ГЛАВА {n} / {total}",
"ON THE MAP": "НА КАРТЕ",
"Right now": "Прямо сейчас",
"RIGHT NOW": "ПРЯМО СЕЙЧАС",
"Minimise card": "Свернуть карточку",
"Expand card": "Развернуть карточку",
"Card pages": "Страницы карточки",
"Resize context panel": "Изменить размер панели контекста",
"Swipe up for context": "Проведите вверх, чтобы увидеть контекст",
"Chapter start": "Начало главы",
"Resume story": "Продолжить историю",
"Story time": "Время истории",
"chapter": "глава",
"Key moment: {label}": "Ключевой момент: {label}",
"Jump to live": "К реальному времени",
"Unmute": "Включить звук",
"Mute": "Выключить звук",
"Exit expanded map": "Выйти из развёрнутой карты",
"Expand map": "Развернуть карту",
"Exit cockpit to open Stories": "Выйдите из кабины, чтобы открыть Истории",
"Stories could not load. Check the connection and try again.": "Не удалось загрузить Истории. Проверьте подключение и повторите попытку.",
"Shot {n} of {total}": "Кадр {n} из {total}",
"GEV scene": "Сцена GEV",
"No scene yet": "Сцены пока нет",
"SAVE TO STORIES": "СОХРАНИТЬ В STORIES",
"REMOVE FROM STORIES": "УБРАТЬ ИЗ STORIES",
"Show this scene on the Stories page": "Показать эту сцену на странице Stories",
"Take this scene off the Stories page": "Убрать эту сцену со страницы Stories",
"Saved to Stories": "Сохранено в Stories",
"Removed from Stories": "Удалено из Stories",
"A scene you made in GEV, played on the live globe.": "Сцена, созданная вами в GEV, на живом глобусе.",
"Floods": "Наводнения",
"Wildfires": "Лесные пожары",
"Storms": "Штормы",
"Earthquakes": "Землетрясения",
"Maritime": "Море",
"Space": "Космос",
"Conflict": "Конфликты",
"Climate": "Климат",
"Thumbnail could not be captured": "Не удалось снять миниатюру",
"Thumbnail captured": "Миниатюра снята",
"Stories tags": "Теги Stories",
"Story thumbnail": "Миниатюра истории",
"Use the current view as the Stories card image": "Использовать текущий вид как изображение карточки в Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Позиции самолётов получены из ADS-B: мировой снимок OpenSky Network, а там, где у OpenSky нет данных, — adsb.lol.",
"Live-flight fallback (ODbL 1.0)": "Резервный источник рейсов (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Орбиты спутников рассчитываются по текущим элементам орбит CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Землетрясения берутся из живой ленты Геологической службы США (USGS).",
"Traffic": "Трафик",
"Road traffic; live congestion needs your own TomTom key.": "Дорожный трафик; для пробок в реальном времени нужен свой ключ TomTom.",
"Live traffic flow, with your own key": "Поток трафика в реальном времени, со своим ключом",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Воздушное движение по всему миру в реальном времени: Атлантика, Европа, Япония и Сан-Франциско.",
"The Atlantic": "Атлантика",
"Western Europe": "Западная Европа",
"Japan": "Япония",
"San Francisco Bay Area": "Район залива Сан-Франциско",
"Pull back over the Atlantic": "Отдаление над Атлантикой",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Спутники на орбите, вид над Флоридой, Африкой, Токио и Парижем.",
"Over Florida": "Над Флоридой",
"Over Africa": "Над Африкой",
"Over Tokyo": "Над Токио",
"Over Paris": "Над Парижем",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Недавние землетрясения в тепловом режиме: Калифорния, Япония, Новая Зеландия и у берегов Португалии.",
"California": "Калифорния",
"New Zealand": "Новая Зеландия",
"Off Portugal": "У берегов Португалии",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Рейсы, спутники и трафик вместе над Нью-Йорком, Лос-Анджелесом и Лондоном.",
"New York, closer": "Нью-Йорк, ближе",
"New York, closer still": "Нью-Йорк, ещё ближе",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Все живые слои сразу, с отдалением от Токио до всей планеты.",
"Tokyo, pulling back": "Токио, отдаление",
"Japan and East Asia": "Япония и Восточная Азия",
"South China Sea": "Южно-Китайское море",
"The whole globe": "Весь земной шар",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "Прорывной паводок на Bhote Koshi в Непале 26 августа 2026 года, вниз по долине до Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Реконструированный путь паводка (CC BY-NC 4.0)",
"THUMBNAIL": "МИНИАТЮРА",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Мировой снимок рейсов в реальном времени (некоммерческая лицензия для исследований и образования)",
"Satellite element sets and catalogue (U.S. government data)": "Элементы орбит и каталог спутников (данные правительства США)",
"Satellite operators, owners and purposes": "Операторы, владельцы и назначение спутников",
"Earthquake feed (U.S. public domain)": "Лента землетрясений (общественное достояние в США)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Архивные спутниковые снимки и снимки после события (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Визуализация прорывного паводка на Bhote Koshi 26 августа 2026 года, а не официальная модель опасности. Архивные виды (2021) и виды после события — снимки Vantor WorldView; путь реки — реконструкция GeoPera. Ролики очевидцев ведут на исходные публикации, время их съёмки не проверено.",
"That story is not available here": "Эта история здесь недоступна",
"DRAFT": "ЧЕРНОВИК",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Черновик, ещё не сохранённый как история. Нажмите «СОХРАНИТЬ В STORIES» в разделе РЕДАКТОР, чтобы сохранить его."
}
+175 -2
View File
@@ -3016,7 +3016,6 @@
"AUTHORING": "REDIGERING",
"Create and edit scenes": "Skapa och redigera scener",
"SCENE": "SCEN",
"Scene": "Scen",
"NEW SCENE": "NY SCEN",
"Start a new, empty scene": "Börja en ny, tom scen",
"DELETE": "RADERA",
@@ -3632,5 +3631,179 @@
"Search layers…": "Sök lager…",
"Layer groups": "Lagergrupper",
"Jump to {name}": "Gå till {name}",
"No layers match": "Inga lager matchar"
"No layers match": "Inga lager matchar",
"A GEV scene, played on the live globe.": "En GEV-scen som spelas upp på globen i realtid.",
"Drag the map to explore · Resume any time": "Dra i kartan för att utforska · Fortsätt när du vill",
"Region": "Region",
"Europe": "Europa",
"Middle East": "Mellanöstern",
"South Asia": "Sydasien",
"East Asia": "Östasien",
"Length": "Längd",
"Under 1 min": "Kortare än 1 min",
"1 min or more": "1 min eller mer",
"Shots": "Tagningar",
"Layers on": "Aktiva lager",
"Stories": "Berättelser",
"NEW": "NYTT",
"GEV Stories": "GEV Berättelser",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Kurerade, interaktiva vyer över vad som händer på jorden. Spela upp en, ta över kartan när du vill och fortsätt sedan berättelsen.",
"Browse stories": "Bläddra bland berättelser",
"Not now": "Inte nu",
"Opened in GEV": "Öppnad i GEV",
"Back to story": "Tillbaka till berättelsen",
"GEV Stories explore": "Utforska GEV Berättelser",
"Resize story list": "Ändra storlek på berättelselistan",
"Story list size. Drag, or press to change": "Storlek på berättelselistan. Dra eller tryck för att ändra",
"{n} of {count} stories": {
"one": "{n} av {count} berättelse",
"other": "{n} av {count} berättelser"
},
"Sort stories": "Sortera berättelser",
"Newest": "Nyaste",
"Longest": "Längsta",
"A–Z": "A–Ö",
"{count} filters on": {
"one": "{count} filter på",
"other": "{count} filter på"
},
"Filters": "Filter",
"Search stories": "Sök berättelser",
"Search stories, places, creators": "Sök berättelser, platser, skapare",
"Clear search": "Rensa sökningen",
"Topics": "Ämnen",
"Filter stories": "Filtrera berättelser",
"Show {count} stories": {
"one": "Visa {count} berättelse",
"other": "Visa {count} berättelser"
},
"No stories match": "Inga berättelser matchar",
"Try another word or clear the filters.": "Prova ett annat ord eller rensa filtren.",
"Clear all": "Rensa alla",
"STORY": "BERÄTTELSE",
"Play {title}": "Spela upp {title}",
"Play story": "Spela upp berättelsen",
"Preview {title}": "Förhandsvisa {title}",
"Click to preview": "Klicka för att förhandsvisa",
"Click to play": "Klicka för att spela upp",
"Tap to play": "Tryck för att spela upp",
"Pick a story or a pin to preview it here": "Välj en berättelse eller en nål för att förhandsvisa den här",
"Story": "Berättelse",
"{what} link copied": "Länken till {what} har kopierats",
"Copy this link: {url}": "Kopiera den här länken: {url}",
"Back to stories": "Tillbaka till berättelserna",
"Back to the globe": "Tillbaka till globen",
"Breadcrumb": "Länkstig",
"Globe": "Glob",
"Share": "Dela",
"Back to GEV": "Tillbaka till GEV",
"Chapter {n}": "Kapitel {n}",
"Context. Swipe up or press to open": "Kontext. Svep uppåt eller tryck för att öppna",
"Context. Swipe down or press to close": "Kontext. Svep nedåt eller tryck för att stänga",
"Search this story": "Sök i den här berättelsen",
"Voice search (not in this build)": "Röstsökning (finns inte i den här versionen)",
"Search results": "Sökresultat",
"Nothing in this story matches.": "Inget i den här berättelsen matchar.",
"Chapters": "Kapitel",
"now": "nu",
"About": "Om",
"by {creator}": "av {creator}",
"Key moments": "Nyckelögonblick",
"Sources": "Källor",
"Background": "Bakgrund",
"Related stories": "Relaterade berättelser",
"Story link copied": "Länken till berättelsen har kopierats",
"You": "Du",
"Open this moment in GEV": "Öppna det här ögonblicket i GEV",
"Open": "Öppna",
"Share this story": "Dela den här berättelsen",
"GEV Story": "GEV-berättelse",
"Story card": "Berättelsekort",
"Chapter": "Kapitel",
"CHAPTER {n} / {total}": "KAPITEL {n} / {total}",
"ON THE MAP": "PÅ KARTAN",
"Right now": "Just nu",
"RIGHT NOW": "JUST NU",
"Minimise card": "Minimera kortet",
"Expand card": "Fäll ut kortet",
"Card pages": "Kortsidor",
"Resize context panel": "Ändra storlek på kontextpanelen",
"Swipe up for context": "Svep uppåt för kontext",
"Chapter start": "Kapitlets början",
"Resume story": "Fortsätt berättelsen",
"Story time": "Berättelsens tid",
"chapter": "kapitel",
"Key moment: {label}": "Nyckelögonblick: {label}",
"Jump to live": "Hoppa till live",
"Unmute": "Slå på ljudet",
"Mute": "Stäng av ljudet",
"Exit expanded map": "Lämna den förstorade kartan",
"Expand map": "Förstora kartan",
"Exit cockpit to open Stories": "Lämna cockpiten för att öppna Berättelser",
"Stories could not load. Check the connection and try again.": "Berättelser kunde inte läsas in. Kontrollera anslutningen och försök igen.",
"Shot {n} of {total}": "Tagning {n} av {total}",
"GEV scene": "GEV-scen",
"No scene yet": "Ingen scen ännu",
"SAVE TO STORIES": "SPARA I STORIES",
"REMOVE FROM STORIES": "TA BORT FRÅN STORIES",
"Show this scene on the Stories page": "Visa scenen på Stories-sidan",
"Take this scene off the Stories page": "Ta bort scenen från Stories-sidan",
"Saved to Stories": "Sparad i Stories",
"Removed from Stories": "Borttagen från Stories",
"A scene you made in GEV, played on the live globe.": "En scen du skapade i GEV, spelad på den levande globen.",
"Floods": "Översvämningar",
"Wildfires": "Skogsbränder",
"Storms": "Stormar",
"Earthquakes": "Jordbävningar",
"Maritime": "Sjöfart",
"Space": "Rymden",
"Conflict": "Konflikter",
"Climate": "Klimat",
"Thumbnail could not be captured": "Miniatyrbilden kunde inte tas",
"Thumbnail captured": "Miniatyrbild tagen",
"Stories tags": "Taggar för Stories",
"Story thumbnail": "Berättelsens miniatyrbild",
"Use the current view as the Stories card image": "Använd den aktuella vyn som bild på Stories-kortet",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Flygplanspositioner kommer från ADS-B: OpenSky Networks världsomfattande ögonblicksbild, med adsb.lol där OpenSky saknar data.",
"Live-flight fallback (ODbL 1.0)": "Reservkälla för flyg i realtid (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Satellitbanorna beräknas från CelesTraks aktuella banelement.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Jordbävningarna kommer från U.S. Geological Surveys realtidsflöde.",
"Traffic": "Trafik",
"Road traffic; live congestion needs your own TomTom key.": "Vägtrafik; köer i realtid kräver en egen TomTom-nyckel.",
"Live traffic flow, with your own key": "Trafikflöde i realtid, med egen nyckel",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Flygtrafik i realtid runt om i världen: Atlanten, Europa, Japan och San Francisco.",
"The Atlantic": "Atlanten",
"Western Europe": "Västeuropa",
"Japan": "Japan",
"San Francisco Bay Area": "San Francisco-bukten",
"Pull back over the Atlantic": "Zooma ut över Atlanten",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Satelliter i omloppsbana, sedda över Florida, Afrika, Tokyo och Paris.",
"Over Florida": "Över Florida",
"Over Africa": "Över Afrika",
"Over Tokyo": "Över Tokyo",
"Over Paris": "Över Paris",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Nya jordbävningar i värmekameravyn: Kalifornien, Japan, Nya Zeeland och utanför Portugal.",
"California": "Kalifornien",
"New Zealand": "Nya Zeeland",
"Off Portugal": "Utanför Portugal",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Flyg, satelliter och trafik tillsammans över New York, Los Angeles och London.",
"New York, closer": "New York, närmare",
"New York, closer still": "New York, ännu närmare",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Alla realtidslager på en gång, utzoomning från Tokyo till hela planeten.",
"Tokyo, pulling back": "Tokyo, utzoomning",
"Japan and East Asia": "Japan och Östasien",
"South China Sea": "Sydkinesiska havet",
"The whole globe": "Hela jordklotet",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "Dammbrottsfloden i Bhote Koshi i Nepal den 26 augusti 2026, följd nedför dalen till Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Rekonstruerad flodväg (CC BY-NC 4.0)",
"THUMBNAIL": "MINIATYRBILD",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Världsomfattande ögonblicksbild av flyg i realtid (icke-kommersiell licens för forskning och utbildning)",
"Satellite element sets and catalogue (U.S. government data)": "Satelliters banelement och katalog (data från USA:s regering)",
"Satellite operators, owners and purposes": "Satelliters operatörer, ägare och syften",
"Earthquake feed (U.S. public domain)": "Jordbävningsflöde (allmän egendom i USA)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Historiska satellitbilder och bilder efter händelsen (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "En visualisering av dammbrottsfloden i Bhote Koshi den 26 augusti 2026, inte en officiell riskmodell. De historiska vyerna (2021) och vyerna efter händelsen är Vantor WorldView-bilder; flodens väg är GeoPeras rekonstruktion. Ögonvittnesklippen länkar till sina ursprungliga inlägg, och deras inspelningstider är inte verifierade.",
"That story is not available here": "Den berättelsen är inte tillgänglig här",
"DRAFT": "UTKAST",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Ett utkast som inte är sparat som berättelse än. Använd SPARA I STORIES under REDIGERING för att spara det."
}
+181 -2
View File
@@ -3262,7 +3262,6 @@
"AUTHORING": "РЕДАКТОР",
"Create and edit scenes": "Створення й редагування сцен",
"SCENE": "СЦЕНА",
"Scene": "Сцена",
"NEW SCENE": "НОВА СЦЕНА",
"Start a new, empty scene": "Створити нову порожню сцену",
"DELETE": "ВИДАЛИТИ",
@@ -3806,5 +3805,185 @@
"Search layers…": "Пошук шарів…",
"Layer groups": "Групи шарів",
"Jump to {name}": "Перейти до «{name}»",
"No layers match": "Немає відповідних шарів"
"No layers match": "Немає відповідних шарів",
"A GEV scene, played on the live globe.": "Сцена GEV, відтворена на живому глобусі.",
"Drag the map to explore · Resume any time": "Перетягуйте карту для огляду · Продовжити можна будь-коли",
"Region": "Регіон",
"Europe": "Європа",
"Middle East": "Близький Схід",
"South Asia": "Південна Азія",
"East Asia": "Східна Азія",
"Length": "Тривалість",
"Under 1 min": "Менше 1 хв",
"1 min or more": "1 хв і більше",
"Shots": "Кадри",
"Layers on": "Увімкнені шари",
"Stories": "Історії",
"NEW": "НОВЕ",
"GEV Stories": "Історії GEV",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "Добірка інтерактивних оглядів того, що відбувається на Землі. Запустіть історію, беріть карту під свій контроль будь-коли, а потім продовжте перегляд.",
"Browse stories": "Переглянути історії",
"Not now": "Не зараз",
"Opened in GEV": "Відкрито в GEV",
"Back to story": "Назад до історії",
"GEV Stories explore": "Огляд історій GEV",
"Resize story list": "Змінити розмір списку історій",
"Story list size. Drag, or press to change": "Розмір списку історій. Перетягніть або натисніть, щоб змінити",
"{n} of {count} stories": {
"one": "{n} з {count} історії",
"few": "{n} з {count} історій",
"many": "{n} з {count} історій",
"other": "{n} з {count} історії"
},
"Sort stories": "Сортування історій",
"Newest": "Нові",
"Longest": "Найдовші",
"A–Z": "А–Я",
"{count} filters on": {
"one": "{count} фільтр увімкнено",
"few": "{count} фільтри увімкнено",
"many": "{count} фільтрів увімкнено",
"other": "{count} фільтра увімкнено"
},
"Filters": "Фільтри",
"Search stories": "Пошук історій",
"Search stories, places, creators": "Пошук історій, місць, авторів",
"Clear search": "Очистити пошук",
"Topics": "Теми",
"Filter stories": "Фільтр історій",
"Show {count} stories": {
"one": "Показати {count} історію",
"few": "Показати {count} історії",
"many": "Показати {count} історій",
"other": "Показати {count} історії"
},
"No stories match": "Немає відповідних історій",
"Try another word or clear the filters.": "Спробуйте інше слово або скиньте фільтри.",
"Clear all": "Скинути все",
"STORY": "ІСТОРІЯ",
"Play {title}": "Відтворити: {title}",
"Play story": "Відтворити історію",
"Preview {title}": "Попередній перегляд: {title}",
"Click to preview": "Натисніть для попереднього перегляду",
"Click to play": "Натисніть для відтворення",
"Tap to play": "Торкніться для відтворення",
"Pick a story or a pin to preview it here": "Виберіть історію або мітку, щоб переглянути її тут",
"Story": "Історія",
"{what} link copied": "Посилання скопійовано: {what}",
"Copy this link: {url}": "Скопіюйте це посилання: {url}",
"Back to stories": "Назад до історій",
"Back to the globe": "Назад до глобуса",
"Breadcrumb": "Навігаційний ланцюжок",
"Globe": "Глобус",
"Share": "Поділитися",
"Back to GEV": "Назад до GEV",
"Chapter {n}": "Розділ {n}",
"Context. Swipe up or press to open": "Контекст. Проведіть угору або натисніть, щоб відкрити",
"Context. Swipe down or press to close": "Контекст. Проведіть униз або натисніть, щоб закрити",
"Search this story": "Пошук в історії",
"Voice search (not in this build)": "Голосовий пошук (немає в цій збірці)",
"Search results": "Результати пошуку",
"Nothing in this story matches.": "У цій історії нічого не знайдено.",
"Chapters": "Розділи",
"now": "зараз",
"About": "Про історію",
"by {creator}": "автор: {creator}",
"Key moments": "Ключові моменти",
"Sources": "Джерела",
"Background": "Передісторія",
"Related stories": "Схожі історії",
"Story link copied": "Посилання на історію скопійовано",
"You": "Ви",
"Open this moment in GEV": "Відкрити цей момент у GEV",
"Open": "Відкрити",
"Share this story": "Поділитися історією",
"GEV Story": "Історія GEV",
"Story card": "Картка історії",
"Chapter": "Розділ",
"CHAPTER {n} / {total}": "РОЗДІЛ {n} / {total}",
"ON THE MAP": "НА КАРТІ",
"Right now": "Просто зараз",
"RIGHT NOW": "ПРОСТО ЗАРАЗ",
"Minimise card": "Згорнути картку",
"Expand card": "Розгорнути картку",
"Card pages": "Сторінки картки",
"Resize context panel": "Змінити розмір панелі контексту",
"Swipe up for context": "Проведіть угору, щоб побачити контекст",
"Chapter start": "Початок розділу",
"Resume story": "Продовжити історію",
"Story time": "Час історії",
"chapter": "розділ",
"Key moment: {label}": "Ключовий момент: {label}",
"Jump to live": "До реального часу",
"Unmute": "Увімкнути звук",
"Mute": "Вимкнути звук",
"Exit expanded map": "Вийти з розгорнутої карти",
"Expand map": "Розгорнути карту",
"Exit cockpit to open Stories": "Вийдіть із кабіни, щоб відкрити Історії",
"Stories could not load. Check the connection and try again.": "Не вдалося завантажити Історії. Перевірте з’єднання та спробуйте ще раз.",
"Shot {n} of {total}": "Кадр {n} з {total}",
"GEV scene": "Сцена GEV",
"No scene yet": "Сцени ще немає",
"SAVE TO STORIES": "ЗБЕРЕГТИ В STORIES",
"REMOVE FROM STORIES": "ПРИБРАТИ ЗІ STORIES",
"Show this scene on the Stories page": "Показати цю сцену на сторінці Stories",
"Take this scene off the Stories page": "Прибрати цю сцену зі сторінки Stories",
"Saved to Stories": "Збережено в Stories",
"Removed from Stories": "Вилучено зі Stories",
"A scene you made in GEV, played on the live globe.": "Сцена, яку ви створили в GEV, на живому глобусі.",
"Floods": "Повені",
"Wildfires": "Лісові пожежі",
"Storms": "Шторми",
"Earthquakes": "Землетруси",
"Maritime": "Море",
"Space": "Космос",
"Conflict": "Конфлікти",
"Climate": "Клімат",
"Thumbnail could not be captured": "Не вдалося зняти мініатюру",
"Thumbnail captured": "Мініатюру знято",
"Stories tags": "Теги Stories",
"Story thumbnail": "Мініатюра історії",
"Use the current view as the Stories card image": "Використати поточний вигляд як зображення картки в Stories",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "Позиції літаків отримано з ADS-B: світовий знімок OpenSky Network, а там, де в OpenSky немає даних, — adsb.lol.",
"Live-flight fallback (ODbL 1.0)": "Резервне джерело рейсів (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "Орбіти супутників розраховуються за поточними елементами орбіт CelesTrak.",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "Землетруси надходять із живої стрічки Геологічної служби США (USGS).",
"Traffic": "Дорожній рух",
"Road traffic; live congestion needs your own TomTom key.": "Дорожній рух; для заторів у реальному часі потрібен власний ключ TomTom.",
"Live traffic flow, with your own key": "Потік руху в реальному часі, з власним ключем",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "Повітряний рух по всьому світу в реальному часі: Атлантика, Європа, Японія та Сан-Франциско.",
"The Atlantic": "Атлантика",
"Western Europe": "Західна Європа",
"Japan": "Японія",
"San Francisco Bay Area": "Район затоки Сан-Франциско",
"Pull back over the Atlantic": "Віддалення над Атлантикою",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "Супутники на орбіті, вигляд над Флоридою, Африкою, Токіо та Парижем.",
"Over Florida": "Над Флоридою",
"Over Africa": "Над Африкою",
"Over Tokyo": "Над Токіо",
"Over Paris": "Над Парижем",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "Недавні землетруси в тепловому режимі: Каліфорнія, Японія, Нова Зеландія та біля берегів Португалії.",
"California": "Каліфорнія",
"New Zealand": "Нова Зеландія",
"Off Portugal": "Біля берегів Португалії",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "Рейси, супутники та дорожній рух разом над Нью-Йорком, Лос-Анджелесом і Лондоном.",
"New York, closer": "Нью-Йорк, ближче",
"New York, closer still": "Нью-Йорк, ще ближче",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "Усі живі шари одразу, з віддаленням від Токіо до всієї планети.",
"Tokyo, pulling back": "Токіо, віддалення",
"Japan and East Asia": "Японія та Східна Азія",
"South China Sea": "Південнокитайське море",
"The whole globe": "Уся земна куля",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "Прорив паводка на Bhote Koshi в Непалі 26 серпня 2026 року, вниз долиною до Trishuli.",
"Reconstructed flood path (CC BY-NC 4.0)": "Реконструйований шлях паводка (CC BY-NC 4.0)",
"THUMBNAIL": "МІНІАТЮРА",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "Світовий знімок рейсів у реальному часі (некомерційна ліцензія для досліджень і освіти)",
"Satellite element sets and catalogue (U.S. government data)": "Елементи орбіт і каталог супутників (дані уряду США)",
"Satellite operators, owners and purposes": "Оператори, власники та призначення супутників",
"Earthquake feed (U.S. public domain)": "Стрічка землетрусів (суспільне надбання в США)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "Архівні супутникові знімки та знімки після події (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "Візуалізація прориву паводка на Bhote Koshi 26 серпня 2026 року, а не офіційна модель небезпеки. Архівні види (2021) і види після події — знімки Vantor WorldView; шлях річки — реконструкція GeoPera. Відео очевидців ведуть на початкові публікації, час їх зйомки не перевірено.",
"That story is not available here": "Ця історія тут недоступна",
"DRAFT": "ЧЕРНЕТКА",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "Чернетка, ще не збережена як історія. Натисніть «ЗБЕРЕГТИ В STORIES» у розділі РЕДАКТОР, щоб зберегти її."
}
+172 -2
View File
@@ -3044,7 +3044,6 @@
"AUTHORING": "创作",
"Create and edit scenes": "创建和编辑场景",
"SCENE": "场景",
"Scene": "场景",
"NEW SCENE": "新建场景",
"Start a new, empty scene": "新建一个空场景",
"DELETE": "删除",
@@ -3545,5 +3544,176 @@
"Search layers…": "搜索图层…",
"Layer groups": "图层分组",
"Jump to {name}": "跳转到{name}",
"No layers match": "没有匹配的图层"
"No layers match": "没有匹配的图层",
"A GEV scene, played on the live globe.": "在实时地球上播放的 GEV 场景。",
"Drag the map to explore · Resume any time": "拖动地图进行探索 · 随时可继续",
"Region": "地区",
"Europe": "欧洲",
"Middle East": "中东",
"South Asia": "南亚",
"East Asia": "东亚",
"Length": "时长",
"Under 1 min": "不到 1 分钟",
"1 min or more": "1 分钟及以上",
"Shots": "镜头",
"Layers on": "已开图层",
"Stories": "故事",
"NEW": "新",
"GEV Stories": "GEV 故事",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "精选的互动视图,呈现地球上正在发生的事。播放一个故事,随时接管地图,然后再继续观看。",
"Browse stories": "浏览故事",
"Not now": "以后再说",
"Opened in GEV": "已在 GEV 中打开",
"Back to story": "返回故事",
"GEV Stories explore": "GEV 故事探索",
"Resize story list": "调整故事列表大小",
"Story list size. Drag, or press to change": "故事列表大小。拖动或按下以更改",
"{n} of {count} stories": {
"other": "第 {n} 个,共 {count} 个故事"
},
"Sort stories": "故事排序",
"Newest": "最新",
"Longest": "最长",
"A–Z": "按名称",
"{count} filters on": {
"other": "已启用 {count} 个筛选"
},
"Filters": "筛选",
"Search stories": "搜索故事",
"Search stories, places, creators": "搜索故事、地点、创作者",
"Clear search": "清除搜索",
"Topics": "主题",
"Filter stories": "筛选故事",
"Show {count} stories": {
"other": "显示 {count} 个故事"
},
"No stories match": "没有匹配的故事",
"Try another word or clear the filters.": "请换个关键词或清除筛选。",
"Clear all": "全部清除",
"STORY": "故事",
"Play {title}": "播放 {title}",
"Play story": "播放故事",
"Preview {title}": "预览 {title}",
"Click to preview": "点击预览",
"Click to play": "点击播放",
"Tap to play": "轻触播放",
"Pick a story or a pin to preview it here": "选择一个故事或标记,在此预览",
"Story": "故事",
"{what} link copied": "{what}链接已复制",
"Copy this link: {url}": "复制此链接:{url}",
"Back to stories": "返回故事列表",
"Back to the globe": "返回地球",
"Breadcrumb": "导航路径",
"Globe": "地球",
"Share": "分享",
"Back to GEV": "返回 GEV",
"Chapter {n}": "第 {n} 章",
"Context. Swipe up or press to open": "背景信息。上滑或按下以打开",
"Context. Swipe down or press to close": "背景信息。下滑或按下以关闭",
"Search this story": "在此故事中搜索",
"Voice search (not in this build)": "语音搜索 (此版本不支持)",
"Search results": "搜索结果",
"Nothing in this story matches.": "此故事中没有匹配项。",
"Chapters": "章节",
"now": "现在",
"About": "简介",
"by {creator}": "作者:{creator}",
"Key moments": "关键时刻",
"Sources": "来源",
"Background": "背景",
"Related stories": "相关故事",
"Story link copied": "故事链接已复制",
"You": "你",
"Open this moment in GEV": "在 GEV 中打开此时刻",
"Open": "打开",
"Share this story": "分享此故事",
"GEV Story": "GEV 故事",
"Story card": "故事卡片",
"Chapter": "章节",
"CHAPTER {n} / {total}": "第 {n} 章 / {total}",
"ON THE MAP": "地图上",
"Right now": "当前",
"RIGHT NOW": "当前",
"Minimise card": "最小化卡片",
"Expand card": "展开卡片",
"Card pages": "卡片页面",
"Resize context panel": "调整背景信息面板大小",
"Swipe up for context": "上滑查看背景信息",
"Chapter start": "章节开始",
"Resume story": "继续故事",
"Story time": "故事时间",
"chapter": "章节",
"Key moment: {label}": "关键时刻:{label}",
"Jump to live": "跳转到实时",
"Unmute": "取消静音",
"Mute": "静音",
"Exit expanded map": "退出放大地图",
"Expand map": "放大地图",
"Exit cockpit to open Stories": "请先退出座舱,再打开故事",
"Stories could not load. Check the connection and try again.": "无法加载故事。请检查网络连接后重试。",
"Shot {n} of {total}": "镜头 {n}/{total}",
"GEV scene": "GEV 场景",
"No scene yet": "尚无场景",
"SAVE TO STORIES": "保存到 STORIES",
"REMOVE FROM STORIES": "从 STORIES 移除",
"Show this scene on the Stories page": "在 Stories 页面显示此场景",
"Take this scene off the Stories page": "将此场景从 Stories 页面移除",
"Saved to Stories": "已保存到 Stories",
"Removed from Stories": "已从 Stories 移除",
"A scene you made in GEV, played on the live globe.": "你在 GEV 中制作的场景,在实时地球上播放。",
"Floods": "洪水",
"Wildfires": "山火",
"Storms": "风暴",
"Earthquakes": "地震",
"Maritime": "海事",
"Space": "太空",
"Conflict": "冲突",
"Climate": "气候",
"Thumbnail could not be captured": "无法截取缩略图",
"Thumbnail captured": "已截取缩略图",
"Stories tags": "故事标签",
"Story thumbnail": "故事缩略图",
"Use the current view as the Stories card image": "将当前视图用作故事卡片图片",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "飞机位置来自 ADS-B:OpenSky Network 的全球快照,OpenSky 没有数据的地方由 adsb.lol 补充。",
"Live-flight fallback (ODbL 1.0)": "实时航班备用来源 (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "卫星轨道根据 CelesTrak 当前的轨道根数推算。",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "地震数据来自美国地质调查局 (USGS) 的实时数据流。",
"Traffic": "交通",
"Road traffic; live congestion needs your own TomTom key.": "道路交通;实时拥堵需要你自己的 TomTom 密钥。",
"Live traffic flow, with your own key": "实时交通流量,需使用你自己的密钥",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "全球实时空中交通:大西洋、欧洲、日本和旧金山。",
"The Atlantic": "大西洋",
"Western Europe": "西欧",
"Japan": "日本",
"San Francisco Bay Area": "旧金山湾区",
"Pull back over the Atlantic": "在大西洋上空拉远",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "在轨卫星,从佛罗里达、非洲、东京和巴黎上空观看。",
"Over Florida": "佛罗里达上空",
"Over Africa": "非洲上空",
"Over Tokyo": "东京上空",
"Over Paris": "巴黎上空",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "热成像风格下的近期地震:加利福尼亚、日本、新西兰和葡萄牙近海。",
"California": "加利福尼亚",
"New Zealand": "新西兰",
"Off Portugal": "葡萄牙近海",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "纽约、洛杉矶和伦敦上空的航班、卫星与交通。",
"New York, closer": "纽约,更近",
"New York, closer still": "纽约,再近一些",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "同时显示所有实时图层,从东京拉远到整个地球。",
"Tokyo, pulling back": "东京,拉远",
"Japan and East Asia": "日本与东亚",
"South China Sea": "南海",
"The whole globe": "整个地球",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "2026 年 8 月 26 日尼泊尔 Bhote Koshi 溃决洪水,沿河谷而下追踪至 Trishuli。",
"Reconstructed flood path (CC BY-NC 4.0)": "重建的洪水路径 (CC BY-NC 4.0)",
"THUMBNAIL": "缩略图",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "全球实时航班快照(非商业研究与教育许可)",
"Satellite element sets and catalogue (U.S. government data)": "卫星轨道根数与目录(美国政府数据)",
"Satellite operators, owners and purposes": "卫星运营者、所有者与用途",
"Earthquake feed (U.S. public domain)": "地震数据流(美国公有领域)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "历史与事件后卫星影像 (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "这是 2026 年 8 月 26 日 Bhote Koshi 溃决洪水的可视化,并非官方灾害模型。历史(2021 年)与事件后视图为 Vantor WorldView 影像;河流路径为 GeoPera 的重建结果。目击者视频链接到其原始帖子,拍摄时间未经核实。",
"That story is not available here": "该故事在此处不可用",
"DRAFT": "草稿",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "尚未保存为故事的草稿。在“创作”中使用“保存到 STORIES”即可保存。"
}
+172 -2
View File
@@ -3031,7 +3031,6 @@
"AUTHORING": "創作",
"Create and edit scenes": "創建和編輯場景",
"SCENE": "場景",
"Scene": "場景",
"NEW SCENE": "新建場景",
"Start a new, empty scene": "新建一個空場景",
"DELETE": "刪除",
@@ -3545,5 +3544,176 @@
"Search layers…": "搜尋圖層…",
"Layer groups": "圖層分組",
"Jump to {name}": "跳至{name}",
"No layers match": "沒有符合的圖層"
"No layers match": "沒有符合的圖層",
"A GEV scene, played on the live globe.": "在即時地球上播放的 GEV 場景。",
"Drag the map to explore · Resume any time": "拖動地圖進行探索 · 隨時可繼續",
"Region": "地區",
"Europe": "歐洲",
"Middle East": "中東",
"South Asia": "南亞",
"East Asia": "東亞",
"Length": "時長",
"Under 1 min": "不到 1 分鐘",
"1 min or more": "1 分鐘及以上",
"Shots": "鏡頭",
"Layers on": "已開圖層",
"Stories": "故事",
"NEW": "新",
"GEV Stories": "GEV 故事",
"Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.": "精選的互動視圖,呈現地球上正在發生的事。播放一個故事,隨時接管地圖,然後再繼續觀看。",
"Browse stories": "瀏覽故事",
"Not now": "以後再說",
"Opened in GEV": "已在 GEV 中打開",
"Back to story": "返回故事",
"GEV Stories explore": "GEV 故事探索",
"Resize story list": "調整故事列表大小",
"Story list size. Drag, or press to change": "故事列表大小。拖動或按下以更改",
"{n} of {count} stories": {
"other": "第 {n} 個,共 {count} 個故事"
},
"Sort stories": "故事排序",
"Newest": "最新",
"Longest": "最長",
"A–Z": "按名稱",
"{count} filters on": {
"other": "已啟用 {count} 個篩選"
},
"Filters": "篩選",
"Search stories": "搜索故事",
"Search stories, places, creators": "搜索故事、地點、創作者",
"Clear search": "清除搜索",
"Topics": "主題",
"Filter stories": "篩選故事",
"Show {count} stories": {
"other": "顯示 {count} 個故事"
},
"No stories match": "沒有符合的故事",
"Try another word or clear the filters.": "請換個關鍵詞或清除篩選。",
"Clear all": "全部清除",
"STORY": "故事",
"Play {title}": "播放 {title}",
"Play story": "播放故事",
"Preview {title}": "預覽 {title}",
"Click to preview": "點擊預覽",
"Click to play": "點擊播放",
"Tap to play": "輕觸播放",
"Pick a story or a pin to preview it here": "選擇一個故事或標記,在此預覽",
"Story": "故事",
"{what} link copied": "{what}鏈接已複製",
"Copy this link: {url}": "複製此鏈接:{url}",
"Back to stories": "返回故事列表",
"Back to the globe": "返回地球",
"Breadcrumb": "導航路徑",
"Globe": "地球",
"Share": "分享",
"Back to GEV": "返回 GEV",
"Chapter {n}": "第 {n} 章",
"Context. Swipe up or press to open": "背景資訊。上滑或按下以打開",
"Context. Swipe down or press to close": "背景資訊。下滑或按下以關閉",
"Search this story": "在此故事中搜索",
"Voice search (not in this build)": "語音搜索 (此版本不支援)",
"Search results": "搜索結果",
"Nothing in this story matches.": "此故事中沒有符合項目。",
"Chapters": "章節",
"now": "現在",
"About": "簡介",
"by {creator}": "作者:{creator}",
"Key moments": "關鍵時刻",
"Sources": "來源",
"Background": "背景",
"Related stories": "相關故事",
"Story link copied": "故事鏈接已複製",
"You": "你",
"Open this moment in GEV": "在 GEV 中打開此時刻",
"Open": "打開",
"Share this story": "分享此故事",
"GEV Story": "GEV 故事",
"Story card": "故事卡片",
"Chapter": "章節",
"CHAPTER {n} / {total}": "第 {n} 章 / {total}",
"ON THE MAP": "地圖上",
"Right now": "當前",
"RIGHT NOW": "當前",
"Minimise card": "最小化卡片",
"Expand card": "展開卡片",
"Card pages": "卡片頁面",
"Resize context panel": "調整背景資訊面板大小",
"Swipe up for context": "上滑查看背景資訊",
"Chapter start": "章節開始",
"Resume story": "繼續故事",
"Story time": "故事時間",
"chapter": "章節",
"Key moment: {label}": "關鍵時刻:{label}",
"Jump to live": "跳轉到即時",
"Unmute": "取消靜音",
"Mute": "靜音",
"Exit expanded map": "退出放大地圖",
"Expand map": "放大地圖",
"Exit cockpit to open Stories": "請先退出座艙,再開啟故事",
"Stories could not load. Check the connection and try again.": "無法載入故事。請檢查網路連線後重試。",
"Shot {n} of {total}": "鏡頭 {n}/{total}",
"GEV scene": "GEV 場景",
"No scene yet": "尚無場景",
"SAVE TO STORIES": "儲存到 STORIES",
"REMOVE FROM STORIES": "從 STORIES 移除",
"Show this scene on the Stories page": "在 Stories 頁面顯示此場景",
"Take this scene off the Stories page": "將此場景從 Stories 頁面移除",
"Saved to Stories": "已儲存到 Stories",
"Removed from Stories": "已從 Stories 移除",
"A scene you made in GEV, played on the live globe.": "你在 GEV 中製作的場景,在即時地球上播放。",
"Floods": "洪水",
"Wildfires": "山火",
"Storms": "風暴",
"Earthquakes": "地震",
"Maritime": "海事",
"Space": "太空",
"Conflict": "衝突",
"Climate": "氣候",
"Thumbnail could not be captured": "無法擷取縮圖",
"Thumbnail captured": "已擷取縮圖",
"Stories tags": "故事標籤",
"Story thumbnail": "故事縮圖",
"Use the current view as the Stories card image": "將目前檢視用作故事卡片圖片",
"Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.": "飛機位置來自 ADS-B:OpenSky Network 的全球快照,OpenSky 沒有資料的地方由 adsb.lol 補充。",
"Live-flight fallback (ODbL 1.0)": "即時航班備用來源 (ODbL 1.0)",
"Satellite orbits are propagated from CelesTrak’s current element sets.": "衛星軌道根據 CelesTrak 目前的軌道根數推算。",
"Earthquakes come from the U.S. Geological Survey’s live feed.": "地震資料來自美國地質調查局 (USGS) 的即時資料流。",
"Traffic": "交通",
"Road traffic; live congestion needs your own TomTom key.": "道路交通;即時壅塞需要你自己的 TomTom 金鑰。",
"Live traffic flow, with your own key": "即時交通流量,需使用你自己的金鑰",
"Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.": "全球即時空中交通:大西洋、歐洲、日本和舊金山。",
"The Atlantic": "大西洋",
"Western Europe": "西歐",
"Japan": "日本",
"San Francisco Bay Area": "舊金山灣區",
"Pull back over the Atlantic": "在大西洋上空拉遠",
"Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.": "在軌衛星,從佛羅里達、非洲、東京和巴黎上空觀看。",
"Over Florida": "佛羅里達上空",
"Over Africa": "非洲上空",
"Over Tokyo": "東京上空",
"Over Paris": "巴黎上空",
"Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.": "熱成像風格下的近期地震:加利福尼亞、日本、紐西蘭和葡萄牙外海。",
"California": "加利福尼亞",
"New Zealand": "紐西蘭",
"Off Portugal": "葡萄牙外海",
"Flights, satellites and traffic together over New York, Los Angeles and London.": "紐約、洛杉磯和倫敦上空的航班、衛星與交通。",
"New York, closer": "紐約,更近",
"New York, closer still": "紐約,再近一些",
"Every live layer at once, pulling back from Tokyo to the whole planet.": "同時顯示所有即時圖層,從東京拉遠到整個地球。",
"Tokyo, pulling back": "東京,拉遠",
"Japan and East Asia": "日本與東亞",
"South China Sea": "南海",
"The whole globe": "整個地球",
"The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.": "2026 年 8 月 26 日尼泊爾 Bhote Koshi 潰決洪水,沿河谷而下追蹤至 Trishuli。",
"Reconstructed flood path (CC BY-NC 4.0)": "重建的洪水路徑 (CC BY-NC 4.0)",
"THUMBNAIL": "縮圖",
"Worldwide live-flight snapshot (non-commercial research and education licence)": "全球即時航班快照(非商業研究與教育授權)",
"Satellite element sets and catalogue (U.S. government data)": "衛星軌道根數與目錄(美國政府資料)",
"Satellite operators, owners and purposes": "衛星營運者、擁有者與用途",
"Earthquake feed (U.S. public domain)": "地震資料流(美國公有領域)",
"Historical and post-event satellite imagery (CC BY-NC 4.0)": "歷史與事件後衛星影像 (CC BY-NC 4.0)",
"A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.": "這是 2026 年 8 月 26 日 Bhote Koshi 潰決洪水的視覺化,並非官方災害模型。歷史(2021 年)與事件後畫面為 Vantor WorldView 影像;河流路徑為 GeoPera 的重建結果。目擊者影片連結到其原始貼文,拍攝時間未經核實。",
"That story is not available here": "該故事在此處無法使用",
"DRAFT": "草稿",
"A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.": "尚未儲存為故事的草稿。在「創作」中使用「儲存到 STORIES」即可儲存。"
}
+24 -6
View File
@@ -252,7 +252,12 @@
"OPT-IN",
"{minutes} min",
"1 min/s",
"Status"
"Status",
"Region",
"Wind (km/h)",
"Story",
"STORY",
"Japan"
],
"es": [
"1 min/s",
@@ -417,7 +422,10 @@
"NORAD: {id}",
"Regional",
"{datasets} · {tiles} · {packs}",
"VIRTUAL"
"VIRTUAL",
"Sensor",
"{count} acres",
"California"
],
"fr": [
"1 min/s",
@@ -641,7 +649,11 @@
"Orthophoto",
"Oblique",
"Type",
"{range} NM"
"{range} NM",
"Maritime",
"Europe",
"Globe",
"Sources"
],
"it": [
"1 min/s",
@@ -848,7 +860,9 @@
"NORAD: {id}",
"DATASET",
"{count} datasets",
"ZOOM"
"ZOOM",
"followers",
"California"
],
"ja": [
"1090 MHz",
@@ -1079,7 +1093,9 @@
"MMSI: {id}",
"NORAD: {id}",
"Regional",
"VIRTUAL"
"VIRTUAL",
"Sensor",
"{count} acres"
],
"ru": [
"1900–1945",
@@ -1277,7 +1293,9 @@
"ICAO: {id}",
"NORAD: {id}",
"MMSI: {id}",
"Status"
"Status",
"Region",
"Japan"
],
"uk": [
"1900–1945",
+2
View File
@@ -43,6 +43,8 @@ const COCKPIT_REFUSALS = Object.freeze({
aircraft: msg('Exit cockpit to fly to an aircraft'),
satellite: msg('Exit cockpit to fly to a satellite'),
frame: msg('Exit cockpit to frame contacts'),
// Opening Stories (src/stories/controller.js) takes the camera.
stories: msg('Exit cockpit to open Stories'),
});
/** The destination nouns with their own Cockpit refusal (for tests). */
+303 -19
View File
@@ -67,6 +67,8 @@ import {
SceneDocumentError,
} from '../director/document.js';
import { sceneSaveFailureReason } from './sceneSaveError.js';
import { STORY_TAG_LIMIT, STORY_TAGS } from './storyTags.js';
import { captureStoryThumb } from './storyThumb.js';
/** @constant {string} localStorage key for the serialized project */
const STORAGE_KEY = 'godsEyeView.sceneProject.v2';
@@ -177,8 +179,10 @@ export class SceneDirector {
this._lastRunJson = '';
this._project = this._loadProject();
this._selectedSceneId = this._project.scenes[0]?.id || null;
this._selectedShotId = this._project.scenes[0]?.shots[0]?.id || null;
// Authoring starts with no scene: the built-in scenes stay in the project
// (Stories plays them) but only NEW SCENE or selectShot makes one current.
this._selectedSceneId = null;
this._selectedShotId = null;
/** @type {string|null} Scene whose layer state most recently landed. */
this._loadedSceneId = null;
@@ -220,6 +224,9 @@ export class SceneDirector {
}
}
}
// Upgrading a pack selects its scene; on load nothing is selected.
this._selectedSceneId = null;
this._selectedShotId = null;
}
this._initUI();
// A status the director wrote itself follows the language; one it was
@@ -443,11 +450,6 @@ export class SceneDirector {
hasRun: !!this._lastRunJson,
}),
actions: {
selectScene: (id) => {
this._selectedSceneId = id;
this._selectedShotId = this._getSelectedScene()?.shots[0]?.id || null;
this._renderShotList();
},
selectShot: (id) => {
this._selectedShotId = id;
this._publish({ type: 'selection-changed' });
@@ -461,6 +463,9 @@ export class SceneDirector {
},
create: (name) => this._createScene(name),
deleteScene: () => this._deleteSelectedScene(),
stories: () => this._toggleSelectedSceneInStories(),
thumb: () => this.captureSceneThumb(),
tag: (tag) => this._toggleSelectedSceneTag(tag),
capture: () => this.captureShot(),
update: () => this.updateSelectedShot(),
start: (id) => this.startScene(id),
@@ -476,12 +481,16 @@ export class SceneDirector {
});
}
/** Rebuild the scene dropdown options and sync the selected value. */
/**
* Keep the selection on an existing scene, or on none, and present the
* scene's name.
*/
_renderSceneSelect() {
if (
!this._project.scenes.some((scene) => scene.id === this._selectedSceneId)
) {
this._selectedSceneId = this._project.scenes[0]?.id || null;
this._selectedSceneId = null;
this._selectedShotId = null;
}
this._publish({ type: 'scene-options-changed' });
}
@@ -544,7 +553,10 @@ export class SceneDirector {
this._publish({ type: 'scene-created', scene });
}
/** Delete the currently selected scene after user confirmation. Resets to defaults if empty. */
/**
* Delete the currently selected scene after user confirmation and select
* none. Resets to defaults if empty.
*/
_deleteSelectedScene() {
const scene = this._getSelectedScene();
if (!scene) return;
@@ -557,10 +569,106 @@ export class SceneDirector {
this._project = createDefaultProject();
}
this._selectedSceneId = this._project.scenes[0]?.id || null;
this._selectedShotId = this._project.scenes[0]?.shots[0]?.id || null;
// Authoring goes back to no scene.
this._selectedSceneId = null;
this._selectedShotId = null;
this._saveProject();
this._publish({ type: 'scene-deleted', scene });
if (scene.stories) this._publish({ type: 'stories-changed' });
}
/** SAVE TO STORIES / REMOVE FROM STORIES for the selected scene. */
_toggleSelectedSceneInStories() {
const scene = this._getSelectedScene();
if (!scene) return;
const on = !scene.stories;
if (!this.setSceneInStories(scene.id, on)) return;
this._updateStatus(() =>
on ? t('Saved to Stories') : t('Removed from Stories'),
);
}
/** A tag chip: add the tag to the selected scene, or take it off. */
_toggleSelectedSceneTag(tag) {
const scene = this._getSelectedScene();
if (!scene || !STORY_TAGS.includes(tag)) return;
const tags = scene.storyTags ?? [];
const next = tags.includes(tag)
? tags.filter((item) => item !== tag)
: [...tags, tag];
// The panel disables the other chips once a scene has the most tags.
this.setSceneStoryTags(scene.id, next);
}
/**
* Set the tags a scene shows on its Stories card.
* @param {string} sceneId
* @param {string[]} tags Keys from STORY_TAGS, at most STORY_TAG_LIMIT.
* @returns {boolean} False when the scene does not exist or a tag is not
* one of STORY_TAGS.
*/
setSceneStoryTags(sceneId, tags) {
const scene = this._project.scenes.find(({ id }) => id === sceneId);
const next = [...new Set(tags)];
if (
!scene ||
next.length > STORY_TAG_LIMIT ||
!next.every((tag) => STORY_TAGS.includes(tag))
)
return false;
if (next.length) scene.storyTags = next;
else delete scene.storyTags;
this._saveProject();
this._publish({ type: 'story-details-changed', scene });
if (scene.stories) this._publish({ type: 'stories-changed' });
return true;
}
/**
* THUMBNAIL: keep the globe as drawn now as the selected scene's
* Stories card image.
* @returns {Promise<boolean>} Whether a thumbnail was stored.
*/
async captureSceneThumb() {
const scene = this._getSelectedScene();
if (!scene || this._destroyed) return false;
let thumb;
try {
thumb = await captureStoryThumb(this.viewer, {
createCanvas: () => document.createElement('canvas'),
});
} catch (error) {
console.warn('[Scenes] Could not capture the thumbnail:', error);
if (!this._destroyed)
this._updateStatus(() => t('Thumbnail could not be captured'));
return false;
}
// The scene may have gone while the frame was drawn.
if (this._destroyed || !this._project.scenes.includes(scene)) return false;
return this.setSceneStoryThumb(scene.id, thumb);
}
/**
* Store a scene's Stories card thumbnail.
* @param {string} sceneId
* @param {string} thumb A JPEG or PNG data URL (see storyThumb.js).
* @returns {boolean} False when the scene does not exist.
*/
setSceneStoryThumb(sceneId, thumb) {
const scene = this._project.scenes.find(({ id }) => id === sceneId);
if (!scene) return false;
const previous = scene.storyThumb;
scene.storyThumb = thumb;
if (!this._saveProject()) {
// An invalid or oversized image is not kept; the save error is shown.
if (previous === undefined) delete scene.storyThumb;
else scene.storyThumb = previous;
return false;
}
this._publish({ type: 'story-details-changed', scene });
if (scene.stories) this._publish({ type: 'stories-changed' });
this._updateStatus(() => t('Thumbnail captured'));
return true;
}
/**
@@ -976,17 +1084,23 @@ export class SceneDirector {
/**
* Capture the current camera position, visual state, and layer states as a
* new shot appended to the selected scene. No-op if no scene is selected.
* new shot appended to the selected scene, creating a scene first when none
* is selected.
*/
captureShot() {
const scene = this._getSelectedScene();
if (!scene) return;
const camera = this.styleManager.getCameraState();
if (!camera) {
this._updateStatus(() => t('Cannot capture shot: camera not ready'));
return;
}
// With no scene, start one first, as NEW SCENE does.
if (!this._getSelectedScene())
this._createScene(
// i18n-ignore: stored English, like _createScene's own fallback.
`Scene ${this._project.scenes.length + 1}`,
);
const scene = this._getSelectedScene();
if (!scene) return;
const shot = normalizeShot(
{
@@ -1006,6 +1120,7 @@ export class SceneDirector {
this._selectedShotId = shot.id;
const saved = this._saveProject();
this._shotOutcome('shot-captured', scene, shot);
if (scene.stories) this._publish({ type: 'stories-changed' });
if (saved) {
this._updateStatus(() =>
t('Captured: {scene} / {shot}', {
@@ -1041,6 +1156,8 @@ export class SceneDirector {
const saved = this._saveProject();
this._shotOutcome('shot-updated', scene, shot);
if (scene.stories && scene.shots[0] === shot)
this._publish({ type: 'stories-changed' });
if (saved) {
this._updateStatus(() =>
t('Updated: {scene} / {shot}', {
@@ -1063,8 +1180,12 @@ export class SceneDirector {
const index = scene.shots.indexOf(shot);
scene.shots = scene.shots.filter((item) => item.id !== shot.id);
this._selectedShotId = scene.shots[0]?.id || null;
const inStories = !!scene.stories;
// A scene without shots has nothing to show in Stories.
if (!scene.shots.length) delete scene.stories;
this._saveProject();
this._shotOutcome('shot-deleted', scene, shot, index);
if (inStories) this._publish({ type: 'stories-changed' });
}
/**
@@ -1526,6 +1647,25 @@ export class SceneDirector {
return this._clock.publish(scene, shot, sceneElapsedSec, options);
}
/**
* Resolves once no run is in progress and every LOAD, seek and interaction
* tracked so far has settled, including work started while waiting. Callers
* that put a view back after a scene (Stories' Close) wait on this rather
* than on `running`, which a LOAD never sets.
* @returns {Promise<void>}
*/
async whenIdle() {
for (;;) {
await this._waitForRunIdle();
const pending = [...(this._pendingWork || [])];
if (!pending.length) {
if (!this._running) return;
continue;
}
await Promise.allSettled(pending);
}
}
/** Wait for an interrupted run to release camera and layer ownership. */
_waitForRunIdle() {
if (!this._running) return Promise.resolve();
@@ -1794,6 +1934,140 @@ export class SceneDirector {
}));
}
/**
* One scene's shots in play order with their display titles and where each
* starts on the scene clock, for callers that show or resume a scene by
* shot (Stories).
* @param {string} sceneId
* @returns {Array<{id: string, title: string, startSec: number, durationSec: number}>}
*/
listShots(sceneId) {
const scene = this._project.scenes.find(({ id }) => id === sceneId);
return (scene?.shots ?? []).map((shot) => {
const timing = this._sceneTimingForShot(scene, shot);
return {
id: shot.id,
title: displayShotTitle(shot.title, shot, scene),
startSec: timing.startElapsedSec,
durationSec: timing.durationSec,
};
});
}
/**
* Select a scene and one of its shots in the Scenes panel, as picking them
* there does (Stories' "Open in GEV" hands a story over for authoring).
* @param {string} sceneId
* @param {string|null} [shotId] Defaults to the scene's first shot.
* @returns {boolean} False when the scene is not installed.
*/
selectShot(sceneId, shotId = null) {
// No scene: AUTHORING goes back to "No scene yet".
if (sceneId == null) {
this._selectedSceneId = null;
this._selectedShotId = null;
this._renderSceneSelect();
this._renderShotList();
return true;
}
const scene = this._project.scenes.find(({ id }) => id === sceneId);
if (!scene) return false;
this._selectedSceneId = scene.id;
this._selectedShotId = scene.shots.some(({ id }) => id === shotId)
? shotId
: (scene.shots[0]?.id ?? null);
this._renderSceneSelect();
this._renderShotList();
return true;
}
/**
* Whether the project has this scene (a built-in can be deleted, or be
* missing from an imported project).
* @param {string} sceneId
* @returns {boolean}
*/
hasScene(sceneId) {
return this._project.scenes.some(
({ id, shots }) => id === sceneId && shots.length > 0,
);
}
/**
* The scene and shot AUTHORING has selected, for putting back after
* playback (Stories plays a scene by selecting it).
* @returns {{sceneId: string|null, shotId: string|null}}
*/
selection() {
return {
sceneId: this._selectedSceneId ?? null,
shotId: this._selectedShotId ?? null,
};
}
/**
* Publish a scene to the Stories page, or take it off.
* @param {string} sceneId
* @param {boolean} on
* @returns {boolean} False when the scene does not exist, or has no shots
* and `on` is true.
*/
setSceneInStories(sceneId, on) {
const scene = this._project.scenes.find(({ id }) => id === sceneId);
if (!scene || (on && !scene.shots.length)) return false;
if (on) scene.stories = true;
else delete scene.stories;
this._saveProject();
this._publish({ type: 'stories-changed' });
return true;
}
/**
* The scenes published to Stories that have a shot, in project order.
* `camera` is the first shot's camera as captured; `thumb` is the card
* thumbnail's data URL ('' when none was captured) and `tags` its tags.
* @returns {Array<{id: string, title: string, camera: object, shotCount: number, thumb: string, tags: string[]}>}
*/
storyScenes() {
return this._project.scenes
.filter((scene) => scene.stories === true && scene.shots.length > 0)
.map((scene) => ({
id: scene.id,
title: displaySceneTitle(scene),
camera: deepClone(scene.shots[0].camera),
shotCount: scene.shots.length,
thumb: scene.storyThumb ?? '',
tags: [...(scene.storyTags ?? [])],
}));
}
/**
* The person's own scenes that are not on the Stories page, with a shot:
* Stories lists them as drafts, visible only here, so a scene made in
* AUTHORING can always be opened again from Stories.
* @returns {Array<{id: string, title: string, camera: object, shotCount: number, thumb: string, tags: string[]}>}
*/
draftScenes() {
const builtIn = new Set(
[...SCENE_RECIPES, ...SCENE_APPEND_RECIPES].map(({ id }) => id),
);
return this._project.scenes
.filter(
(scene) =>
scene.stories !== true &&
scene.shots.length > 0 &&
!builtIn.has(scene.id),
)
.map((scene) => ({
id: scene.id,
title: displaySceneTitle(scene),
camera: deepClone(scene.shots[0].camera),
shotCount: scene.shots.length,
thumb: scene.storyThumb ?? '',
tags: [...(scene.storyTags ?? [])],
}));
}
/**
* Finds a scene by id, exact title, or case-insensitive title substring.
* @param {string} query - Scene id or (partial) title.
@@ -2203,13 +2477,23 @@ export class SceneDirector {
),
);
this._storageReadError = null;
this._selectedSceneId =
selection?.sceneId || project.scenes[0]?.id || null;
// Keep authoring on the named or current scene, else the first scene
// that is not a built-in one, else none.
const builtIn = new Set(SCENE_RECIPES.map(({ id }) => id));
const selected =
project.scenes.find(({ id }) => id === selection?.sceneId) ||
project.scenes.find(({ id }) => id === this._selectedSceneId) ||
project.scenes.find(({ id }) => !builtIn.has(id)) ||
null;
this._selectedSceneId = selected?.id ?? null;
this._selectedShotId =
selection?.shotId || project.scenes[0]?.shots[0]?.id || null;
selected?.shots.find(({ id }) => id === selection?.shotId)?.id ||
selected?.shots[0]?.id ||
null;
this._loadedSceneId = null;
const saved = this._saveProject();
this._publish({ type: 'project-imported', project });
this._publish({ type: 'stories-changed' });
if (saved)
this._updateStatus(() => t('Imported {file}', { file: file.name }));
return true;
+567 -2
View File
@@ -19,8 +19,10 @@ import test from 'node:test';
import { LayerLifecycle } from '../data/lifecycle.js';
import { SceneDirector } from './director.js';
import { stringifySceneDocument } from '../director/document.js';
import { SCENE_TRACKING_PARAM_KEYS } from './scenePolicy.js';
import { SCENE_RECIPES, getSceneAppendRecipeById } from './recipes.js';
import { STORY_TAGS } from './storyTags.js';
const NEPAL_ORIGINAL_SHOT_TITLES = [
'Global Incident Context',
@@ -719,8 +721,9 @@ test('a legacy three-shot Nepal browser project bootstraps to the current 25-sho
for (const shot of scene.shots.slice(0, 8)) {
assert.equal(scene.appliedShotPacks[0].shotBindings[shot.title], shot.id);
}
assert.equal(director._selectedSceneId, scene.id);
assert.equal(director._selectedShotId, scene.shots[0].id);
// The upgrade selects nothing: authoring starts with no scene.
assert.equal(director._selectedSceneId, null);
assert.equal(director._selectedShotId, null);
} finally {
restore();
}
@@ -1798,6 +1801,7 @@ test('Scene snapshots are immutable and editing outcomes retain the affected sho
const { director, restore } = makeDirector();
try {
director._activeRun = null;
director.selectShot('scene-1');
const seen = [];
const unsubscribe = director.subscribe((notification) => seen.push(notification));
assert.equal(seen[0].initial, true);
@@ -2029,3 +2033,564 @@ test('a caught run failure resolves as run-failed, not success (#971)', async ()
);
} finally { console.warn = warn; await director.destroy(); restore(); }
});
test('listShots gives a scene its shots in order, each starting where the last ends', () => {
const { director, restore } = makeDirector();
try {
const scene = director._project.scenes[0];
const shots = director.listShots(scene.id);
assert.deepEqual(
shots.map((s) => s.id),
scene.shots.map((s) => s.id),
);
assert.equal(shots[0].startSec, 0);
for (let i = 1; i < shots.length; i++)
assert.equal(
shots[i].startSec,
shots[i - 1].startSec + shots[i - 1].durationSec,
);
assert.ok(shots.every((s) => typeof s.title === 'string' && s.title));
assert.deepEqual(director.listShots('no-such-scene'), []);
} finally {
restore();
}
});
test('selectShot selects a scene and shot for authoring, falling back to the first shot', () => {
const { director, restore } = makeDirector();
try {
const scene = director._project.scenes.at(-1);
const last = scene.shots.at(-1);
assert.equal(director.selectShot(scene.id, last.id), true);
assert.equal(director._selectedSceneId, scene.id);
assert.equal(director._selectedShotId, last.id);
assert.equal(director.selectShot(scene.id, 'no-such-shot'), true);
assert.equal(director._selectedShotId, scene.shots[0].id);
assert.equal(director.selectShot('no-such-scene'), false);
assert.deepEqual(director.selection(), {
sceneId: scene.id,
shotId: scene.shots[0].id,
});
assert.equal(director.hasScene(scene.id), true);
assert.equal(director.hasScene('no-such-scene'), false);
// No scene: back to "No scene yet".
assert.equal(director.selectShot(null), true);
assert.deepEqual(director.selection(), { sceneId: null, shotId: null });
} finally {
restore();
}
});
test('whenIdle waits for tracked work, including work started while waiting', async () => {
const { director, restore } = makeDirector();
try {
let first;
let second;
director._trackWork(new Promise((resolve) => (first = resolve)));
let idle = false;
const waiting = director.whenIdle().then(() => (idle = true));
await settle();
director._trackWork(new Promise((resolve) => (second = resolve)));
first();
await settle();
assert.equal(idle, false, 'the later work is still pending');
second();
await waiting;
assert.equal(idle, true);
} finally {
restore();
}
});
/** Record the change types a director publishes. */
function recordChanges(director) {
const types = [];
director.subscribe(({ change }) => {
if (change?.type) types.push(change.type);
});
return types;
}
const savedProject = () =>
JSON.parse(localStorage.getItem('godsEyeView.sceneProject.v2'));
test('setSceneInStories saves the flag, publishes, and storyScenes lists the scene', () => {
const { director, restore } = makeDirector();
try {
const changes = recordChanges(director);
const scene = director._project.scenes[0];
assert.deepEqual(director.storyScenes(), []);
assert.equal(director.setSceneInStories(scene.id, true), true);
assert.equal(savedProject().scenes[0].stories, true);
assert.ok(changes.includes('stories-changed'));
assert.deepEqual(director.storyScenes(), [
{
id: scene.id,
title: 'Fixture Scene',
camera: {
lat: 10,
lon: 20,
alt: 500000,
heading: 0,
pitch: -40,
roll: 0,
},
shotCount: 2,
thumb: '',
tags: [],
},
]);
// The camera is a copy; editing it leaves the project alone.
director.storyScenes()[0].camera.lat = 0;
assert.equal(scene.shots[0].camera.lat, 10);
changes.length = 0;
assert.equal(director.setSceneInStories(scene.id, false), true);
assert.equal(Object.hasOwn(savedProject().scenes[0], 'stories'), false);
assert.deepEqual(changes, ['stories-changed']);
assert.deepEqual(director.storyScenes(), []);
assert.equal(director.setSceneInStories('no-such-scene', true), false);
} finally {
restore();
}
});
test('draftScenes lists the person’s own scenes with shots that are not on the Stories page', () => {
const { director, restore } = makeDirector();
try {
const scene = director._project.scenes[0];
// The fixture scene is the person's own: a draft until saved.
assert.deepEqual(
director.draftScenes().map(({ id }) => id),
[scene.id],
);
director.setSceneInStories(scene.id, true);
assert.deepEqual(director.draftScenes(), [], 'saved: no longer a draft');
director.setSceneInStories(scene.id, false);
// A built-in scene is never a draft.
scene.id = 'flights-radar';
assert.deepEqual(director.draftScenes(), []);
} finally {
restore();
}
});
test('a scene without shots cannot be saved to Stories', () => {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes.push({ id: 'empty', title: 'Empty', shots: [] });
const { director, restore } = makeDirector({ project });
try {
const changes = recordChanges(director);
assert.equal(director.setSceneInStories('empty', true), false);
assert.equal(Object.hasOwn(director._project.scenes[1], 'stories'), false);
assert.equal(changes.includes('stories-changed'), false);
// Taking it off is always allowed.
assert.equal(director.setSceneInStories('empty', false), true);
} finally {
restore();
}
});
test('the Stories flag survives a reload and an export/import round trip', async () => {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes.push({
id: 'scene-2',
title: 'Second',
shots: PROJECT_FIXTURE.scenes[0].shots.map((shot) => ({
...structuredClone(shot),
id: `${shot.id}-2`,
})),
});
const first = makeDirector({ project });
let saved;
try {
first.director.setSceneInStories('scene-2', true);
saved = localStorage.getItem('godsEyeView.sceneProject.v2');
} finally {
first.restore();
}
const { director, restore } = makeDirector({
storage: { 'godsEyeView.sceneProject.v2': saved },
});
try {
assert.deepEqual(
director.storyScenes().map((s) => s.id),
['scene-2'],
);
const exported = stringifySceneDocument(director._project);
director.setSceneInStories('scene-2', false);
const changes = recordChanges(director);
assert.equal(
await director.importProjectFile({
name: 'scenes.json',
text: async () => exported,
}),
true,
);
assert.ok(changes.includes('stories-changed'));
assert.deepEqual(
director.storyScenes().map((s) => s.id),
['scene-2'],
);
assert.equal(savedProject().scenes[1].stories, true);
assert.equal(Object.hasOwn(savedProject().scenes[0], 'stories'), false);
} finally {
restore();
}
});
test('projects saved before the Stories flag still load, and a malformed flag is refused', async () => {
const { director, restore } = makeDirector();
try {
assert.equal(Object.hasOwn(director._project.scenes[0], 'stories'), false);
const project = structuredClone(PROJECT_FIXTURE);
project.scenes[0].stories = 'yes';
const before = director._project;
await director.importProjectFile({
name: 'bad.json',
text: async () => JSON.stringify(project),
});
assert.equal(director._project, before);
assert.match(director._presentation.status, /stories: expected true/);
} finally {
restore();
}
});
test('deleting a scene or its last shot in Stories publishes stories-changed', () => {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes.push({
id: 'scene-2',
title: 'Second',
shots: [
{ ...structuredClone(PROJECT_FIXTURE.scenes[0].shots[0]), id: 'only' },
],
});
const { director, restore } = makeDirector({ project });
try {
director.setSceneInStories('scene-1', true);
director.setSceneInStories('scene-2', true);
const changes = recordChanges(director);
director.deleteShot('scene-2', 'only');
assert.ok(changes.includes('stories-changed'));
assert.equal(Object.hasOwn(director._project.scenes[1], 'stories'), false);
assert.deepEqual(
director.storyScenes().map((s) => s.id),
['scene-1'],
);
changes.length = 0;
director.selectShot('scene-1');
director._deleteSelectedScene();
assert.ok(changes.includes('scene-deleted'));
assert.ok(changes.includes('stories-changed'));
assert.deepEqual(director.storyScenes(), []);
} finally {
restore();
}
});
test('authoring selects no scene on load, with or without a saved project', () => {
for (const options of [{}, { storage: {} }]) {
const { director, restore } = makeDirector(options);
try {
assert.ok(
director._project.scenes.length > 0,
'the scenes stay in the project',
);
assert.equal(director._selectedSceneId, null);
assert.equal(director._selectedShotId, null);
assert.equal(director._getSelectedScene(), null);
director._renderSceneSelect();
assert.equal(
director._selectedSceneId,
null,
'nothing falls back to the first scene',
);
} finally {
restore();
}
}
});
test('capture with no scene starts a new scene and captures into it', () => {
const { director, restore } = makeDirector();
try {
const changes = recordChanges(director);
const before = director._project.scenes.length;
director.captureShot();
assert.equal(director._project.scenes.length, before + 1);
const scene = director._project.scenes.at(-1);
assert.equal(scene.title, `Scene ${before + 1}`);
assert.equal(director._selectedSceneId, scene.id);
assert.equal(scene.shots.length, 1);
assert.equal(director._selectedShotId, scene.shots[0].id);
assert.deepEqual(
changes.filter((type) =>
['scene-created', 'shot-captured'].includes(type),
),
['scene-created', 'shot-captured'],
);
assert.equal(savedProject().scenes.at(-1).shots.length, 1);
} finally {
restore();
}
});
test('capture with no scene and no camera creates nothing', () => {
const { director, styleManager, restore } = makeDirector();
try {
styleManager.getCameraState = () => null;
const before = director._project.scenes.length;
director.captureShot();
assert.equal(director._project.scenes.length, before);
assert.equal(director._selectedSceneId, null);
} finally {
restore();
}
});
test('deleting the current scene selects none', () => {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes.push({ id: 'scene-2', title: 'Second', shots: [] });
const { director, restore } = makeDirector({ project });
try {
director.selectShot('scene-2');
director._deleteSelectedScene();
assert.equal(director._selectedSceneId, null);
assert.equal(director._selectedShotId, null);
assert.deepEqual(
director._project.scenes.map(({ id }) => id),
['scene-1'],
);
} finally {
restore();
}
});
test('an import keeps the current scene, else picks a non-built-in scene, else none', async () => {
const { director, restore } = makeDirector();
try {
const exported = stringifySceneDocument(director._project);
const file = { name: 'scenes.json', text: async () => exported };
assert.equal(await director.importProjectFile(file), true);
assert.equal(director._selectedSceneId, 'scene-1', 'the authored scene');
const builtIn = JSON.stringify({
version: 6,
scenes: [
{
...structuredClone(PROJECT_FIXTURE.scenes[0]),
id: SCENE_RECIPES[0].id,
},
],
});
assert.equal(
await director.importProjectFile({
name: 'b.json',
text: async () => builtIn,
}),
true,
);
assert.equal(
director._selectedSceneId,
null,
'a built-in scene is never picked',
);
} finally {
restore();
}
});
const THUMB = 'data:image/jpeg;base64,/9j/AAAA';
test('story thumbnail and tags are saved, listed and announced for a scene in Stories', () => {
const { director, restore } = makeDirector();
try {
const changes = recordChanges(director);
assert.equal(director.setSceneStoryThumb('scene-1', THUMB), true);
assert.equal(
director.setSceneStoryTags('scene-1', ['Floods', 'Climate']),
true,
);
assert.equal(savedProject().scenes[0].storyThumb, THUMB);
assert.deepEqual(savedProject().scenes[0].storyTags, ['Floods', 'Climate']);
assert.equal(
changes.filter((type) => type === 'story-details-changed').length,
2,
);
assert.equal(
changes.includes('stories-changed'),
false,
'not in Stories yet',
);
director.setSceneInStories('scene-1', true);
assert.equal(director.storyScenes()[0].thumb, THUMB);
assert.deepEqual(director.storyScenes()[0].tags, ['Floods', 'Climate']);
director.storyScenes()[0].tags.push('Space');
assert.deepEqual(director._project.scenes[0].storyTags, [
'Floods',
'Climate',
]);
changes.length = 0;
director.setSceneStoryThumb('scene-1', 'data:image/png;base64,AAAA');
assert.ok(changes.includes('stories-changed'));
changes.length = 0;
director.selectShot('scene-1');
director._toggleSelectedSceneTag('Floods');
assert.ok(changes.includes('stories-changed'));
assert.deepEqual(director.storyScenes()[0].tags, ['Climate']);
director._toggleSelectedSceneTag('Climate');
assert.equal(
Object.hasOwn(director._project.scenes[0], 'storyTags'),
false,
);
assert.deepEqual(director.storyScenes()[0].tags, []);
// Unknown tags, more than five, or no such scene are refused.
assert.equal(director.setSceneStoryTags('scene-1', ['Nope']), false);
assert.equal(
director.setSceneStoryTags('scene-1', STORY_TAGS.slice(0, 6)),
false,
);
assert.equal(director.setSceneStoryTags('no-such-scene', []), false);
assert.equal(director.setSceneStoryThumb('no-such-scene', THUMB), false);
director.setSceneStoryTags('scene-1', STORY_TAGS.slice(0, 5));
director._toggleSelectedSceneTag(STORY_TAGS[5]);
assert.equal(director._project.scenes[0].storyTags.length, 5);
} finally {
restore();
}
});
test('an invalid thumbnail is not kept and the save error is shown', () => {
const { director, restore } = makeDirector();
try {
// A thumbnail may pass the usual 65,536-character text limit.
const large = `data:image/jpeg;base64,${'A'.repeat(200000)}`;
assert.equal(director.setSceneStoryThumb('scene-1', large), true);
assert.equal(savedProject().scenes[0].storyThumb, large);
director.setSceneStoryThumb('scene-1', THUMB);
assert.equal(
director.setSceneStoryThumb('scene-1', 'https://example.com/a.jpg'),
false,
);
assert.equal(director._project.scenes[0].storyThumb, THUMB);
assert.match(director._presentation.status, /Scene not saved/);
} finally {
restore();
}
});
test('story thumbnail and tags survive a reload and an export/import round trip', async () => {
const first = makeDirector();
let saved;
try {
first.director.setSceneStoryThumb('scene-1', THUMB);
first.director.setSceneStoryTags('scene-1', ['Storms']);
saved = localStorage.getItem('godsEyeView.sceneProject.v2');
} finally {
first.restore();
}
const { director, restore } = makeDirector({
storage: { 'godsEyeView.sceneProject.v2': saved },
});
try {
const scene = director._project.scenes.find(({ id }) => id === 'scene-1');
assert.equal(scene.storyThumb, THUMB);
assert.deepEqual(scene.storyTags, ['Storms']);
const exported = stringifySceneDocument(director._project);
director.setSceneStoryTags('scene-1', []);
director.setSceneStoryThumb('scene-1', 'data:image/png;base64,AAAA');
assert.equal(
await director.importProjectFile({
name: 'scenes.json',
text: async () => exported,
}),
true,
);
assert.equal(director._project.scenes[0].storyThumb, THUMB);
assert.deepEqual(director._project.scenes[0].storyTags, ['Storms']);
assert.equal(savedProject().scenes[0].storyThumb, THUMB);
} finally {
restore();
}
});
test('imports with a malformed thumbnail or tags are refused', async () => {
const { director, restore } = makeDirector();
try {
const before = director._project;
for (const [field, value, reason] of [
[
'storyThumb',
'data:image/gif;base64,AAAA',
/storyThumb: expected a JPEG or PNG data URL/,
],
[
'storyThumb',
`data:image/jpeg;base64,${'A'.repeat(300000)}`,
/storyThumb/,
],
[
'storyTags',
['Floods', 'Floods'],
/storyTags: expected at most 5 different Stories tags/,
],
['storyTags', ['Volcanoes'], /storyTags/],
['storyTags', STORY_TAGS.slice(0, 6), /storyTags/],
]) {
const project = structuredClone(PROJECT_FIXTURE);
project.scenes[0][field] = value;
await director.importProjectFile({
name: 'bad.json',
text: async () => JSON.stringify(project),
});
assert.equal(director._project, before, field);
assert.match(director._presentation.status, reason);
}
} finally {
restore();
}
});
test('THUMBNAIL stores the frame read in postRender on the selected scene', async () => {
const { director, viewer, restore } = makeDirector();
const createElement = document.createElement;
try {
assert.equal(
await director.captureSceneThumb(),
false,
'no scene, no capture',
);
director.selectShot('scene-1');
const listeners = new Set();
viewer.scene = {
canvas: { width: 640, height: 360 },
postRender: {
addEventListener(listener) {
listeners.add(listener);
return () => listeners.delete(listener);
},
},
requestRender: () => [...listeners].forEach((listener) => listener()),
};
document.createElement = () => ({
getContext: () => ({ drawImage() {} }),
toDataURL: () => THUMB,
});
assert.equal(await director.captureSceneThumb(), true);
assert.equal(director._project.scenes[0].storyThumb, THUMB);
assert.equal(director._presentation.status, 'Thumbnail captured');
viewer.scene = null;
assert.equal(await director.captureSceneThumb(), false);
assert.equal(
director._presentation.status,
'Thumbnail could not be captured',
);
} finally {
document.createElement = createElement;
restore();
}
});
+11
View File
@@ -8,6 +8,8 @@ import {
decodeBloomIntensity,
} from '../bloom.js';
import { RETIRED_STYLES } from '../visualStylePolicy.js';
import { isStoryTagList } from './storyTags.js';
import { isStoryThumb } from './storyThumb.js';
/** @constant {number} Current schema version for project migration */
export const PROJECT_VERSION = SCENE_DOCUMENT_VERSION;
@@ -359,6 +361,15 @@ export function normalizeProject(rawProject) {
title: scene?.title || `Scene ${sceneIdx + 1}`,
...(scene?.dataPacks ? { dataPacks: deepClone(scene.dataPacks) } : {}),
...(scene?.anchors ? { anchors: deepClone(scene.anchors) } : {}),
// Published to the Stories page.
...(scene?.stories === true ? { stories: true } : {}),
// The Stories card's thumbnail and tags.
...(isStoryThumb(scene?.storyThumb)
? { storyThumb: scene.storyThumb }
: {}),
...(isStoryTagList(scene?.storyTags) && scene.storyTags.length
? { storyTags: [...scene.storyTags] }
: {}),
releaseLayerIds: [
...new Set(
(Array.isArray(scene?.releaseLayerIds)
+37
View File
@@ -0,0 +1,37 @@
/** The tags a scene saved to Stories can carry, and their limits. */
// Marks each English key for translation without loading the i18n runtime
// into the scene document validator; the panel shows them through t().
const msg = (text) => text;
/** Tag keys in display order; stored in English on `scene.storyTags`. */
export const STORY_TAGS = Object.freeze([
msg('Floods'),
msg('Wildfires'),
msg('Storms'),
msg('Earthquakes'),
msg('Flights'),
msg('Maritime'),
msg('Space'),
msg('Conflict'),
msg('Infrastructure'),
msg('Climate'),
]);
/** At most this many tags per scene. */
export const STORY_TAG_LIMIT = 5;
/**
* Whether `tags` is a valid `storyTags` value: unique keys from STORY_TAGS,
* at most STORY_TAG_LIMIT of them.
* @param {unknown} tags
* @returns {boolean}
*/
export function isStoryTagList(tags) {
return (
Array.isArray(tags) &&
tags.length <= STORY_TAG_LIMIT &&
new Set(tags).size === tags.length &&
tags.every((tag) => STORY_TAGS.includes(tag))
);
}
+139
View File
@@ -0,0 +1,139 @@
/**
* A scene's Stories card thumbnail: captured from the globe, stored as a data
* URL. The scene document validates with this module, so it reaches no
* browser globals; callers hand it the viewer and a canvas factory.
*/
export const STORY_THUMB_WIDTH = 320;
export const STORY_THUMB_HEIGHT = 180;
export const STORY_THUMB_QUALITY = 0.82;
/** Longest `storyThumb` a scene document accepts, in characters. */
export const STORY_THUMB_MAX_LENGTH = 300000;
const STORY_THUMB_PATTERN =
/^data:image\/(?:jpeg|png);base64,[A-Za-z0-9+/]+={0,2}$/;
/**
* Whether `value` is a valid `storyThumb`: a base64 JPEG or PNG data URL of
* at most STORY_THUMB_MAX_LENGTH characters.
* @param {unknown} value
* @returns {boolean}
*/
export function isStoryThumb(value) {
return (
typeof value === 'string' &&
value.length <= STORY_THUMB_MAX_LENGTH &&
STORY_THUMB_PATTERN.test(value)
);
}
/**
* The centred part of a `width`×`height` source with the target's aspect.
* @returns {{x: number, y: number, width: number, height: number}}
*/
export function centreCrop(
width,
height,
targetWidth = STORY_THUMB_WIDTH,
targetHeight = STORY_THUMB_HEIGHT,
) {
const aspect = targetWidth / targetHeight;
const cropWidth = Math.min(width, height * aspect);
const cropHeight = Math.min(height, width / aspect);
return {
x: Math.round((width - cropWidth) / 2),
y: Math.round((height - cropHeight) / 2),
width: Math.round(cropWidth),
height: Math.round(cropHeight),
};
}
/**
* Draw the centre crop of `source` into a STORY_THUMB_WIDTH×HEIGHT JPEG data
* URL, halving in steps so a large canvas downscales smoothly.
* @param {HTMLCanvasElement} source
* @param {() => HTMLCanvasElement} createCanvas Makes an empty canvas.
* @returns {string}
*/
export function encodeStoryThumb(source, createCanvas) {
const crop = centreCrop(source.width, source.height);
if (!crop.width || !crop.height) throw new Error('Nothing to capture');
let image = source;
let area = crop;
// Halve until one more halving would undershoot the target.
while (area.width / 2 >= STORY_THUMB_WIDTH) {
const step = createCanvas();
step.width = Math.round(area.width / 2);
step.height = Math.round(area.height / 2);
const context = step.getContext('2d');
context.imageSmoothingQuality = 'high';
context.drawImage(
image,
area.x,
area.y,
area.width,
area.height,
0,
0,
step.width,
step.height,
);
image = step;
area = { x: 0, y: 0, width: step.width, height: step.height };
}
const out = createCanvas();
out.width = STORY_THUMB_WIDTH;
out.height = STORY_THUMB_HEIGHT;
const context = out.getContext('2d');
context.imageSmoothingQuality = 'high';
context.drawImage(
image,
area.x,
area.y,
area.width,
area.height,
0,
0,
STORY_THUMB_WIDTH,
STORY_THUMB_HEIGHT,
);
// A very busy view can exceed the limit; lower the quality until it fits.
for (const quality of [STORY_THUMB_QUALITY, 0.7, 0.55, 0.4]) {
const url = out.toDataURL('image/jpeg', quality);
if (isStoryThumb(url)) return url;
}
throw new Error('Thumbnail too large');
}
/**
* Capture the globe as it is drawn now. The WebGL canvas has no
* preserveDrawingBuffer, so it is read inside the next postRender, while the
* frame is still in the drawing buffer; a render is requested for it.
* @param {object} viewer Cesium viewer (its `scene`).
* @param {object} options
* @param {() => HTMLCanvasElement} options.createCanvas Makes an empty canvas.
* @param {number} [options.timeoutMs] Give up when no frame is drawn.
* @returns {Promise<string>} JPEG data URL.
*/
export function captureStoryThumb(viewer, { createCanvas, timeoutMs = 3000 }) {
const scene = viewer?.scene;
if (!scene?.postRender || !scene.canvas)
return Promise.reject(new Error('Globe not ready'));
return new Promise((resolve, reject) => {
let timer = null;
const remove = scene.postRender.addEventListener(() => {
remove();
clearTimeout(timer);
try {
resolve(encodeStoryThumb(scene.canvas, createCanvas));
} catch (error) {
reject(error);
}
});
timer = setTimeout(() => {
remove();
reject(new Error('No frame was drawn'));
}, timeoutMs);
scene.requestRender?.();
});
}
+173
View File
@@ -0,0 +1,173 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {
STORY_THUMB_HEIGHT,
STORY_THUMB_MAX_LENGTH,
STORY_THUMB_WIDTH,
captureStoryThumb,
centreCrop,
encodeStoryThumb,
isStoryThumb,
} from './storyThumb.js';
import { STORY_TAGS, isStoryTagList } from './storyTags.js';
/** Canvas double recording each draw; toDataURL answers `url(quality)`. */
function fakeCanvases(url = () => 'data:image/jpeg;base64,AAAA') {
const made = [];
const create = () => {
const canvas = {
width: 0,
height: 0,
draws: [],
qualities: [],
getContext: () => ({
drawImage: (...args) => canvas.draws.push(args),
}),
toDataURL: (type, quality) => {
canvas.qualities.push([type, quality]);
return url(quality);
},
};
made.push(canvas);
return canvas;
};
return { made, create };
}
test('centreCrop keeps the centred 16:9 part of a wider or taller source', () => {
assert.deepEqual(centreCrop(1920, 1080), {
x: 0,
y: 0,
width: 1920,
height: 1080,
});
assert.deepEqual(centreCrop(2000, 1000), {
x: 111,
y: 0,
width: 1778,
height: 1000,
});
assert.deepEqual(centreCrop(800, 1000), {
x: 0,
y: 275,
width: 800,
height: 450,
});
});
test('encodeStoryThumb halves a large view down to 320x180 JPEG at 0.82', () => {
const { made, create } = fakeCanvases();
const source = { width: 2000, height: 1000 };
const url = encodeStoryThumb(source, create);
assert.equal(url, 'data:image/jpeg;base64,AAAA');
// 1778 wide halves to 889, then 445, then the final 320x180.
assert.deepEqual(
made.map(({ width, height }) => [width, height]),
[
[889, 500],
[445, 250],
[STORY_THUMB_WIDTH, STORY_THUMB_HEIGHT],
],
);
assert.deepEqual(
made[0].draws[0].slice(1),
[111, 0, 1778, 1000, 0, 0, 889, 500],
);
assert.deepEqual(made.at(-1).qualities, [['image/jpeg', 0.82]]);
});
test('encodeStoryThumb lowers the quality until the image fits, then gives up', () => {
const big = 'data:image/jpeg;base64,' + 'A'.repeat(STORY_THUMB_MAX_LENGTH);
const fits = fakeCanvases((quality) =>
quality > 0.6 ? big : 'data:image/jpeg;base64,AAAA',
);
assert.equal(
encodeStoryThumb({ width: 320, height: 180 }, fits.create),
'data:image/jpeg;base64,AAAA',
);
assert.deepEqual(
fits.made.at(-1).qualities.map(([, quality]) => quality),
[0.82, 0.7, 0.55],
);
const never = fakeCanvases(() => big);
assert.throws(
() => encodeStoryThumb({ width: 320, height: 180 }, never.create),
/too large/,
);
assert.throws(
() => encodeStoryThumb({ width: 0, height: 0 }, never.create),
/Nothing to capture/,
);
});
/** A Cesium scene double: postRender listeners run on requestRender. */
function fakeViewer({ draws = true } = {}) {
const listeners = new Set();
const scene = {
canvas: { width: 640, height: 360 },
renders: 0,
postRender: {
addEventListener(listener) {
listeners.add(listener);
return () => listeners.delete(listener);
},
},
requestRender() {
scene.renders++;
if (draws) for (const listener of [...listeners]) listener();
},
listeners,
};
return { scene };
}
test('captureStoryThumb reads the canvas inside the postRender it requested', async () => {
const viewer = fakeViewer();
const { create } = fakeCanvases();
const url = await captureStoryThumb(viewer, { createCanvas: create });
assert.equal(url, 'data:image/jpeg;base64,AAAA');
assert.equal(viewer.scene.renders, 1);
assert.equal(viewer.scene.listeners.size, 0, 'the listener is removed');
});
test('captureStoryThumb gives up when no frame is drawn or there is no globe', async () => {
const viewer = fakeViewer({ draws: false });
await assert.rejects(
captureStoryThumb(viewer, {
createCanvas: fakeCanvases().create,
timeoutMs: 1,
}),
/No frame was drawn/,
);
assert.equal(viewer.scene.listeners.size, 0);
await assert.rejects(
captureStoryThumb({}, { createCanvas: fakeCanvases().create }),
/Globe not ready/,
);
});
test('isStoryThumb accepts only bounded base64 JPEG or PNG data URLs', () => {
assert.equal(isStoryThumb('data:image/jpeg;base64,AAAA'), true);
assert.equal(isStoryThumb('data:image/png;base64,AAA='), true);
for (const value of [
'',
null,
42,
'data:image/gif;base64,AAAA',
'data:image/jpeg,AAAA',
'https://example.com/a.jpg',
'data:image/jpeg;base64,AA"A',
'data:image/jpeg;base64,' + 'A'.repeat(STORY_THUMB_MAX_LENGTH),
])
assert.equal(isStoryThumb(value), false, String(value).slice(0, 40));
});
test('isStoryTagList accepts up to five different known tags', () => {
assert.equal(STORY_TAGS.length, 10);
assert.equal(isStoryTagList([]), true);
assert.equal(isStoryTagList(STORY_TAGS.slice(0, 5)), true);
assert.equal(isStoryTagList(STORY_TAGS.slice(0, 6)), false);
assert.equal(isStoryTagList(['Floods', 'Floods']), false);
assert.equal(isStoryTagList(['floods']), false);
assert.equal(isStoryTagList('Floods'), false);
});
+44 -2
View File
@@ -345,15 +345,35 @@ export class ShareLinkManager {
const target = globalThis.window;
if (typeof target?.addEventListener !== 'function') return;
const handler = () => this._handleLocationChange(onNavigate);
this._onNavigate = onNavigate;
target.addEventListener('hashchange', handler);
target.addEventListener('popstate', handler);
this._unwatchNavigation = () => {
target.removeEventListener('hashchange', handler);
target.removeEventListener('popstate', handler);
this._unwatchNavigation = null;
this._onNavigate = null;
};
}
/**
* Restore a share hash now, even when it is the one the address already
* shows: an owner that changed the view under it (Stories, after a GEV
* scene) hands the person's view back this way. Navigation must be watched.
* @param {string} hash Without the leading `#`.
* @returns {boolean} Whether a restore began.
*/
restore(hash) {
if (this._destroyed || !this._onNavigate || typeof hash !== 'string')
return false;
const url = new URL(window.location.href);
url.hash = hash;
history.replaceState(history.state, '', url.href);
this._knownHash = null;
this._handleLocationChange(this._onNavigate);
return this._knownHash === hash;
}
_handleLocationChange(onNavigate) {
if (this._destroyed) return;
const hash = window.location.hash.slice(1);
@@ -692,8 +712,28 @@ export class ShareLinkManager {
}
}
/**
* Hold the address's hash writes, for an owner that covers the view and
* keeps the person's camera and layers out of the address while it does
* (Stories). Releasing writes the current view again.
* @param {boolean} held
*/
holdWrites(held) {
if (held && !this._writesHeld && this._debounceTimer) {
// A view change still waiting for its debounce is written first, so
// the address the owner saves is the live view.
clearTimeout(this._debounceTimer);
this._debounceTimer = null;
this._updateHash();
}
this._writesHeld = !!held;
if (!held) this._scheduleUpdate();
else clearTimeout(this._debounceTimer);
}
_scheduleUpdate() {
if (this._destroyed || this._initialRestorePending) return;
if (this._destroyed || this._initialRestorePending || this._writesHeld)
return;
clearTimeout(this._debounceTimer);
this._debounceTimer = setTimeout(() => this._updateHash(), DEBOUNCE_MS);
}
@@ -711,7 +751,9 @@ export class ShareLinkManager {
: new URL(window.location.href);
url.hash = params.toString();
this._knownHash = url.hash.slice(1);
history.replaceState(null, '', url.href);
// Keep the entry's state: another owner (Stories) may have stored its
// place there, and a hash update is not a new place.
history.replaceState(history.state, '', url.href);
}
/** Build a deterministic snapshot without mutating history. */
+47
View File
@@ -141,6 +141,53 @@ test("the app's own hash writes never trigger a restore", (t) => {
manager.destroy();
});
test('restore applies a hash even when the address already shows it', (t) => {
installTab(t, SHARE_A);
const manager = new ShareLinkManager(fakeViewer());
manager.completeInitialRestore(manager.parseInitialHash().restoreToken);
const restored = [];
manager.watchNavigation((state) => restored.push(state));
// Back landed here already, so the hash is known and a hashchange is ignored.
window.dispatchEvent(new Event('hashchange'));
assert.equal(restored.length, 0);
assert.equal(manager.restore(SHARE_A), true);
assert.equal(restored.length, 1);
manager.destroy();
});
test('holding writes first writes a view change still waiting for its debounce', (t) => {
installTab(t, SHARE_A);
const timers = installManualTimers(t);
const manager = new ShareLinkManager(fakeViewer());
manager.completeInitialRestore(manager.parseInitialHash().restoreToken);
const before = window.location.hash;
manager._buildHashParams = () => new URLSearchParams('v=2&lat=5');
manager._scheduleUpdate();
assert.equal(window.location.hash, before, 'still waiting');
manager.holdWrites(true);
assert.equal(window.location.hash, '#v=2&lat=5', 'written before the hold');
manager._buildHashParams = () => new URLSearchParams('v=2&lat=9');
manager._scheduleUpdate();
assert.equal(timers.size, 0, 'nothing scheduled while held');
manager.destroy();
});
test('a hash write keeps the state another owner stored on the entry', (t) => {
installTab(t, SHARE_A);
const written = [];
globalThis.history.state = { gevStories: { stories: 'explore', depth: 1 } };
const replace = globalThis.history.replaceState;
globalThis.history.replaceState = (state, title, next) => {
written.push(state);
replace(state, title, next);
};
const manager = new ShareLinkManager(fakeViewer());
manager.completeInitialRestore(manager.parseInitialHash().restoreToken);
manager._updateHash();
assert.deepEqual(written, [{ gevStories: { stories: 'explore', depth: 1 } }]);
manager.destroy();
});
test('a non-share hash is ignored and Back/Forward restores each entry once', (t) => {
const tab = installTab(t, SHARE_A);
const manager = new ShareLinkManager(bindFakeCesiumCamera(fakeViewer()));
+119
View File
@@ -0,0 +1,119 @@
const STORIES_PARAMS = ['stories', 'story'];
const wantsStories = () => {
const params = new URLSearchParams(location.search);
return STORIES_PARAMS.some((p) => params.has(p));
};
/**
* Stories, loaded on first use. The controller, the story catalog, the
* screens and their styles are separate chunks, fetched when the person
* opens Stories, follows a Stories link or
* steps into Stories with Back or Forward. Until then the store holds this
* shell, whose calls load the controller and then run.
*
* @param {{viewer: import('cesium').Viewer,
* director: import('../scenes/director.js').SceneDirector,
* store: ReturnType<typeof import('../ui/stores/stories.js').useStoriesStore>,
* onLoadFailed?: () => void,
* loadModules?: () => Promise<[object, object]>}} options `onLoadFailed`
* tells the person a click did nothing because Stories could not load;
* `available` is false where Stories is not offered (an inline embed:
* its URL and history are the host page's);
* `loadModules` fetches the controller, catalog and Stories' styles
* (tests replace it).
*/
export function bootStories({
viewer,
director,
store,
onLoadFailed,
available = true,
loadModules = () =>
Promise.all([
import('./controller.js'),
import('./catalog.js'),
// Stories' screen styles, in place before the screens show, and the
// screens themselves, so opening does not wait on a second fetch.
import('../ui/styles/stories.css'),
import('../ui/views/stories/ExploreScreen.vue'),
import('../ui/views/stories/StoryScreen.vue'),
]),
}) {
store.available = available;
if (!available) {
const off = {
open: async () => {},
openStory: async () => {},
backToExplore: async () => {},
close: () => {},
reframe: () => {},
kind: null,
load: async () => null,
destroy: () => {},
};
store.connect(off, []);
return off;
}
let real = null;
let loading = null;
let destroyed = false;
function load() {
loading ??= loadModules().then(
([{ createStoriesController }, { listStories }]) => {
if (destroyed) return null;
removeEventListener('popstate', onPopState);
real = createStoriesController({
viewer,
director,
store,
});
store.connect(real, listStories());
return real;
},
);
// A failed fetch (offline, or a deploy replaced the chunk) is reported
// once, whatever asked (a click, a link, Back or Forward), and not kept:
// the next attempt tries again.
loading.catch((error) => {
loading = null;
console.warn('Stories could not load', error);
onLoadFailed?.();
});
return loading;
}
// The controller reads a Stories link on creation and opens it.
const onPopState = () => {
if (wantsStories()) load();
};
addEventListener('popstate', onPopState);
if (wantsStories()) load();
const later =
(name) =>
(...args) =>
load().then(
(c) => c?.[name](...args),
() => {}, // reported by load()
);
const shell = {
open: later('open'),
openStory: later('openStory'),
backToExplore: later('backToExplore'),
close: () => real?.close(),
reframe: () => real?.reframe(),
get kind() {
return real?.kind ?? null;
},
/** Resolves to the controller once it has loaded. */
load,
destroy() {
if (destroyed) return;
destroyed = true;
removeEventListener('popstate', onPopState);
real?.destroy();
},
};
store.connect(shell, []);
return shell;
}
+142
View File
@@ -0,0 +1,142 @@
// Stories loads its controller, catalog and engine on first use, not with GEV.
import '../testSupport/registerDom.mjs';
import { registerHooks } from 'node:module';
import test from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import { createPinia, setActivePinia } from 'pinia';
// Every module Node loads, to see when the Stories chunk arrives.
const loaded = new Set();
registerHooks({
load(url, context, next) {
loaded.add(url);
if (url.endsWith('.css'))
return {
format: 'module',
source: 'export default "";',
shortCircuit: true,
};
if (url.endsWith('.webp'))
return {
format: 'module',
source: `export default ${JSON.stringify(url)};`,
shortCircuit: true,
};
return next(url, context);
},
});
const context = new Proxy(
{},
{ get: (target, name) => target[name] ?? (() => context), set: () => true },
);
globalThis.HTMLCanvasElement.prototype.getContext = (kind) =>
kind === 'webgl' ? null : context;
globalThis.requestAnimationFrame = () => 0;
globalThis.cancelAnimationFrame = () => {};
const { bootStories } = await import('./boot.js');
const { useStoriesStore } = await import('../ui/stores/stories.js');
const viewer = {
scene: {
canvas: document.createElement('canvas'),
postRender: { addEventListener: () => () => {} },
},
camera: {
positionWC: new Cesium.Cartesian3(1, 2, 3),
positionCartographic: { latitude: 0, longitude: 0, height: 2e6 },
heading: 0,
pitch: -1,
roll: 0,
setView() {},
flyTo() {},
flyToBoundingSphere() {},
cancelFlight() {},
},
clock: { currentTime: Cesium.JulianDate.now(), shouldAnimate: false },
};
const director = {
running: false,
stopScene() {},
whenIdle: async () => {},
listShots: () => [],
subscribeSceneClock: () => () => {},
seekScene() {},
styleManager: { runImmediateNavigation: () => true },
};
test('the shell loads the controller on first open, then steps aside', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/');
const store = useStoriesStore();
const shell = bootStories({ viewer, director, store });
assert.equal(store.controller, shell);
assert.equal(store.stories.length, 0, 'no catalog until Stories is used');
const engineLoaded = () =>
[...loaded].some((u) =>
/stories\/(controller|catalog|protoEngine)\.js$/.test(u),
);
assert.equal(engineLoaded(), false, 'GEV starts without the Stories chunk');
await shell.open();
assert.equal(engineLoaded(), true);
assert.notEqual(store.controller, shell);
assert.ok(store.stories.length > 0);
assert.equal(store.mode, 'explore');
shell.destroy();
assert.equal(store.mode, 'closed');
});
test('a Stories link loads the controller straight away', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/?stories=explore');
const store = useStoriesStore();
const shell = bootStories({ viewer, director, store });
const real = await shell.load();
assert.equal(store.controller, real);
shell.destroy();
history.replaceState(null, '', '/');
});
test('a failed load is reported and the next open tries again', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/');
const store = useStoriesStore();
let failures = 0;
let attempts = 0;
const shell = bootStories({
viewer,
director,
store,
onLoadFailed: () => (failures += 1),
// The Stories chunk is unreachable on the first try only.
loadModules: () =>
++attempts === 1
? Promise.reject(new Error('offline'))
: Promise.all([import('./controller.js'), import('./catalog.js')]),
});
await shell.open();
assert.equal(failures, 1);
assert.equal(store.mode, 'closed');
await shell.open();
assert.equal(attempts, 2, 'the failure was not kept');
assert.equal(store.mode, 'explore');
shell.destroy();
});
test('a Stories link that cannot load is reported too', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/?story=worldfx%3Afire-tracker');
const store = useStoriesStore();
let failures = 0;
bootStories({
viewer,
director,
store,
onLoadFailed: () => (failures += 1),
loadModules: () => Promise.reject(new Error('offline')),
});
await new Promise((resolve) => setTimeout(resolve, 0));
assert.equal(failures, 1);
history.replaceState(null, '', '/');
});
+340
View File
@@ -0,0 +1,340 @@
import { SCENE_RECIPES } from '../scenes/recipes.js';
import { msg } from '../i18n/index.js';
/**
* Stories are GEV scenes, played on GEV's own Cesium globe: the scenes GEV
* ships (recipes with a camera path) and the scenes the person authored and
* saved to Stories from the AUTHORING panel.
*
* A shipped scene's context is what GEV knows about it: what it shows, where
* each shot goes, and, for every layer it turns on, what the layer shows and
* where its data comes from (as DATA_SOURCES.md records it). The Nepal scene
* adds the event pack's own facts and sources
* (public/events/bhote-koshi-2026/README.md) and marks its key moments by
* the chapters that show them.
*/
/** What each layer a shipped scene turns on shows, and its data sources. */
const LAYER_FACTS = {
flights: {
label: msg('Flights'),
about: msg(
'Aircraft positions come from ADS-B: the OpenSky Network’s worldwide snapshot, with adsb.lol where OpenSky has none.',
),
sources: [
[
'OpenSky Network',
msg(
'Worldwide live-flight snapshot (non-commercial research and education licence)',
),
'https://opensky-network.org/',
],
['adsb.lol', msg('Live-flight fallback (ODbL 1.0)'), 'https://adsb.lol/'],
],
},
satellites: {
label: msg('Satellites'),
about: msg(
'Satellite orbits are propagated from CelesTrak’s current element sets.',
),
sources: [
[
'CelesTrak',
msg('Satellite element sets and catalogue (U.S. government data)'),
'https://celestrak.org/',
],
[
'UCS Satellite Database (5-1-2023)',
msg('Satellite operators, owners and purposes'),
'https://www.ucsusa.org/satellite_database',
],
],
},
earthquakes: {
label: msg('Earthquakes'),
about: msg('Earthquakes come from the U.S. Geological Survey’s live feed.'),
sources: [
[
'USGS',
msg('Earthquake feed (U.S. public domain)'),
'https://earthquake.usgs.gov/',
],
],
},
traffic: {
label: msg('Traffic'),
about: msg('Road traffic; live congestion needs your own TomTom key.'),
sources: [
[
'TomTom',
msg('Live traffic flow, with your own key'),
'https://www.tomtom.com/',
],
],
},
};
/**
* Per shipped scene: what it shows, and where each shot goes (by the shot's
* camera), for shots without a title of their own.
*/
const SCENE_CONTEXT = {
'flights-radar': {
description: msg(
'Live air traffic around the world: the Atlantic, Europe, Japan and San Francisco.',
),
places: [
msg('The Atlantic'),
msg('Western Europe'),
msg('Japan'),
msg('San Francisco Bay Area'),
msg('Pull back over the Atlantic'),
],
},
'orbital-watch': {
description: msg(
'Satellites in orbit, watched from over Florida, Africa, Tokyo and Paris.',
),
places: [
msg('Over Florida'),
msg('Over Africa'),
msg('Over Tokyo'),
msg('Over Paris'),
msg('Pull back over the Atlantic'),
],
},
'thermal-threats': {
description: msg(
'Recent earthquakes in the thermal look: California, Japan, New Zealand and off Portugal.',
),
places: [
msg('California'),
msg('Japan'),
msg('New Zealand'),
msg('Off Portugal'),
],
},
'city-overload': {
description: msg(
'Flights, satellites and traffic together over New York, Los Angeles and London.',
),
places: [
msg('New York'),
msg('New York, closer'),
msg('New York, closer still'),
msg('Los Angeles'),
msg('London'),
],
},
'omniscience-pullback': {
description: msg(
'Every live layer at once, pulling back from Tokyo to the whole planet.',
),
places: [
msg('Tokyo'),
msg('Tokyo, pulling back'),
msg('Japan and East Asia'),
msg('South China Sea'),
msg('The whole globe'),
],
},
'bhote-koshi-nepal-scene': {
description: msg(
'The 26 August 2026 Bhote Koshi outburst flood in Nepal, followed down the valley to Trishuli.',
),
// Where Explore frames it: the Bhote Koshi corridor, not the scene's
// opening whole-globe shot.
area: { lat: 28.13, lon: 85.32, alt: 160000 },
tMinMs: Date.UTC(2026, 7, 26),
tMaxMs: Date.UTC(2026, 7, 27),
// Key moments: the chapters that show them, by their titles.
moments: [
['#ffb45a', msg('Upper Valley Collapse')],
['#50c8ff', msg('Debris-Dammed Lake')],
['#ff7a6b', msg('Second landslide')],
],
sources: [
[
'Vantor Open Data Program',
msg('Historical and post-event satellite imagery (CC BY-NC 4.0)'),
'https://vantor.com/company/open-data-program',
],
[
'GeoPera',
msg('Reconstructed flood path (CC BY-NC 4.0)'),
'https://github.com/geo-pera/bhotekoshi-2026-reconstruction',
],
],
background: msg(
'A visualization of the 26 August 2026 Bhote Koshi outburst flood, not an official hazard model. The historical (2021) and post-event views are Vantor WorldView imagery; the river’s path is GeoPera’s reconstruction. Witness clips link to their original posts, and their capture times are unverified.',
),
},
};
/** A shipped scene's context, from its own entry and its layers' facts. */
function sceneContext(recipe) {
const own = SCENE_CONTEXT[recipe.id] ?? {};
const layers = Object.entries(recipe.layers ?? {})
.filter(([id, on]) => on && LAYER_FACTS[id])
.map(([id]) => LAYER_FACTS[id]);
return {
...(own.area ? { area: own.area } : {}),
...(own.tMinMs != null ? { tMinMs: own.tMinMs, tMaxMs: own.tMaxMs } : {}),
description:
own.description ?? msg('A GEV scene, played on the live globe.'),
places: own.places ?? [],
moments: own.moments ?? [],
// The layers' own names on the legend.
mock: { legend: layers.map((l) => ['dot', '#6be8ff', l.label]) },
sources: [...(own.sources ?? []), ...layers.flatMap((l) => l.sources)],
// Each part is translated on its own, as shown.
background: own.background ?? layers.map((l) => l.about),
};
}
/**
* Where a story's card and pin point, and where Explore flies on a pick. A
* shot tied to an anchor (no lat/lon of its own) shows the whole globe.
*/
const coverOf = (camera) =>
Number.isFinite(camera?.lat) && Number.isFinite(camera?.lon)
? {
lat: camera.lat,
lon: camera.lon,
range: camera.alt ?? 1.6e7,
heading: camera.heading ?? 0,
pitch: camera.pitch ?? -70,
}
: { lat: 20, lon: 0, range: 1.6e7, heading: 0, pitch: -90 };
/** A scene GEV ships, from its recipe. */
function shippedStory(recipe) {
const path = recipe.cameraPath ?? [];
const first = path[0] ?? {
lat: 20,
lon: 0,
alt: 1.6e7,
heading: 0,
pitch: -80,
};
const context = sceneContext(recipe);
let at = 0;
const chapters = path.map((shot, i) => {
const chapter = {
id: `shot-${i + 1}`,
wallMs: at,
shot: i + 1,
title: shot.title ?? context.places[i] ?? null,
caption: '',
};
at += ((shot.duration ?? 4) + (shot.hold ?? 0)) * 1000;
return chapter;
});
const durationMs = Math.max(at, (recipe.durationSec ?? 30) * 1000);
const { places, ...rest } = context;
return {
id: `gev:${recipe.id}`,
sceneId: recipe.id,
kind: 'gev',
live: false,
title: recipe.title,
creator: 'GEV',
tags: Object.entries(recipe.layers ?? {})
.filter(([, on]) => on)
.map(([id]) => id),
durationMs,
cover: coverOf(first),
chapters,
events: [],
places,
...rest,
};
}
/** A saved scene's line under its title: a draft says how to publish it. */
const describe = (scene) =>
scene.draft
? msg(
'A draft, not saved as a story yet. Use SAVE TO STORIES in AUTHORING to save it.',
)
: msg('A scene you made in GEV, played on the live globe.');
/**
* A scene the person saved to Stories (SceneDirector.storyScenes()). Its
* chapters and length come from the director's shots when it opens.
*/
function savedStory(scene) {
return {
id: `gev:${scene.id}`,
sceneId: scene.id,
kind: 'gev',
live: false,
mine: true,
// Not saved with SAVE TO STORIES yet.
draft: !!scene.draft,
title: scene.title,
description: describe(scene),
creator: msg('You'),
// Topics the person picked in AUTHORING, and the card image they
// captured there (drawn from the imagery when there is none).
topics: [...(scene.tags ?? [])],
tags: [...(scene.tags ?? [])],
thumb: scene.thumb ?? '',
durationMs: 0,
cover: coverOf(scene.camera),
chapters: [],
events: [],
sources: [],
background: '',
};
}
let shipped = null;
let installed = () => true;
/**
* Whether a shipped scene is in the person's project (the controller passes
* the director's hasScene()); one that is not does not list.
* @param {(sceneId: string) => boolean} test
*/
export function useInstalledScenes(test) {
installed = typeof test === 'function' ? test : () => true;
}
const saved = new Map();
let savedScenes = () => [];
/**
* Where the person's saved scenes come from (the controller passes the
* director's storyScenes()). The list is read again on every call, so a
* scene saved to Stories shows the next time Explore lists.
* @param {() => Array<{id: string, title: string, camera: object, shotCount: number, thumb?: string, tags?: string[]}>} provider
*/
export function useSavedScenes(provider) {
savedScenes = typeof provider === 'function' ? provider : () => [];
}
/** Every story Explore lists: the person's own first, then GEV's. */
export function listStories() {
shipped ??= SCENE_RECIPES.filter((r) => (r.cameraPath ?? []).length).map(
shippedStory,
);
const shippedIds = new Set(shipped.map((s) => s.sceneId));
// One object per saved scene, kept across calls: the controller fills its
// chapters in place when it opens, and the screens read the same object.
const own = (savedScenes() ?? [])
.filter((scene) => !shippedIds.has(scene.id))
.map((scene) => {
const story = saved.get(scene.id) ?? savedStory(scene);
story.title = scene.title;
story.draft = !!scene.draft;
story.description = describe(scene);
story.cover = coverOf(scene.camera);
story.topics = [...(scene.tags ?? [])];
story.tags = [...(scene.tags ?? [])];
story.thumb = scene.thumb ?? '';
saved.set(scene.id, story);
return story;
});
return [...own, ...shipped.filter((s) => installed(s.sceneId))];
}
export function storyById(id) {
return listStories().find((s) => s.id === id) ?? null;
}
+953
View File
@@ -0,0 +1,953 @@
import * as Cesium from 'cesium';
import { markRaw, toRaw } from 'vue';
import { t } from '../i18n/index.js';
import {
governorRequestRender,
holdContinuousRender,
releaseContinuousRender,
} from '../renderGovernor.js';
import { createGevPlayer, directorSettled } from './gevPlayer.js';
import { drawThumb } from './thumbs.js';
import {
listStories,
storyById,
useInstalledScenes,
useSavedScenes,
} from './catalog.js';
import { anchorStamp } from './storyMeta.js';
import { registerNavigationAuthorityListener } from '../navigationPolicy.js';
const PARAM_STORIES = 'stories';
const PARAM_STORY = 'story';
/**
* Stories: Explore (the story list over the person's own Cesium globe, with
* a pin per story) and the Story player. Every story is a GEV scene played
* through SceneDirector: the scenes GEV ships and the ones the person saved
* to Stories from the AUTHORING panel.
* Leaving Stories puts back the globe, camera and clock the person had.
*
* The share state owns the URL hash, so Stories keeps its place in the query
* (`?stories=explore`, `?story=<id>`) and pushes one history entry per
* screen, so Back steps Story → Explore → GEV. Closing steps back over those
* entries, so Back after Close does not reopen Stories.
*
* @param {{viewer: Cesium.Viewer,
* director: import('../scenes/director.js').SceneDirector,
* store: ReturnType<typeof import('../ui/stores/stories.js').useStoriesStore>}} options
*/
export function createStoriesController({ viewer, director, store }) {
let player = null;
let saved = null;
// The view a Close is about to restore, once a stopping scene has settled.
let pendingView = null;
let removeReadout = null;
let destroyed = false;
// Close steps back over Stories' own entries; the landing popstate is ours.
let closingHistory = false;
// A Back to Explore traversal is on its way.
let steppingBack = false;
// A call made while a traversal is landing runs from the entry it lands on,
// so two traversals never stack (Close after Back to Explore would step
// one entry too far).
let afterTraversal = null;
const traversing = () => steppingBack || closingHistory;
const canvas = viewer.scene.canvas;
// The scenes the person saved to Stories (AUTHORING panel) join the list,
// and a save or removal shows at once.
useSavedScenes(() => [
...(director.storyScenes?.() ?? []),
// The person's other scenes, as drafts only they see.
...(director.draftScenes?.() ?? []).map((scene) => ({
...scene,
draft: true,
})),
]);
// A shipped scene lists only while it is in the person's project (it can
// be deleted, or missing from an imported one).
useInstalledScenes((sceneId) => director.hasScene?.(sceneId) ?? true);
const LIST_CHANGES = new Set([
'stories-changed',
'scene-deleted',
'project-imported',
// A draft appears, changes or goes with its shots.
'shot-captured',
'shot-updated',
'shot-deleted',
// A draft's THUMBNAIL or tags.
'story-details-changed',
]);
const unsubscribeScenes = director.subscribe?.((change) => {
if (!LIST_CHANGES.has(change?.type) || destroyed) return;
store.stories = markRaw(listStories());
if (removePins) {
startPins();
drawThumbs();
if (store.mode === 'explore' && !store.picked && !pressing)
armTour(TOUR_DWELL_MS);
}
});
// ── URL and history ──
// Stories' own entries carry no share hash: the address bar while Stories
// is open names the story, not the person's camera and layers.
function urlFor(params) {
const url = new URL(location.href);
url.searchParams.delete(PARAM_STORIES);
url.searchParams.delete(PARAM_STORY);
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
if (Object.keys(params).length) url.hash = '';
return url.toString();
}
const shareLink = () => director.styleManager?.shareLinkManager;
// Each Stories entry records how many entries Stories has pushed above the
// page it opened from (`depth`) and the depth of the nearest Explore entry
// at or below it (`explore`), so Close and Back to Explore step back the
// right distance whatever was opened in between.
const depth = () => history.state?.gevStories?.depth ?? 0;
const exploreDepth = () => {
const own = history.state?.gevStories?.explore;
if (own != null) return own;
return new URLSearchParams(location.search).has(PARAM_STORIES)
? depth()
: null;
};
function navigate(params, push) {
const url = urlFor(params);
if (url === location.href) return;
const next = depth() + (push ? 1 : 0);
const state = {
...(history.state ?? {}),
gevStories: {
...params,
depth: next,
explore: params[PARAM_STORIES] ? next : exploreDepth(),
},
};
if (push) history.pushState(state, '', url);
else history.replaceState(state, '', url);
}
// Without Stories in the URL: the entry a Stories link landed on.
function clearStoriesUrl() {
const state = { ...(history.state ?? {}) };
delete state.gevStories;
history.replaceState(state, '', urlFor({}));
}
// Steps back over Stories' entries; `landed` runs once the page Stories
// opened from is current (or at once when Stories pushed nothing). A
// traversal that never lands (cross-document, blocked) gives up after 2 s.
const LANDING_LIMIT_MS = 2000;
let landed = null;
let landingTimer = 0;
function finishLanding() {
clearTimeout(landingTimer);
const then = landed;
landed = null;
then?.();
}
function leaveHistory(then = null) {
const steps = depth();
if (steps > 0) {
closingHistory = true;
landed = then;
clearTimeout(landingTimer);
landingTimer = setTimeout(() => {
if (!closingHistory) return;
closingHistory = false;
finishLanding();
const queued = afterTraversal;
afterTraversal = null;
queued?.();
}, LANDING_LIMIT_MS);
history.go(-steps);
} else {
clearStoriesUrl();
then?.();
}
}
const onPopState = () => {
if (destroyed) return;
const queued = afterTraversal;
afterTraversal = null;
try {
handlePopState();
} finally {
queued?.();
}
};
function handlePopState() {
steppingBack = false;
if (closingHistory) {
closingHistory = false;
if (store.mode === 'closed') {
if (new URLSearchParams(location.search).has(PARAM_STORIES))
clearStoriesUrl();
finishLanding();
return;
}
}
const params = new URLSearchParams(location.search);
const id = params.get(PARAM_STORY);
if (id && storyById(id)) controller.openStory(id, { fromHistory: true });
else if (params.has(PARAM_STORIES))
store.mode === 'closed'
? controller.open({ fromHistory: true })
: controller.backToExplore({ fromHistory: true });
else if (store.mode !== 'closed') controller.close({ fromHistory: true });
}
addEventListener('popstate', onPopState);
// ── The person's own view, kept for when Stories closes ──
function saveView() {
const c = viewer.camera;
saved = {
position: c.positionWC.clone(),
heading: c.heading,
pitch: c.pitch,
roll: c.roll,
time: viewer.clock.currentTime.clone(),
animate: viewer.clock.shouldAnimate,
openedAt: Date.now(),
// The share state (layers, style, camera) as it was, for after a GEV
// scene has changed it.
hash: location.hash,
ranScene: false,
// Whether a scene played during this visit, which selects it in
// AUTHORING (ranScene clears once Back to Explore has undone the look).
playedScene: false,
// What AUTHORING had selected: playing a scene selects it there.
authoring: director.selection?.() ?? null,
};
}
function restoreView(saved, { keepCamera = false } = {}) {
if (!saved) return;
if (!keepCamera)
viewer.camera.setView({
destination: saved.position,
orientation: {
heading: saved.heading,
pitch: saved.pitch,
roll: saved.roll,
},
});
// Opened in GEV, the globe stays at the story's moment.
if (keepCamera) return;
restoreClock(saved);
}
/** A running clock carries on as if Stories had never paused it. */
function restoreClock(saved) {
viewer.clock.currentTime = saved.animate
? Cesium.JulianDate.addSeconds(
saved.time,
(Date.now() - saved.openedAt) / 1000,
new Cesium.JulianDate(),
)
: saved.time;
viewer.clock.shouldAnimate = saved.animate;
}
// A GEV scene turns on its own layers and look. Put the person's back by
// handing the share state saved on open to GEV's own restore, the path a
// pasted share link takes.
function restoreShareState(saved) {
if (!saved?.ranScene || !saved.hash) return;
// Directly, not by a hashchange: the share link skips a hash it already
// restored as Back landed, while the scene was still tearing down.
const share = director.styleManager?.shareLinkManager;
if (share?.restore?.(saved.hash.replace(/^#/, ''))) return;
const url = new URL(location.href);
url.hash = saved.hash;
history.replaceState(history.state, '', url.toString());
dispatchEvent(new HashChangeEvent('hashchange'));
}
// ── Explore on the person's globe: a pin per story, kept on its place ──
// Where a story sits: its framed area, else its cover shot.
const areaOf = (s) =>
s.area ?? { lat: s.cover.lat, lon: s.cover.lon, alt: s.cover.range };
let removePins = null;
let places = [];
// Pins follow the camera on every frame it draws. A change in which pins
// show goes through the store (Vue renders them); a move alone is written
// straight to each pin's transform, so a flight does not re-render Explore.
function placePins() {
const occluder = new Cesium.EllipsoidalOccluder(
viewer.scene.globe.ellipsoid,
viewer.camera.positionWC,
);
const rect = canvas.getBoundingClientRect();
const pins = places.map(({ id, at }) => {
const win = Cesium.SceneTransforms.worldToWindowCoordinates(
viewer.scene,
at,
);
const visible = !!win && occluder.isPointVisible(at);
return {
id,
x: rect.left + (win?.x ?? -9999),
y: rect.top + (win?.y ?? -9999),
visible,
};
});
const before = toRaw(store.pins);
const sameSet =
before.length === pins.length &&
pins.every(
(n, i) => n.id === before[i].id && n.visible === before[i].visible,
);
if (!sameSet) {
store.pins = pins;
return;
}
const layer = document.getElementById('pins');
const origin = layer?.getBoundingClientRect();
if (!origin) return;
for (const el of layer.querySelectorAll('.pin[data-id]')) {
const n = pins.find((pin) => pin.id === el.dataset.id);
if (!n) continue;
el.style.transform = `translate(${n.x - origin.left}px, ${n.y - origin.top}px) translate(-50%, -100%)`;
}
// Kept in step for the next render, without telling Vue.
for (let k = 0; k < pins.length; k++)
Object.assign(toRaw(before[k]), pins[k]);
}
function startPins() {
stopPins();
places = listStories().map((s) => {
const { lat, lon } = areaOf(s);
return { id: s.id, at: Cesium.Cartesian3.fromDegrees(lon, lat) };
});
removePins = viewer.scene.postRender.addEventListener(placePins);
governorRequestRender('stories-pins');
}
// ── Explore's idle tour: the globe turns from one story to the next ──
// Once a fly-in or the person's last touch has settled, Explore flies on to
// the next story in the feed every few seconds, at the same country-level
// view it opened at. Never with a story picked or with reduced motion, and
// it stops on its own a minute later. Each flight asks only for its own
// frames, and the tiles of each stop settle as any landing's do.
const TOUR_MS = 60000;
const TOUR_FLIGHT_S = 2.5;
const TOUR_DWELL_MS = 6000;
let tourTimer = 0;
// A press on the globe is under way (a drag): nothing restarts the tour.
let pressing = false;
let tourUntil = 0;
let tourIndex = 0;
const reduceMotion = () =>
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ??
false;
const touring = () =>
store.mode === 'explore' &&
!store.picked &&
!reduceMotion() &&
!destroyed &&
!viewer.isDestroyed?.();
function stopTour() {
clearTimeout(tourTimer);
tourTimer = 0;
}
function tourStep() {
tourTimer = 0;
const list = store.stories ?? [];
if (!touring() || Date.now() > tourUntil || list.length < 2) return;
tourIndex = (tourIndex + 1) % list.length;
const { lat, lon } = areaOf(list[tourIndex]);
flyTo({ lat, lon, alt: START_ALT }, TOUR_FLIGHT_S);
tourTimer = setTimeout(tourStep, TOUR_FLIGHT_S * 1000 + TOUR_DWELL_MS);
}
/** Tour on after `delayMs`, unless Explore is left or a story picked. */
function armTour(delayMs) {
stopTour();
tourTimer = setTimeout(() => {
if (!touring()) return (tourTimer = 0);
tourUntil = Date.now() + TOUR_MS;
tourStep();
}, delayMs);
}
// A touch, drag or wheel on Explore's globe stops the tour; it goes on
// once the person has let go for a while.
// A press stops it outright (a drag can last any time); letting go or a
// wheel turn starts the wait again.
const onExploreInput = (e) => {
pressing = e?.type === 'pointerdown';
if (store.mode !== 'explore' || store.picked) return;
if (pressing) stopTour();
else armTour(TOUR_DWELL_MS);
};
canvas.addEventListener('pointerdown', onExploreInput);
canvas.addEventListener('pointerup', onExploreInput);
canvas.addEventListener('pointercancel', onExploreInput);
canvas.addEventListener('wheel', onExploreInput, { passive: true });
function stopPins() {
stopTour();
stopSettling();
removePins?.();
removePins = null;
store.pins = [];
}
/**
* Where Explore opens and goes back to: country level, straight down over
* the first story in the feed (the whole globe's centre when there is
* none).
*/
const START_ALT = 2.5e6;
const WORLD_CENTRE = { lat: 22, lon: 30 };
function startView() {
const first = store.stories?.[0];
const at = first ? areaOf(first) : WORLD_CENTRE;
return { lat: at.lat, lon: at.lon, alt: START_ALT };
}
// Cesium draws on request, so the finer tiles for a view that has just
// landed would wait for the next change: keep frames coming until they
// have loaded, for at most 10 s.
let tilesTimer = 0;
let removeTiles = null;
function stopSettling() {
clearTimeout(tilesTimer);
tilesTimer = 0;
removeTiles?.();
removeTiles = null;
releaseContinuousRender('stories-tiles');
}
function settleTiles() {
stopSettling();
if (destroyed || viewer.isDestroyed?.()) return;
removeTiles = viewer.scene.postRender.addEventListener(() => {
if (viewer.scene.globe?.tilesLoaded) stopSettling();
});
holdContinuousRender('stories-tiles');
tilesTimer = setTimeout(stopSettling, 10000);
}
function flyTo({ lat, lon, alt }, duration = 1.6) {
// The whole globe straight down; a story's place at an angle, framed in
// the middle of the view rather than under the camera.
if (alt > 2e6) {
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lon, lat, alt),
orientation: { heading: 0, pitch: -Math.PI / 2, roll: 0 },
duration,
complete: settleTiles,
});
return;
}
viewer.camera.flyToBoundingSphere(
new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(lon, lat), 0),
{
offset: new Cesium.HeadingPitchRange(
0,
Cesium.Math.toRadians(-60),
alt,
),
duration,
complete: settleTiles,
},
);
}
/** A picked story's place, close enough to see it, far enough to place it. */
const pickView = (s) => {
const a = areaOf(s);
return {
lat: a.lat,
lon: a.lon,
alt: Math.min(4e6, Math.max(60000, a.alt ?? 1.6e6)),
};
};
// ── GEV scenes: the camera readout comes from Cesium ──
let lastReadout = 0;
function startCesiumReadout() {
stopCesiumReadout();
removeReadout = viewer.scene.postRender.addEventListener(() => {
const now = performance.now();
if (now - lastReadout < 120) return;
lastReadout = now;
const c = viewer.camera.positionCartographic;
store.camera = {
lat: Cesium.Math.toDegrees(c.latitude),
lon: Cesium.Math.toDegrees(c.longitude),
altKm: Math.round(c.height / 1000),
};
});
}
function stopCesiumReadout() {
removeReadout?.();
removeReadout = null;
}
// A GEV scene's shots as installed (evidence packs add shots to a
// recipe), so chapters and length match what plays.
const untitled = (title, i) =>
!title ||
title === `Shot ${i + 1}` ||
title === t('Shot {n}', { n: i + 1 });
function syncSceneShots(story) {
const shots = director.listShots?.(story.sceneId) ?? [];
if (!shots.length) return;
story.chapters = shots.map((shot, i) => ({
id: shot.id,
wallMs: Math.round(shot.startSec * 1000),
shot: i + 1,
// A shipped scene's untitled shots are named by where they go; a
// title of the person's own stays.
title:
(untitled(shot.title, i) && story.places?.[i]) || shot.title || null,
caption: '',
}));
const last = shots.at(-1);
story.durationMs = Math.round((last.startSec + last.durationSec) * 1000);
// Key moments sit on the chapters that show them.
const fold = (text) =>
String(text ?? '')
.trim()
.toLowerCase();
story.events = (story.moments ?? []).flatMap(([color, label]) => {
const names = new Set([fold(label), fold(t(label))]);
const chapter = story.chapters.find((c) => names.has(fold(c.title)));
return chapter ? [{ color, label, wallMs: chapter.wallMs }] : [];
});
}
function dropPlayer() {
document.body.classList.remove('stories-scene');
stopCesiumReadout();
player?.destroy();
player = null;
}
function onTick(state) {
store.playback = {
wallMs: state.wallMs,
worldMs: state.worldMs,
durationMs: state.durationMs,
playing: state.playing,
exploring: state.exploring,
chapterIndex: state.chapterIndex,
};
if (state.playing) store.bigPlay = false;
}
// A story's tap plays or pauses, and a tap on empty Explore map lets go of
// the picked story; on a phone, touching the map drops the context sheet
// back to its peek.
let downAt = null;
const onDown = (e) => {
downAt = [e.clientX, e.clientY];
if (store.mode === 'story' && innerWidth <= 700 && store.sheet !== 'peek')
store.sheet = 'peek';
};
const onUp = (e) => {
if (!downAt) return;
const moved = Math.hypot(e.clientX - downAt[0], e.clientY - downAt[1]);
downAt = null;
if (moved >= 6) return;
if (store.mode === 'explore') {
if (store.picked) controller.pick(null);
return;
}
if (store.mode !== 'story' || !player) return;
if (store.playback.playing) {
player.pause();
store.bigPlay = true;
} else player.play();
};
canvas.addEventListener('pointerdown', onDown);
canvas.addEventListener('pointerup', onUp);
/** @returns {boolean} False when the camera is not free (Cockpit). */
function enterStories() {
// Stories owns the camera now. The shared navigation claim releases a
// tracked contact, orbit or flight, as a scene's does; Cockpit refuses,
// and the policy shows GEV's own toast for it.
const nav = director.styleManager;
if (nav?.runImmediateNavigation?.('stories', () => true) === false)
return false;
if (director.running) director.stopScene();
viewer.trackedEntity = undefined;
// Reopened while a scene from the last visit is still tearing down: the
// person's view from before that visit is still the one to come back to.
// The address keeps no share hash while Stories is open. Holding writes
// first writes any pending view change, so the saved hash is current.
shareLink()?.holdWrites?.(true);
// That write lands on the current entry; when it is already Stories'
// own (a Stories link, a reload), it carries no share hash.
if (history.state?.gevStories && location.hash)
history.replaceState(
history.state,
'',
location.pathname + location.search,
);
if (pendingView) {
saved = pendingView;
pendingView = null;
} else saveView();
document.body.classList.add('stories-mode');
return true;
}
// ── Card images: drawn once per story place from the base imagery ──
const ESRI_IMAGERY =
/arcgisonline\.com\/arcgis\/rest\/services\/world_imagery/i;
const thumbKeys = new Map();
let drawingThumbs = false;
let thumbsAgain = false;
async function drawThumbs() {
// A list that changes while cards are drawing is drawn again after.
if (drawingThumbs) return void (thumbsAgain = true);
drawingThumbs = true;
thumbsAgain = false;
try {
for (const story of listStories()) {
if (destroyed || store.mode === 'closed') break;
// Drawn only from the keyless Esri World Imagery, whose terms allow
// showing it with its credit; any other imagery leaves the
// placeholder unless the scene has its own image.
const base = viewer.imageryLayers?.get?.(0)?.imageryProvider;
const provider = ESRI_IMAGERY.test(base?.url ?? '') ? base : null;
if (!provider && !story.thumb) {
// A card drawn from Esri earlier goes: its credit is not on
// screen under another imagery.
if (store.thumbs?.[story.id]) {
const { [story.id]: _gone, ...rest } = store.thumbs;
store.thumbs = rest;
}
thumbKeys.delete(story.id);
continue;
}
// The place Explore frames for it, as its pin shows.
const a = areaOf(story);
const c = { lat: a.lat, lon: a.lon, range: a.alt };
const key = story.thumb
? story.thumb.slice(-32)
: `${c.lat},${c.lon},${c.range}`;
if (thumbKeys.get(story.id) === key && store.thumbs?.[story.id])
continue;
// A card image the person captured in AUTHORING wins.
const url = story.thumb || (await drawThumb(provider, c));
if (!url || destroyed) continue;
thumbKeys.set(story.id, key);
store.thumbs = { ...store.thumbs, [story.id]: url };
}
} finally {
drawingThumbs = false;
}
if (thumbsAgain && !destroyed) drawThumbs();
}
// Counts Explore entries, so a scene's late teardown restores the look only
// for the Explore it was left for.
let exploreEntry = 0;
function showExplore() {
// Feed lengths follow the scenes as installed.
for (const s of listStories()) syncSceneShots(s);
store.mode = 'explore';
store.storyId = null;
startPins();
const entry = ++exploreEntry;
const frame = () => {
const s = store.picked && storyById(store.picked);
flyTo(s ? pickView(s) : startView());
// The tour starts from the story the fly-in landed on.
if (!s) {
tourIndex = 0;
armTour(1600 + TOUR_DWELL_MS);
}
// Cards are drawn from the person's own imagery, so after their look
// is back.
drawThumbs();
};
if (!saved?.ranScene) return frame();
// Back from a scene: once it has torn down, the person's own layers,
// style and clock come back before Explore frames the globe, as on
// Close. The address keeps naming only Stories' place.
directorSettled(director).then(() => {
if (entry !== exploreEntry || store.mode !== 'explore' || destroyed)
return;
if (viewer.isDestroyed?.()) return;
const query = location.pathname + location.search;
restoreShareState(saved);
if (location.hash) history.replaceState(history.state, '', query);
restoreClock(saved);
saved.ranScene = false;
frame();
});
}
const controller = {
open({ fromHistory = false } = {}) {
if (!fromHistory && traversing()) {
afterTraversal = () => controller.open();
return;
}
if (store.mode !== 'closed') return;
if (!enterStories()) return;
store.picked = null;
showExplore();
if (!fromHistory) navigate({ [PARAM_STORIES]: 'explore' }, true);
},
close({ fromHistory = false, keepCamera = false } = {}) {
if (store.mode === 'closed') return;
if (!fromHistory && traversing()) {
afterTraversal = () => controller.close({ keepCamera });
return;
}
dropPlayer();
stopPins();
viewer.camera.cancelFlight();
// GEV comes back on screen now; `stories-mode` (keyboard guard, voice
// refusal) stays until the view is back, so nothing acts on GEV under
// a scene that is still tearing down.
document.body.classList.remove('stories-scene');
store.mode = 'closed';
store.storyId = null;
store.picked = null;
store.expanded = false;
const was = saved;
saved = null;
pendingView = was;
// A camera owner that takes over during the wait (the person dragging
// the globe, a layer's focus) keeps the camera: no snap back.
let navigated = false;
const onDrag = () => (navigated = true);
canvas.addEventListener('pointerdown', onDrag);
const stopWatching = registerNavigationAuthorityListener(
globalThis.window,
onDrag,
);
// Wait until the director is idle (a stopped scene, or one still
// tearing down from before a quick reopen, has released its camera,
// layers and look); put the camera and clock back; step history back
// over Stories' entries; then, once that has landed, put the share
// state back and let the address follow the live view again.
const finish = () => {
canvas.removeEventListener('pointerdown', onDrag);
stopWatching();
// Reopened meanwhile (the reopen took `was` over), or torn down.
if (pendingView !== was || destroyed || viewer.isDestroyed?.()) return;
pendingView = null;
document.body.classList.remove('stories-mode');
if (!navigated) restoreView(was, { keepCamera });
// AUTHORING shows what it showed before, unless the person opened
// the story there.
if (!keepCamera && was.playedScene && was.authoring)
director.selectShot?.(was.authoring.sceneId, was.authoring.shotId);
const afterLanding = () => {
// Open in GEV keeps this place and look: the live view is written
// over the earlier entry instead.
if (!keepCamera && !navigated) restoreShareState(was);
shareLink()?.holdWrites?.(false);
};
if (fromHistory) afterLanding();
else leaveHistory(afterLanding);
};
return directorSettled(director).then(finish);
},
pick(id) {
if (store.picked === id) return;
const s = id ? storyById(id) : null;
store.picked = s ? id : null;
flyTo(s ? pickView(s) : startView(), s ? 1.6 : 1.4);
if (s) stopTour();
else armTour(1400 + TOUR_DWELL_MS);
},
/**
* @param {string} id
* @param {{autoplay?: boolean, fromHistory?: boolean, atMs?: number}} [opts]
*/
openStory(id, { autoplay = false, fromHistory = false, atMs = 0 } = {}) {
const story = storyById(id);
if (!story) return;
if (!fromHistory && traversing()) {
afterTraversal = () => controller.openStory(id, { autoplay, atMs });
return;
}
if (store.mode === 'closed' && !enterStories()) return;
dropPlayer();
stopPins();
viewer.camera.cancelFlight();
store.storyId = id;
store.picked = id;
store.mode = 'story';
store.expanded = false;
store.ctxOpen = false;
store.sheet = 'peek';
store.bigPlay = !autoplay;
syncSceneShots(story);
store.playback = {
wallMs: atMs,
worldMs: null,
durationMs: story.durationMs,
playing: false,
exploring: false,
chapterIndex: 0,
};
// A GEV scene plays on the person's own globe and layers.
if (saved) saved.ranScene = saved.playedScene = true;
// The scene's own labels, videos and cards stay visible.
document.body.classList.add('stories-scene');
player = createGevPlayer(director, story, { onTick });
// Related stories show their card images too, after a link.
drawThumbs();
startCesiumReadout();
// Opened paused, a scene frames its first shot (or the moment asked).
if (atMs || !autoplay) player.seek(atMs);
if (autoplay) player.play();
if (!fromHistory) navigate({ [PARAM_STORY]: story.id }, true);
if (!store.hintSeen) {
store.hintSeen = true;
store.flashHint(t('Drag the map to explore · Resume any time'), 4200);
}
},
backToExplore({ fromHistory = false } = {}) {
// A second press while the first is landing does nothing more.
if (!fromHistory && traversing()) return;
dropPlayer();
store.expanded = false;
if (!fromHistory) {
// Back to Explore steps back to the Explore entry this story sits
// on, past any related stories opened since; a story with no
// Explore below it (a link) gets one.
const params = new URLSearchParams(location.search);
const to = exploreDepth();
if (params.has(PARAM_STORY) && to != null && depth() > to) {
steppingBack = true;
// A step that never lands gives up, as Close's does.
setTimeout(() => {
if (!steppingBack) return;
steppingBack = false;
const queued = afterTraversal;
afterTraversal = null;
queued?.();
}, LANDING_LIMIT_MS);
history.go(to - depth());
return;
}
navigate({ [PARAM_STORIES]: 'explore' }, true);
}
showExplore();
},
play: () => player?.play(),
pause: () => player?.pause(),
seek: (ms) => player?.seek(ms),
resume: () => player?.resume(),
focusEvent: (event) => player?.focus(event),
get kind() {
return player ? 'gev' : null;
},
/** Layout changed (panel width, sheet, feed size): place the pins again. */
reframe() {
if (removePins) governorRequestRender('stories-layout');
},
/**
* A GEV scene leaves Stories for GEV's own Scenes panel: the globe stays
* where the story was, and the scene and its current shot are selected
* there for authoring.
*/
async openInGev() {
const s = player?.story;
if (!s) return;
const atMs = store.playback.wallMs;
const shotId = s.chapters[store.playback.chapterIndex]?.id ?? null;
player.pause();
// After Close has settled: the scene's teardown restores GEV's look
// and panels, which would fold the Scenes panel again.
await controller.close({ keepCamera: true });
director.selectShot?.(s.sceneId, shotId);
director.styleManager?.setPanelCollapsed?.('scene-panel', false, {
explicit: true,
});
store.hostedToast = {
id: s.id,
title: s.title,
atMs,
when: anchorStamp(s, atMs, null),
};
},
/** The Stories place only: not the sender's camera, layers or style. */
shareLink() {
const here = new URL(location.href);
const url = new URL(here.pathname, here.origin);
for (const key of [PARAM_STORIES, PARAM_STORY])
if (here.searchParams.has(key))
url.searchParams.set(key, here.searchParams.get(key));
return url.toString();
},
destroy() {
if (destroyed) return;
controller.close();
destroyed = true;
// Torn down mid-close: what the close would undo once settled is
// undone now (keyboard and voice guard, held share writes).
document.body.classList.remove('stories-mode', 'stories-scene');
shareLink()?.holdWrites?.(false);
unsubscribeScenes?.();
useSavedScenes(null);
useInstalledScenes(null);
removeEventListener('popstate', onPopState);
canvas.removeEventListener('pointerdown', onDown);
canvas.removeEventListener('pointerdown', onExploreInput);
canvas.removeEventListener('pointerup', onExploreInput);
canvas.removeEventListener('pointercancel', onExploreInput);
canvas.removeEventListener('wheel', onExploreInput);
stopTour();
canvas.removeEventListener('pointerup', onUp);
},
};
// A shared link opens where it points once GEV has finished loading.
const params = new URLSearchParams(location.search);
if (params.has(PARAM_STORY) || params.has(PARAM_STORIES)) {
const id = params.get(PARAM_STORY);
const started = Date.now();
const whenReady = () => {
if (destroyed) return;
const loading = document.getElementById('loading-screen');
if (
loading &&
!loading.classList.contains('hidden') &&
Date.now() - started < 30000
) {
setTimeout(whenReady, 300);
return;
}
// A reload, or Back/Forward into a Stories entry: its history is
// already Stories' own, so open it as it stands.
if (history.state?.gevStories) {
// GEV's boot wrote its share hash onto the entry: Stories' entries
// carry none.
const own = Object.fromEntries(
[...params].filter(([k]) => k === PARAM_STORIES || k === PARAM_STORY),
);
history.replaceState(history.state, '', urlFor(own));
if (id && storyById(id))
controller.openStory(id, { fromHistory: true });
else {
controller.open({ fromHistory: true });
if (id) store.flashToast(t('That story is not available here'));
}
return;
}
// A new link: Explore sits under a story it opens, so Back lands there.
const landing = { stories: 'explore', depth: 0, explore: 0 };
history.replaceState(
{ ...(history.state ?? {}), gevStories: landing },
'',
urlFor({ [PARAM_STORIES]: 'explore' }),
);
if (id && storyById(id)) controller.openStory(id);
else {
controller.open({ fromHistory: true });
// A story saved on someone else's device, or no longer here.
if (id) store.flashToast(t('That story is not available here'));
}
};
setTimeout(whenReady, 300);
}
if (import.meta.env?.DEV) globalThis.__gevStories = { viewer, controller };
return controller;
}
+787
View File
@@ -0,0 +1,787 @@
// The Stories controller: what it leaves behind in history and on GEV's
// globe when Stories opens and closes.
import '../testSupport/registerDom.mjs';
import { registerHooks } from 'node:module';
import test from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import { createPinia, setActivePinia } from 'pinia';
registerHooks({
load(url, context, next) {
if (url.endsWith('.webp'))
return {
format: 'module',
source: `export default ${JSON.stringify(url)};`,
shortCircuit: true,
};
return next(url, context);
},
});
const context = new Proxy(
{},
{ get: (target, name) => target[name] ?? (() => context), set: () => true },
);
globalThis.HTMLCanvasElement.prototype.getContext = (kind) =>
kind === 'webgl' ? null : context;
globalThis.requestAnimationFrame = () => 0;
globalThis.cancelAnimationFrame = () => {};
const { createStoriesController } = await import('./controller.js');
const { COCKPIT_REFUSAL_NOUNS } = await import('../navigationPolicy.js');
const { useStoriesStore } = await import('../ui/stores/stories.js');
const { listStories } = await import('./catalog.js');
function fakeViewer() {
const position = new Cesium.Cartesian3(1, 2, 3);
return {
scene: {
canvas: document.createElement('canvas'),
postRender: { addEventListener: () => () => {} },
preRender: {
listeners: new Set(),
addEventListener(fn) {
this.listeners.add(fn);
return () => this.listeners.delete(fn);
},
},
},
camera: {
positionWC: position,
positionCartographic: { latitude: 0.5, longitude: 0.2, height: 2e6 },
heading: 0,
pitch: -1,
roll: 0,
views: [],
setView(v) {
this.views.push(v);
},
cancelFlight() {},
flyTo() {},
flyToBoundingSphere() {},
rotations: 0,
rotate() {
this.rotations += 1;
},
},
clock: {
currentTime: Cesium.JulianDate.fromDate(new Date(Date.UTC(2026, 0, 1))),
shouldAnimate: false,
},
trackedEntity: undefined,
};
}
function fakeDirector({ refuse = false } = {}) {
const claims = [];
return {
claims,
running: false,
stops: 0,
stopScene() {
this.stops += 1;
},
whenIdle() {
return new Promise((resolve) => {
const check = () => (this.running ? setTimeout(check, 10) : resolve());
check();
});
},
listShots: () => [],
subscribeSceneClock: () => () => {},
seekScene() {},
startScene: async () => ({ started: true }),
selected: [],
selectShot(sceneId, shotId) {
this.selected.push([sceneId, shotId]);
return true;
},
styleManager: {
runImmediateNavigation: (noun) => {
claims.push(noun);
return !refuse;
},
panels: [],
setPanelCollapsed(id, collapsed) {
this.panels.push([id, collapsed]);
},
shareLinkManager: {
restored: [],
restore(hash) {
this.restored.push(hash);
return true;
},
},
},
};
}
function setup(options = {}) {
setActivePinia(createPinia());
history.replaceState(null, '', '/?x=1#v=2&lat=1');
const store = useStoriesStore();
const viewer = fakeViewer();
const director = fakeDirector(options);
const controller = createStoriesController({ viewer, director, store });
store.connect(controller, listStories());
return { store, viewer, director, controller };
}
test('Close steps back over every entry Stories pushed', async () => {
const { controller } = setup();
const steps = [];
const go = history.go;
history.go = (n) => steps.push(n);
try {
controller.open();
assert.equal(history.state.gevStories.depth, 1);
controller.openStory('gev:flights-radar');
assert.equal(history.state.gevStories.depth, 2);
await controller.close();
// Back after Close would otherwise land on ?story=… and reopen it.
assert.deepEqual(steps, [-2]);
} finally {
history.go = go;
controller.destroy();
}
});
test('Close from a Stories link clears Stories from the URL in place', async () => {
const { controller } = setup();
history.replaceState(null, '', '/?stories=explore#v=2');
controller.open({ fromHistory: true });
await controller.close();
assert.equal(new URL(location.href).searchParams.has('stories'), false);
assert.equal(location.hash, '#v=2');
controller.destroy();
});
test('Cockpit keeps the camera: Stories does not open', () => {
const { controller, store, director } = setup({ refuse: true });
controller.open();
assert.equal(store.mode, 'closed');
assert.equal(director.stops, 0);
// The navigation policy shows the refusal; it needs a sentence for the noun.
assert.deepEqual(director.claims, ['stories']);
assert.ok(COCKPIT_REFUSAL_NOUNS.includes('stories'));
controller.destroy();
});
test('reopening while a scene tears down keeps the view from before Stories', async () => {
const { controller, viewer, director } = setup();
const before = viewer.camera.positionWC;
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
const closing = controller.close();
// The scene has moved the camera; the person opens Stories again at once.
viewer.camera.positionWC = new Cesium.Cartesian3(9, 9, 9);
controller.open();
director.running = false;
await closing;
assert.equal(
viewer.camera.views.length,
0,
'no restore under the reopened Stories',
);
await controller.close();
const { x, y, z } = viewer.camera.views.at(-1).destination;
assert.deepEqual({ x, y, z }, { x: before.x, y: before.y, z: before.z });
controller.destroy();
});
test('after a GEV scene, the person’s view comes back once the scene has torn down', async () => {
const { controller, viewer, director } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
const closing = controller.close();
assert.equal(viewer.camera.views.length, 0, 'not under the stopping scene');
setTimeout(() => (director.running = false), 120);
await closing;
assert.equal(viewer.camera.views.length, 1);
controller.destroy();
});
test('a share link carries the story, not the sender’s camera and layers', () => {
const { controller } = setup();
controller.open();
controller.openStory('gev:flights-radar');
const link = new URL(controller.shareLink());
assert.equal(link.searchParams.get('story'), 'gev:flights-radar');
assert.equal(link.hash, '');
assert.equal(link.searchParams.has('x'), false, 'no other query parameters');
controller.destroy();
});
/** Record history.go calls instead of traversing. */
function recordGo(t) {
const steps = [];
const go = history.go;
history.go = (n) => steps.push(n);
t.after(() => {
history.go = go;
});
return steps;
}
test('Back to Explore after a related story steps past both stories', (t) => {
const { controller } = setup();
const steps = recordGo(t);
controller.open();
controller.openStory('gev:flights-radar');
controller.openStory('gev:orbital-watch'); // a related story
assert.equal(history.state.gevStories.depth, 3);
assert.equal(history.state.gevStories.explore, 1);
controller.backToExplore();
// A second click before the traversal lands does nothing more.
controller.backToExplore();
assert.deepEqual(steps, [-2]);
controller.destroy();
});
test('a second Close after a quick reopen still waits for the scene to tear down', async () => {
const { controller, viewer, director } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
controller.close();
controller.open(); // reopened while the scene is still stopping
const closing = controller.close(); // Explore: no GEV story on screen
assert.ok(closing, 'this Close waits too');
assert.equal(viewer.camera.views.length, 0, 'nothing restored yet');
setTimeout(() => (director.running = false), 120);
await closing;
assert.equal(viewer.camera.views.length, 1);
controller.destroy();
});
test('a reload of a Stories entry keeps its history; Close steps all of it back', async (t) => {
setActivePinia(createPinia());
history.replaceState(
{ gevStories: { story: 'gev:flights-radar', depth: 2, explore: 1 } },
'',
'/?story=gev%3Aflights-radar',
);
const steps = recordGo(t);
const store = useStoriesStore();
const controller = createStoriesController({
viewer: fakeViewer(),
director: fakeDirector(),
store,
});
store.connect(controller, listStories());
await new Promise((resolve) => setTimeout(resolve, 400));
assert.equal(store.storyId, 'gev:flights-radar');
assert.equal(history.state.gevStories.depth, 2, 'no extra entry pushed');
await controller.close();
assert.deepEqual(steps, [-2]);
controller.destroy();
});
test('a new story link puts Explore under the story', async (t) => {
setActivePinia(createPinia());
history.replaceState(null, '', '/?story=gev%3Aflights-radar');
const steps = recordGo(t);
const store = useStoriesStore();
const controller = createStoriesController({
viewer: fakeViewer(),
director: fakeDirector(),
store,
});
store.connect(controller, listStories());
await new Promise((resolve) => setTimeout(resolve, 400));
assert.equal(store.storyId, 'gev:flights-radar');
assert.deepEqual(history.state.gevStories, {
story: 'gev:flights-radar',
depth: 1,
explore: 0,
});
controller.backToExplore();
assert.deepEqual(steps, [-1]);
controller.destroy();
});
test('Open in GEV hands a GEV scene to the Scenes panel at its current shot', async () => {
const { controller, store, director, viewer } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
store.playback = { ...store.playback, chapterIndex: 0 };
const shotId =
store.byId('gev:bhote-koshi-nepal-scene').chapters[0]?.id ?? null;
await controller.openInGev();
assert.equal(store.mode, 'closed');
assert.equal(
viewer.camera.views.length,
0,
'the globe stays where the story was',
);
assert.deepEqual(director.selected, [['bhote-koshi-nepal-scene', shotId]]);
assert.deepEqual(director.styleManager.panels, [['scene-panel', false]]);
controller.destroy();
});
const tick = (ms = 30) => new Promise((resolve) => setTimeout(resolve, ms));
test('Close while Back to Explore is landing steps back only the rest of the way', async (t) => {
const { controller } = setup();
const steps = recordGo(t);
controller.open();
controller.openStory('gev:flights-radar');
controller.backToExplore();
controller.close(); // before the Back has landed
assert.deepEqual(steps, [-1], 'Close waits for the Back to land');
// The Back lands on the Explore entry.
history.replaceState(
{ gevStories: { stories: 'explore', depth: 1, explore: 1 } },
'',
'/?stories=explore',
);
dispatchEvent(new PopStateEvent('popstate'));
await tick();
assert.deepEqual(steps, [-1, -1], 'two entries in all, as Stories pushed');
controller.destroy();
});
test('history steps back only after the scene has torn down', async (t) => {
const { controller, director } = setup();
const steps = recordGo(t);
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
const closing = controller.close();
await tick(60);
assert.deepEqual(steps, [], 'no traversal while the scene is stopping');
director.running = false;
await closing;
assert.deepEqual(steps, [-2]);
controller.destroy();
});
test('Back out of Stories after a scene puts the share state back directly', async () => {
const { controller, director } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
// Back has already landed on the page Stories opened from.
await controller.close({ fromHistory: true });
assert.deepEqual(director.styleManager.shareLinkManager.restored, [
'v=2&lat=1',
]);
controller.destroy();
});
/** Land a recorded traversal: the page Stories opened from becomes current. */
function land(hash = '#v=2&lat=1') {
history.replaceState(null, '', `/?x=1${hash}`);
dispatchEvent(new PopStateEvent('popstate'));
}
test('Close after a GEV scene puts the share state back once the step back lands', async (t) => {
const { controller, director } = setup();
const steps = recordGo(t);
const restored = director.styleManager.shareLinkManager.restored;
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
await controller.close();
assert.deepEqual(steps, [-2]);
assert.deepEqual(restored, [], 'not before the landing');
land();
assert.deepEqual(restored, ['v=2&lat=1']);
controller.destroy();
});
test('Open in GEV steps back over Stories without putting the old view back', async (t) => {
const { controller, director, viewer } = setup();
const steps = recordGo(t);
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
await controller.openInGev();
assert.deepEqual(steps, [-2], 'Back never reopens Stories');
land();
assert.deepEqual(director.styleManager.shareLinkManager.restored, []);
assert.equal(viewer.camera.views.length, 0);
controller.destroy();
});
test('a drag on the globe while a scene tears down keeps the camera where it went', async () => {
const { controller, viewer, director } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
const closing = controller.close();
viewer.scene.canvas.dispatchEvent(new Event('pointerdown'));
director.running = false;
await closing;
assert.equal(viewer.camera.views.length, 0, 'no snap back');
controller.destroy();
});
test('a step back that never lands gives up and runs what was waiting', async (t) => {
const { controller, store } = setup();
recordGo(t);
controller.open();
controller.openStory('gev:flights-radar');
await controller.close(); // no popstate will come
controller.open(); // queued behind the traversal
assert.equal(store.mode, 'closed');
await new Promise((resolve) => setTimeout(resolve, 2200));
assert.equal(store.mode, 'explore', 'opened once the traversal gave up');
controller.destroy();
});
test('a reloaded Stories entry drops the share hash GEV wrote on boot', async () => {
setActivePinia(createPinia());
history.replaceState(
{ gevStories: { stories: 'explore', depth: 1, explore: 1 } },
'',
'/?stories=explore#v=2&lat=7',
);
const store = useStoriesStore();
const controller = createStoriesController({
viewer: fakeViewer(),
director: fakeDirector(),
store,
});
store.connect(controller, listStories());
await new Promise((resolve) => setTimeout(resolve, 400));
assert.equal(store.mode, 'explore');
assert.equal(location.hash, '');
assert.equal(new URL(location.href).searchParams.get('stories'), 'explore');
controller.destroy();
});
test('a scene saved to Stories from AUTHORING joins the list at once', () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/');
const store = useStoriesStore();
const director = fakeDirector();
let listener = null;
let mine = [];
director.subscribe = (fn) => {
listener = fn;
return () => (listener = null);
};
director.storyScenes = () => mine;
const controller = createStoriesController({
viewer: fakeViewer(),
director,
store,
});
store.connect(controller, listStories());
assert.equal(store.byId('gev:my-scene'), null);
mine = [
{
id: 'my-scene',
title: 'Harbour at dawn',
camera: { lat: 51.5, lon: -0.1, alt: 2000, heading: 0, pitch: -30 },
shotCount: 2,
},
];
listener({ type: 'stories-changed' });
const story = store.byId('gev:my-scene');
assert.equal(story?.title, 'Harbour at dawn');
assert.equal(story.mine, true);
assert.equal(store.stories[0].id, 'gev:my-scene', 'the person’s own first');
mine = [];
listener({ type: 'stories-changed' });
assert.equal(store.byId('gev:my-scene'), null, 'removed from Stories');
controller.destroy();
assert.equal(listener, null, 'unsubscribed');
});
test('Back to Explore after a scene puts the look back once the scene has torn down, then frames Explore', async () => {
const { controller, viewer, director } = setup();
const flights = [];
viewer.camera.flyTo = (f) => flights.push(f);
viewer.camera.flyToBoundingSphere = (f) => flights.push(f);
const share = director.styleManager.shareLinkManager;
// GEV's restore writes the hash it applies; Explore's address drops it.
share.restore = function (hash) {
this.restored.push(hash);
history.replaceState(history.state, '', `${location.search}#${hash}`);
return true;
};
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
flights.length = 0;
controller.backToExplore({ fromHistory: true });
await tick(30);
assert.deepEqual(share.restored, [], 'not under the stopping scene');
assert.equal(flights.length, 0, 'Explore waits for the scene');
director.running = false;
await tick(40);
assert.deepEqual(share.restored, ['v=2&lat=1']);
assert.equal(location.hash, '', 'the address names only Stories');
assert.equal(flights.length, 1, 'then Explore frames the globe');
// A later Back to Explore with no scene in between restores nothing more.
controller.openStory('gev:bhote-koshi-nepal-scene');
controller.pause();
controller.backToExplore({ fromHistory: true });
await tick(40);
assert.equal(share.restored.length, 2, 'each scene is undone once');
controller.destroy();
});
test('a story opened while the scene tears down is not undone by the late restore', async () => {
const { controller, director } = setup();
controller.open();
controller.openStory('gev:bhote-koshi-nepal-scene');
director.running = true;
controller.backToExplore({ fromHistory: true });
controller.openStory('gev:flights-radar');
director.running = false;
await tick(40);
assert.deepEqual(director.styleManager.shareLinkManager.restored, []);
controller.destroy();
});
test('Explore tours from story to story once idle, stops on a pick or a touch, and on Close', async (t) => {
t.mock.timers.enable({ apis: ['setTimeout', 'Date'] });
const { controller, viewer, store } = setup();
const flights = [];
viewer.camera.flyTo = (f) => flights.push(f);
viewer.camera.flyToBoundingSphere = (f) => flights.push(f);
controller.open();
assert.equal(flights.length, 1, 'the fly-in to the first story');
t.mock.timers.tick(7000);
assert.equal(flights.length, 1, 'a moment on the first story');
t.mock.timers.tick(1000);
assert.equal(flights.length, 2, 'then on to the next');
t.mock.timers.tick(8500);
assert.equal(flights.length, 3, 'and the next');
// A press holds the tour however long the drag lasts; letting go starts
// the wait again.
viewer.scene.canvas.dispatchEvent(new Event('pointerdown'));
t.mock.timers.tick(20000);
assert.equal(flights.length, 3, 'nothing flies under a drag');
viewer.scene.canvas.dispatchEvent(new Event('pointerup'));
t.mock.timers.tick(5000);
assert.equal(flights.length, 3);
t.mock.timers.tick(1500);
assert.equal(flights.length, 4);
// A picked story stops it.
controller.pick(store.stories[0].id);
const picked = flights.length;
t.mock.timers.tick(30000);
assert.equal(flights.length, picked);
// Unpicked, it tours again, for a minute at most.
controller.pick(null);
for (let i = 0; i < 24; i++) t.mock.timers.tick(5000);
const after = flights.length;
assert.ok(after > picked + 3, 'touring again');
for (let i = 0; i < 12; i++) t.mock.timers.tick(5000);
assert.equal(flights.length, after, 'stopped on its own');
controller.pick(null);
controller.destroy();
});
test('a new Explore link keeps the address free of the share hash GEV writes as Stories opens', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/?stories=explore');
const store = useStoriesStore();
const director = fakeDirector();
// Holding writes first writes the view change still waiting.
director.styleManager.shareLinkManager.holdWrites = (held) => {
if (held) history.replaceState(history.state, '', `${location.search}#v=2`);
};
const controller = createStoriesController({
viewer: fakeViewer(),
director,
store,
});
store.connect(controller, listStories());
await tick(400);
assert.equal(store.mode, 'explore');
assert.equal(location.hash, '');
assert.equal(location.search, '?stories=explore');
controller.destroy();
});
test('a saved scene’s topics become Explore chips, and its captured card image is used', async () => {
const { metaFor, topicsOf } = await import('./storyMeta.js');
setActivePinia(createPinia());
history.replaceState(null, '', '/');
const store = useStoriesStore();
const director = fakeDirector();
director.subscribe = () => () => {};
director.storyScenes = () => [
{
id: 'harbour',
title: 'Harbour at dawn',
camera: { lat: 51.5, lon: -0.1, alt: 2000 },
shotCount: 1,
thumb: 'data:image/jpeg;base64,BBBB',
tags: ['Maritime', 'Floods'],
},
];
const controller = createStoriesController({
viewer: fakeViewer(),
director,
store,
});
store.connect(controller, listStories());
const story = store.byId('gev:harbour');
assert.deepEqual(metaFor(story).topics, ['Maritime', 'Floods']);
const chips = topicsOf(store.stories);
assert.ok(chips.includes('Maritime') && chips.includes('Floods'));
assert.ok(
chips.indexOf('Floods') < chips.indexOf('Maritime'),
'in AUTHORING’s tag order',
);
controller.open();
await tick(20);
assert.equal(store.thumbs['gev:harbour'], 'data:image/jpeg;base64,BBBB');
controller.destroy();
});
test('Close after a story puts AUTHORING’s own selection back; Open in GEV keeps the story’s', async () => {
const { controller, director } = setup();
director.selection = () => ({ sceneId: null, shotId: null });
controller.open();
controller.openStory('gev:flights-radar');
await controller.close({ fromHistory: true });
assert.deepEqual(director.selected.at(-1), [null, null], 'back to none');
director.selected.length = 0;
controller.open();
controller.openStory('gev:flights-radar');
await controller.openInGev();
assert.deepEqual(
director.selected.map(([sceneId]) => sceneId),
['flights-radar'],
'the story’s scene, nothing put back',
);
controller.destroy();
});
test('a built-in scene no longer in the project does not list; an unknown story link says so', async () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/?story=gev%3Asomeone-elses');
const store = useStoriesStore();
const director = fakeDirector();
director.hasScene = (id) => id !== 'flights-radar';
const toasts = [];
store.flashToast = (text) => toasts.push(text);
const controller = createStoriesController({
viewer: fakeViewer(),
director,
store,
});
store.connect(controller, listStories());
assert.equal(store.byId('gev:flights-radar'), null);
assert.ok(store.byId('gev:orbital-watch'));
await tick(400);
assert.equal(store.mode, 'explore');
assert.equal(toasts.length, 1, 'the person is told');
controller.destroy();
assert.equal(document.body.classList.contains('stories-mode'), false);
});
test('Close after Back to Explore still puts AUTHORING’s selection back', async () => {
const { controller, director } = setup();
director.selection = () => ({ sceneId: null, shotId: null });
controller.open();
controller.openStory('gev:flights-radar');
controller.backToExplore({ fromHistory: true });
await tick(40);
await controller.close({ fromHistory: true });
assert.deepEqual(director.selected.at(-1), [null, null]);
controller.destroy();
});
test('the person’s unsaved scenes list as drafts, which cannot be shared', () => {
setActivePinia(createPinia());
history.replaceState(null, '', '/');
const store = useStoriesStore();
const director = fakeDirector();
director.subscribe = () => () => {};
director.draftScenes = () => [
{
id: 'sketch',
title: 'Sketch',
camera: { lat: 1, lon: 2, alt: 3000 },
shotCount: 1,
thumb: '',
tags: [],
},
];
const controller = createStoriesController({
viewer: fakeViewer(),
director,
store,
});
store.connect(controller, listStories());
const draft = store.byId('gev:sketch');
assert.equal(draft?.draft, true);
assert.equal(draft.mine, true, 'local only: no Share');
controller.destroy();
});
test('under imagery other than Esri, a card drawn from Esri earlier is dropped', async () => {
const { controller, viewer, store } = setup();
viewer.imageryLayers = {
get: () => ({
imageryProvider: { url: 'https://tile.openstreetmap.org/' },
}),
};
store.thumbs = { 'gev:flights-radar': 'data:image/jpeg;base64,ESRI' };
controller.open();
await tick(20);
assert.equal(store.thumbs['gev:flights-radar'], undefined);
controller.destroy();
});
test('the tour waits again after a wheel turn or a cancelled press, and a list change during a drag does not restart it', async (t) => {
t.mock.timers.enable({ apis: ['setTimeout', 'Date'] });
const { controller, viewer, director } = setup();
let listener = null;
director.subscribe = (fn) => ((listener = fn), () => {});
const flights = [];
viewer.camera.flyTo = (f) => flights.push(f);
viewer.camera.flyToBoundingSphere = (f) => flights.push(f);
controller.destroy();
const store = useStoriesStore();
const again = createStoriesController({ viewer, director, store });
store.connect(again, listStories());
again.open();
const canvas = viewer.scene.canvas;
for (const type of ['wheel', 'pointercancel']) {
const before = flights.length;
canvas.dispatchEvent(new Event(type));
t.mock.timers.tick(5900);
assert.equal(flights.length, before, `${type}: waits`);
t.mock.timers.tick(200);
assert.equal(flights.length, before + 1, `${type}: then tours`);
}
canvas.dispatchEvent(new Event('pointerdown'));
listener({ type: 'stories-changed' });
const held = flights.length;
t.mock.timers.tick(30000);
assert.equal(flights.length, held, 'nothing flies under the drag');
again.destroy();
});
test('teardown mid-close lets the share link write again', () => {
const { controller, director } = setup();
const held = [];
director.styleManager.shareLinkManager.holdWrites = (on) => held.push(on);
controller.open();
controller.destroy();
assert.equal(held.at(-1), false);
});
test('place names name only a shipped scene’s untitled shots', () => {
const { controller, director, store } = setup();
director.listShots = () => [
{ id: 'a', title: 'Shot 1', startSec: 0, durationSec: 5 },
{ id: 'b', title: 'Over the harbour', startSec: 5, durationSec: 5 },
];
controller.openStory('gev:flights-radar');
const story = store.byId('gev:flights-radar');
assert.deepEqual(
story.chapters.map((c) => c.title),
['The Atlantic', 'Over the harbour'],
);
controller.destroy();
});
+46
View File
@@ -0,0 +1,46 @@
/** Index of the chapter playing at a wall position (milliseconds). */
export function chapterAt(story, w) {
let k = 0;
story.chapters.forEach((c, i) => {
if (w >= c.wallMs) k = i;
});
return k;
}
/**
* Where GEV's credit line sits while Stories is open: inside the map's bottom
* left, clear of Explore's desktop feed when that covers the map's left side
* (on a phone the feed is a sheet below the map). Null when there is no map,
* so GEV's own placement applies.
* @param {{map?: DOMRect|null, feed?: DOMRect|null, width: number, height: number}} view
* @returns {{bottom: number, left: number} | null} Pixels from the window's bottom and left.
*/
export function creditPlacement({ map, feed, width, height }) {
if (!map?.width) return null;
const besideFeed =
!!feed?.width &&
feed.left <= map.left + 1 &&
feed.right < map.right &&
feed.top < map.bottom - 1 &&
feed.bottom >= map.bottom - 1;
const gap = width <= 700 ? 10 : 24;
return {
bottom: Math.max(0, height - map.bottom) + 6,
left: besideFeed ? feed.right + 14 : map.left + gap,
};
}
/**
* Where the Stories button sits: just left of the leftmost visible control
* in GEV's top-right corner — the ACTIVE STYLE readout in GEV, the account
* avatar (with or beside the readout) in GEV Hosted — top-aligned with it.
* @param {Array<DOMRect|null|undefined>} corner The corner controls' boxes.
* @param {number} width The window's width.
* @returns {{top: number, right: number}} Pixels from the top and right.
*/
export function entryPlacement(corner, width) {
const shown = corner.filter((r) => r && r.width > 0 && r.height > 0);
if (!shown.length) return { top: 14, right: 14 };
const left = shown.reduce((a, b) => (b.left < a.left ? b : a));
return { top: left.top, right: width - left.left + 10 };
}
+3
View File
@@ -0,0 +1,3 @@
/** GEV eye logo as an SVG symbol, referenced as `<use href="#gevLogo">`. */
export const GEV_LOGO_SYMBOL =
'<symbol id="gevLogo" viewBox="180 120 775 520"><path fill="#4454727a" stroke="#48b" stroke-width="10" fill-rule="evenodd" d="M567.5,623c-163.183,0-303.026-99.084-361.823-239.922C257.508,238.76,401.037,135,570,135c166.451,0,308.222,100.7,361.954,241.667C874.771,520.905,733.152,623,567.5,623ZM567,156c124.816,0,226,101.184,226,226S691.816,608,567,608,341,506.816,341,382,442.184,156,567,156ZM816,256.213A272.836,272.836,0,0,1,846,381M793.574,488.677a249.545,249.545,0,0,0,3.239-208.3A303.384,303.384,0,0,0,816,256.213a274.468,274.468,0,0,1-1.516,252.475q-0.927,1.758-1.88,3.5-1.632-2.238-3.306-4.446Q801.826,497.884,793.574,488.677ZM345.5,490.85q-8.055,9.164-15.37,18.966a274.353,274.353,0,0,1-3.748-250.343q7.347,10.012,15.469,19.393A249.512,249.512,0,0,0,345.5,490.85Z"/><path fill="#00f6ff" stroke="#000" stroke-width="1" fill-rule="evenodd" d="M568,179.985c107.678,0,194.968,88.655,194.968,198.015S675.678,576.015,568,576.015,373.032,487.36,373.032,378,460.322,179.985,568,179.985Z"/><path fill="none" stroke="#00f6ff" stroke-width="6.99" stroke-linecap="round" fill-rule="evenodd" d="M569.5,499.831A120.331,120.331,0,1,1,689.831,379.5,120.33,120.33,0,0,1,569.5,499.831Zm65.1-50.585c1.225-.4,3.268-2.858,4.492-3.677s3.268-4.083,3.675-5.717,1.227-4.495,1.634-6.126a36.015,36.015,0,0,0,.818-6.135,14.639,14.639,0,0,0-.407-2.855l-3.266,6.127s-4.9,2.04-5.315,3.674-0.817,4.088-.817,4.088a61.248,61.248,0,0,0-2.45,6.133C632.554,446.388,633.372,449.66,634.6,449.246ZM461.011,377.072c0.72-1.105,1.928-6.276,1.6-7.894-0.411-2.037,1.225-6.94,1.225-9.392s4.083-7.358,4.9-9.4,4.491-7.349,6.535-10.623-0.4-2.038-2.449-.809,1.225-3.274,2.449-4.086,8.172-5.72,8.172-5.72,2.449-2.454-.409-7.762c-2.211-4.1,0-4.5,0-6.128a2.43,2.43,0,0,0-1.28-.223c2.129-2.952,4.408-5.788,6.811-8.512A108.871,108.871,0,0,0,494.612,458.6a0.454,0.454,0,0,1,.683-0.363c2.043,0.819,2.449-.4,4.085-0.4s4.086-2.043,4.086-2.043l-1.641-4.9,1.641-6.126,2.041-5.717s0-4.095-2.041-4.5-5.722-4.081-6.946-4.081a10.018,10.018,0,0,1-4.491-1.636c-1.227-.813-3.677-1.634-4.5-2.857a31.144,31.144,0,0,1-2.858-5.314c-0.816-2.039-.409-2.039-3.681-5.715s-2.452-2.863-4.9-4.093-3.265-2.443-5.308-3.263a13.378,13.378,0,0,1-4.5-2.857,4.884,4.884,0,0,0-2.711-1.519,110.041,110.041,0,0,1-2.595-23.808C460.98,378.618,461,377.84,461.011,377.072Zm35.743-78.7a13.8,13.8,0,0,0-1.051,2.589c-0.408,1.638,2.864.416,2.864,0.416L502.239,303l4.5-1.631a13.741,13.741,0,0,1,4.083-4.5c2.857-2.043,2.454-2.452,3.677-4.084s0-.006,5.314-5.732,8.167-5.718,8.167-5.718,1.915-2.1,3.244-3.895A108.986,108.986,0,0,0,496.754,298.368Zm41.024,56.1c-1.224.82-5.715,3.272-6.944,5.315a22.681,22.681,0,0,0-2.859,6.535,31.042,31.042,0,0,0-.408,6.538c0,2.854-.41,4.5,0,6.949s4.5,8.568,6.128,10.623c1.63,2.038,3.674,4.483,5.719,5.713a47.235,47.235,0,0,1,4.9,3.674,4.03,4.03,0,0,0,4.9,1.223c3.272-1.223,6.538-1.223,9.4-2.853s7.353-3.685,7.353-1.231,1.632,4.084,4.082,3.272,6.539-2.858,6.13,0S577,406.764,577,408.4s-0.4,3.265.818,4.495,4.5,3.265,4.5,4.49,0.409,5.311,1.229,6.946,1.639,4.08.823,5.724-2.434,6.123-2.434,6.123-0.779,3.676-.37,4.9a12.683,12.683,0,0,0,3.332,4.906c2.043,2.042,1.771,4.492,2.994,6.124s2.993,6.539,2.993,6.539l1.236,4.088v3.677s7.966-1.231,9.591-1.64a30.673,30.673,0,0,0,8.618-4.9c1.636-1.632,1.311-2.856,3.349-4.488s5.762-4.5,5.762-4.5l-0.387-6.126,4.914-6.544,3.684-3.677s3.267-4.484,2.865-6.128c-0.413-1.628-1.231-9.8-1.231-9.8a37.972,37.972,0,0,1,2.863-5.313c1.224-1.634,1.227-3.678,3.679-5.719a33.109,33.109,0,0,0,5.306-6.126c1.229-1.634,3.681-4.9,4.5-6.127a21.871,21.871,0,0,0,1.635-4.894l-7.355,1.216c-2.45-4.082-9.392-13.073-10.621-15.112a37.04,37.04,0,0,1-2.861-7.76c-0.4-1.634-2.445-6.131-2.856-7.356s-3.27-4.908-4.088-6.128-3.675-2.043-5.309-3.268-11.843-3.27-11.843-3.27-3.129-1.991-4.088-1.226c-4.083,3.269-13.48,1.226-15.523.415s-3.269-2.041-3.269-3.272-1.835-7.143-1.835-7.143-3.985.705-5.213,0.705a20.333,20.333,0,0,1-4.442-1.276s-4.055.379-5.693,1.2a61.205,61.205,0,0,1-6.115,2.438,36.488,36.488,0,0,1-4.488.814c-3.671-1.636-6.529,2.45-7.352,4.079s-2.445,2.454-2.445,4.084S539,353.659,537.778,354.471Zm18.191-54.739-3.128-4.5-3.727,2.045V304.5l-3.839-1.5-1.715,3.674,1.685,2.452L549.114,305v4.129l8.478-1.636,3.164-2.449Zm71.15-12.676c-1.669.869-4.808,3.094-6,1.894-1.227-1.218-4.086-3.423-4.086-3.423,2.448-1.636-4.9-5.212-4.9-5.212l-8.576-1.022h-6.125c-1.227,0-3.681.825-5.723,0.825s-6.943,3.583-8.577,3.994-5.314,2.5-6.944,2.5-4.088,3.086-4.088,3.086-2.856,5.218-.4,4.4,5.717-.858,6.122.367,1.227,3.242,1.636,4.471,6.131,1.618,6.131,1.618a18.551,18.551,0,0,1,2.038-3.683c1.227-1.634,2.452-3.675,2.452-3.675s2.044,4.082,2.452,5.3-0.818,4.908-.818,4.908-4.491,2.852-5.716,2.852-8.175-6.126-8.175-6.126a25.4,25.4,0,0,0-4.489,2.043c-2.856,2.861-5.717,5.31-5.717,5.31a17.057,17.057,0,0,0-4.081,2.046c-1.629,1.222-5.138,1.487-6.117,2.854-2.039,2.863.84,4.9,0.84,4.9l-2.408,3.271-1.548,1.225-5.553,1.221-2.751.616c0.4,1.227,1.258,5.105,1.258,5.105s-1.87,6.943,0,6.943c0,0,4.276,1.64,5.5,1.64s2.625,0.4,4.265-1.227a59.861,59.861,0,0,0,5.156-6.538,8.0Line truncated
+143
View File
@@ -0,0 +1,143 @@
import { chapterAt } from './format.js';
/** Longest Stories waits for a scene to tear down before going on anyway. */
export const SETTLE_LIMIT_MS = 15000;
/**
* Resolves once the director is idle: no run, and every LOAD, seek and
* interaction settled (SceneDirector.whenIdle). A teardown that never
* finishes is given SETTLE_LIMIT_MS, so a stuck scene cannot leave Stories
* unable to close; that case is logged.
* @param {import('../scenes/director.js').SceneDirector} director
*/
export function directorSettled(director) {
let timer = 0;
const limit = new Promise((resolve) => {
timer = setTimeout(() => {
console.warn('Stories: the scene did not finish tearing down; going on');
resolve();
}, SETTLE_LIMIT_MS);
});
// A failure to wait counts as settled: the view still comes back.
const idle = Promise.resolve()
.then(() => director.whenIdle())
.catch(() => {});
return Promise.race([idle, limit]).finally(() => clearTimeout(timer));
}
/**
* Plays a scene GEV already ships through SceneDirector, the way the Scene
* panel plays it, and reports the scene clock in the shape the Stories
* timeline reads. SceneDirector has no pause: pausing seeks to the current
* moment (which stops the run and frames it), and playing again starts the
* run at the shot that moment is in.
*
* @param {import('../scenes/director.js').SceneDirector} director
* @param {object} story A catalog story of kind 'gev'.
* @param {{onTick?: (state: object) => void}} [hooks]
*/
export function createGevPlayer(director, story, hooks = {}) {
const sceneId = story.sceneId;
let wallMs = 0;
let durationMs = story.durationMs;
let playing = false;
let shotIndex = 0;
let destroyed = false;
// Each Play, Pause, Seek and Destroy takes a new number; a Play that waited
// for a teardown or a start goes ahead only if nothing came after it.
let request = 0;
const state = () => ({
wallMs,
worldMs: null,
durationMs,
playing,
exploring: false,
chapterIndex: Math.min(shotIndex, story.chapters.length - 1),
});
const tick = () => {
if (!destroyed) hooks.onTick?.(state());
};
const unsubscribe = director.subscribeSceneClock((snap) => {
if (destroyed || !snap || snap.sceneId !== sceneId) return;
if (snap.sceneDurationSec) durationMs = snap.sceneDurationSec * 1000;
wallMs = (snap.sceneElapsedSec ?? 0) * 1000;
shotIndex = snap.shotIndex ?? shotIndex;
playing = !!snap.running && !snap.seeking;
if (!playing && wallMs >= durationMs - 250) wallMs = durationMs;
tick();
});
// A run from the previous story may still be releasing the camera.
async function idle() {
if (!director.running) return;
director.stopScene();
await directorSettled(director);
}
return {
kind: 'gev',
story,
get state() {
return state();
},
async play() {
const mine = ++request;
await idle();
if (destroyed || mine !== request || director.running) return;
if (wallMs >= durationMs - 250) {
wallMs = 0;
shotIndex = 0;
}
const shots = director.listShots(sceneId);
const afterShotId =
shotIndex > 0 ? (shots[shotIndex - 1]?.id ?? null) : null;
playing = true;
tick();
const result = await director.startScene(sceneId, {
single: true,
afterShotId,
preview: true,
});
if (destroyed) return;
if (mine !== request) {
// Paused or scrubbed while the run was starting: that wins.
if (result?.started)
director.seekScene(sceneId, durationMs ? wallMs / durationMs : 0);
return;
}
if (!result?.started) {
playing = false;
tick();
}
},
pause() {
request += 1;
playing = false;
director.seekScene(sceneId, durationMs ? wallMs / durationMs : 0);
tick();
},
seek(ms) {
request += 1;
wallMs = Math.max(0, Math.min(durationMs, ms));
shotIndex = chapterAt(story, wallMs);
playing = false;
director.seekScene(sceneId, durationMs ? wallMs / durationMs : 0);
tick();
},
resume() {
return this.play();
},
/** A key moment: go to that point of the scene. */
focus(event) {
if (event?.wallMs != null) this.seek(event.wallMs);
},
destroy() {
request += 1;
destroyed = true;
unsubscribe?.();
director.stopScene();
},
};
}
+95
View File
@@ -0,0 +1,95 @@
// A GEV scene's Play waits for the last run to tear down and for the new run
// to start; a Pause, Seek or Destroy meanwhile must win.
import test from 'node:test';
import assert from 'node:assert/strict';
import { createGevPlayer } from './gevPlayer.js';
const story = {
sceneId: 'scene-1',
durationMs: 60000,
chapters: [{ wallMs: 0 }, { wallMs: 30000 }],
};
/** A director whose start resolves when the test says so. */
function deferredDirector({ running = false } = {}) {
const calls = [];
let release = null;
const director = {
running,
calls,
listShots: () => [{ id: 'a' }, { id: 'b' }],
subscribeSceneClock: () => () => {},
stopScene: () => calls.push('stop'),
whenIdle() {
return new Promise((resolve) => {
const check = () => (this.running ? setTimeout(check, 10) : resolve());
check();
});
},
seekScene: (id, f) => calls.push(`seek ${f}`),
startScene: () => {
calls.push('start');
return new Promise((resolve) => {
release = () => {
director.running = true;
resolve({ started: true });
};
});
},
finishStart: () => release?.(),
};
return director;
}
const turns = async (n = 4) => {
for (let i = 0; i < n; i++) await Promise.resolve();
};
test('Pause straight after Play stops the Play from starting', async () => {
const director = deferredDirector();
const states = [];
const player = createGevPlayer(director, story, {
onTick: (s) => states.push(s.playing),
});
const playing = player.play();
player.pause();
await playing;
assert.equal(director.calls.includes('start'), false);
assert.equal(states.at(-1), false);
});
test('a Seek during the last run’s teardown cancels the waiting Play', async () => {
const director = deferredDirector({ running: true });
const player = createGevPlayer(director, story);
const playing = player.play();
player.seek(30000);
director.running = false; // the old run finishes tearing down
await playing;
assert.equal(director.calls.includes('start'), false);
assert.equal(player.state.playing, false);
assert.equal(player.state.wallMs, 30000);
});
test('a Pause while the run is starting is applied once it has started', async () => {
const director = deferredDirector();
const player = createGevPlayer(director, story);
const playing = player.play();
await turns();
assert.deepEqual(director.calls, ['start']);
player.pause();
director.finishStart();
await playing;
// Pause seeks once when pressed, and again after the late start.
assert.equal(director.calls.filter((c) => c.startsWith('seek')).length, 2);
assert.equal(player.state.playing, false);
});
test('Destroy cancels a waiting Play', async () => {
const director = deferredDirector({ running: true });
const player = createGevPlayer(director, story);
const playing = player.play();
player.destroy();
director.running = false;
await playing;
assert.equal(director.calls.includes('start'), false);
});
+38
View File
@@ -0,0 +1,38 @@
/**
* While Stories is open its screens own the keyboard. A key pressed inside
* Stories reaches Stories' controls and stops at its root, before GEV's
* document-level shortcuts; a key pressed anywhere else (nothing focused, or
* a hidden GEV control) stops at the window, so nothing behind Stories acts
* on it, unless it is one of a playing GEV scene's own on-globe controls.
* Listeners on the window itself (Stories' own Escape and "/") still
* run. Capture-phase listeners on the document run before the root and check
* `body.stories-mode` themselves (hold Space to talk, focus traps).
* @param {{root: HTMLElement, isOpen: () => boolean, win?: Window}} options
* @returns {() => void} Removes the guard.
*/
export function guardStoriesKeyboard({ root, isOpen, win = window }) {
const types = ['keydown', 'keyup', 'keypress'];
// A GEV scene playing in Stories keeps its own controls (the A/B slider,
// an embedded player's card): their keys reach them as outside Stories.
const sceneControl = (target) =>
root.ownerDocument.body.classList.contains('stories-scene') &&
!!target?.closest?.('[data-globe-overlay]');
const outside = (event) => {
if (!isOpen() || root.contains(event.target)) return;
if (sceneControl(event.target)) return;
event.stopPropagation();
};
const inside = (event) => {
if (isOpen()) event.stopPropagation();
};
for (const type of types) {
win.addEventListener(type, outside, true);
root.addEventListener(type, inside);
}
return () => {
for (const type of types) {
win.removeEventListener(type, outside, true);
root.removeEventListener(type, inside);
}
};
}
+76
View File
@@ -0,0 +1,76 @@
// While Stories is open, GEV's document-level keys stay quiet behind it.
import '../testSupport/registerDom.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { guardStoriesKeyboard } from './keyboard.js';
function page() {
document.body.innerHTML =
'<div id="gev-stories"><button id="inside"></button></div><button id="gev"></button>';
const root = document.getElementById('gev-stories');
const heard = [];
const gev = (event) => heard.push(`gev ${event.key}`);
document.addEventListener('keydown', gev);
const own = (event) => heard.push(`stories ${event.key}`);
document.getElementById('inside').addEventListener('keydown', own);
const windowOwn = (event) => heard.push(`window ${event.key}`);
window.addEventListener('keydown', windowOwn, true);
const press = (id, key) =>
document
.getElementById(id)
.dispatchEvent(new KeyboardEvent('keydown', { key, bubbles: true }));
const cleanup = () => {
document.removeEventListener('keydown', gev);
window.removeEventListener('keydown', windowOwn, true);
};
return { root, heard, press, cleanup };
}
test('keys in Stories reach Stories and stop there; keys elsewhere reach nothing behind it', () => {
const { root, heard, press, cleanup } = page();
let open = true;
const remove = guardStoriesKeyboard({ root, isOpen: () => open });
press('inside', '3');
press('gev', 'o');
assert.deepEqual(heard, ['window 3', 'stories 3', 'window o']);
// Closed, GEV hears its keys again.
open = false;
heard.length = 0;
press('gev', 'o');
assert.deepEqual(heard, ['window o', 'gev o']);
remove();
cleanup();
});
test('removing the guard lets every key through', () => {
const { root, heard, press, cleanup } = page();
const remove = guardStoriesKeyboard({ root, isOpen: () => true });
remove();
press('inside', 'h');
assert.deepEqual(heard, ['window h', 'stories h', 'gev h']);
cleanup();
});
test("a playing GEV scene's own on-globe controls keep their keys", () => {
const { root, heard, cleanup } = page();
document.body.insertAdjacentHTML(
'beforeend',
'<div data-globe-overlay><button id="slider"></button></div>',
);
const slider = document.getElementById('slider');
slider.addEventListener('keydown', (e) => heard.push(`slider ${e.key}`));
const remove = guardStoriesKeyboard({ root, isOpen: () => true });
document.body.classList.add('stories-scene');
slider.dispatchEvent(
new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true }),
);
assert.ok(heard.includes('slider ArrowRight'));
document.body.classList.remove('stories-scene');
heard.length = 0;
slider.dispatchEvent(
new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true }),
);
assert.deepEqual(heard, ['window ArrowRight'], 'no scene: GEV stays quiet');
remove();
cleanup();
});
+150
View File
@@ -0,0 +1,150 @@
import { msg, t, translateKnown } from '../i18n/index.js';
import { STORY_TAGS } from '../scenes/storyTags.js';
/**
* What Explore and the Story page show around a story beyond the catalog:
* topics and region for the feed's chips and filters, the clock and chapter
* stamps, the legend and the "right now" facts.
*/
export const fmtDur = (ms) => {
const s = Math.round(ms / 1000);
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;
};
export const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
/**
* Topics, region and searchable places per shipped story. Topics use the
* AUTHORING tag names (src/scenes/storyTags.js) and follow the layers each
* scene turns on.
*/
export const META = {
'gev:bhote-koshi-nepal-scene': {
topics: ['Floods'],
region: 'South Asia',
place: 'Nepal Bhote Koshi river',
},
'gev:flights-radar': {
topics: ['Flights'],
region: 'Global',
place: 'Atlantic Europe Japan San Francisco',
},
'gev:orbital-watch': {
topics: ['Space'],
region: 'Global',
place: 'Florida Africa Tokyo Paris Atlantic',
},
'gev:thermal-threats': {
topics: ['Earthquakes'],
region: 'Global',
place: 'California Japan New Zealand Portugal',
},
'gev:city-overload': {
topics: ['Flights', 'Space', 'Infrastructure'],
region: 'Global',
place: 'New York Los Angeles London',
},
'gev:omniscience-pullback': {
topics: ['Flights', 'Space', 'Earthquakes', 'Infrastructure'],
region: 'Global',
place: 'Tokyo Japan East Asia South China Sea',
},
};
export const FILTERS = [
[
'region',
msg('Region'),
[
['Europe', msg('Europe')],
['Middle East', msg('Middle East')],
['South Asia', msg('South Asia')],
['North America', msg('North America')],
['East Asia', msg('East Asia')],
['Global', msg('Global')],
],
],
[
'length',
msg('Length'),
[
['short', msg('Under 1 min')],
['long', msg('1 min or more')],
],
],
];
/**
* A story's topics, region and place: the topics the person picked for it,
* then the shipped META.
*/
export function metaFor(s) {
const m = META[s.id] ?? { topics: [], region: 'Global', place: '' };
const topics = [...new Set([...(s.topics ?? []), ...m.topics])];
return { ...m, topics };
}
/** The topics the stories carry, in AUTHORING's tag order. */
export function topicsOf(stories) {
const order = (topic) => {
const i = STORY_TAGS.indexOf(topic);
return i < 0 ? STORY_TAGS.length : i;
};
return [...new Set(stories.flatMap((s) => metaFor(s).topics))].sort(
(a, b) => order(a) - order(b),
);
}
/** The clock overlay: big line and small line. */
export function clockText(s, wallMs, worldMs, chapterIndex) {
return {
big: t('Shot {n} of {total}', {
n: chapterIndex + 1,
total: s.chapters.length,
}),
small: t('GEV scene'),
};
}
/**
* A story's own text (title, caption, label, source…) in the page's
* language. Shipped stories carry English marked with msg(); a scene the
* person named shows as they named it.
*/
export const storyText = (text) => (text ? translateKnown(text) : '');
/**
* A chapter's title in the page's language: a scene's shot titles come from
* the director already in it.
*/
export function chapterTitle(story, c) {
return c.title ?? t('Shot {n}', { n: c.shot });
}
/** The story's time window as the feed shows it. */
export function windowText() {
return t('GEV scene');
}
/** Stamp for a chapter or key moment: its place on the scene's clock. */
export function anchorStamp(s, wallMs) {
return fmtDur(wallMs);
}
/** Legend entries [shape, colour, label]. */
export function layersFor(s) {
if (s.mock?.legend?.length) return s.mock.legend;
return (s.tags ?? []).map((tag) => ['dot', '#e8eaed', tag]);
}
/** "Right now" facts per story (prototype nowFacts): [value, label, warn]. */
export function nowFacts(s, worldMs, wallMs = 0) {
const out = [[String(s.chapters.length), msg('Shots')]];
if (s.tags?.length) out.push([String(s.tags.length), msg('Layers on')]);
return out;
}
/** A chapter's stamp in lists: its place on the scene's clock. */
export function chapterStamp(s, c) {
return fmtDur(c.wallMs);
}
+102
View File
@@ -0,0 +1,102 @@
import * as Cesium from 'cesium';
/**
* Story card images, drawn from the imagery GEV is already showing: the
* base layer's tiles around a story's place, cropped to the card. No other
* host is asked, and the imagery is the one GEV credits on screen.
*/
const WIDTH = 320;
const HEIGHT = 180;
const TILE_TRIES = 4;
/** A zoom level that frames `range` metres of view, within the provider's. */
export function thumbLevel(range, provider) {
const level = Math.round(Math.log2(4e7 / Math.max(range || 1.6e7, 1)));
const max = Number.isFinite(provider?.maximumLevel)
? provider.maximumLevel
: 18;
const min = Number.isFinite(provider?.minimumLevel)
? provider.minimumLevel
: 0;
return Math.max(min, Math.min(max, Math.max(1, level)));
}
async function tile(provider, x, y, level) {
for (let i = 0; i < TILE_TRIES; i++) {
// undefined: the request was throttled; ask again shortly.
const image = await provider.requestImage(x, y, level);
if (image) return image;
await new Promise((resolve) => setTimeout(resolve, 250 * (i + 1)));
}
return null;
}
/**
* A card image for a place, or '' when the imagery cannot be read (a provider
* without tiles, a failed request, imagery the browser will not let a page
* copy).
* @param {object} provider A Cesium ImageryProvider.
* @param {{lat: number, lon: number, range?: number}} cover
* @returns {Promise<string>}
*/
export async function drawThumb(provider, cover) {
try {
const scheme = provider?.tilingScheme;
if (!scheme || typeof provider.requestImage !== 'function') return '';
const level = thumbLevel(cover.range, provider);
const where = Cesium.Cartographic.fromDegrees(cover.lon, cover.lat);
const at = scheme.positionToTileXY(where, level);
if (!at) return '';
const rect = scheme.tileXYToRectangle(at.x, at.y, level);
// Where the place sits inside its tile, 0..1 from the top left.
const u = (where.longitude - rect.west) / rect.width;
const v = (rect.north - where.latitude) / rect.height;
// A 2 × 2 block of tiles with the place in its middle tile quarter.
const x0 = u < 0.5 ? at.x - 1 : at.x;
const y0 = v < 0.5 ? at.y - 1 : at.y;
const nx = scheme.getNumberOfXTilesAtLevel(level);
const ny = scheme.getNumberOfYTilesAtLevel(level);
const size = 256;
const canvas = document.createElement('canvas');
canvas.width = WIDTH;
canvas.height = HEIGHT;
const ctx = canvas.getContext('2d');
if (!ctx) return '';
ctx.fillStyle = '#0b1620';
ctx.fillRect(0, 0, WIDTH, HEIGHT);
// The place's pixel in the block, kept at the card's centre.
const px = (at.x - x0 + u) * size;
const py = (at.y - y0 + v) * size;
const ox = WIDTH / 2 - px;
const oy = HEIGHT / 2 - py;
let drawn = 0;
await Promise.all(
[0, 1].flatMap((dy) =>
[0, 1].map(async (dx) => {
const ty = y0 + dy;
if (ty < 0 || ty >= ny) return;
const tx = (((x0 + dx) % nx) + nx) % nx;
const image = await tile(provider, tx, ty, level);
if (!image) return;
// Cesium hands bitmaps over flipped for the GPU; turn them back.
const flipped =
typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;
const top = oy + dy * size;
if (flipped) {
ctx.save();
ctx.translate(0, top + size);
ctx.scale(1, -1);
ctx.drawImage(image, ox + dx * size, 0, size + 1, size + 1);
ctx.restore();
} else ctx.drawImage(image, ox + dx * size, top, size + 1, size + 1);
drawn += 1;
}),
),
);
if (!drawn) return '';
return canvas.toDataURL('image/jpeg', 0.82);
} catch (error) {
console.warn('Stories: no card image for this story', error);
return '';
}
}
+68
View File
@@ -0,0 +1,68 @@
import '../testSupport/registerDom.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import { drawThumb, thumbLevel } from './thumbs.js';
function fakeProvider(images = true) {
const asked = [];
return {
asked,
tilingScheme: new Cesium.WebMercatorTilingScheme(),
maximumLevel: 10,
requestImage(x, y, level) {
asked.push([x, y, level]);
return Promise.resolve(images ? {} : undefined);
},
};
}
function fakeCanvas(t) {
const drawn = [];
const original = document.createElement.bind(document);
t.mock.method(document, 'createElement', (name) => {
const el = original(name);
if (name === 'canvas') {
el.getContext = () => ({
fillRect() {},
drawImage: (...args) => drawn.push(args),
});
el.toDataURL = () => 'data:image/jpeg;base64,AAAA';
}
return el;
});
return drawn;
}
test('a story’s range picks a zoom level within the provider’s', () => {
assert.equal(thumbLevel(1.6e7, { maximumLevel: 10 }), 1);
assert.equal(thumbLevel(160000, { maximumLevel: 10 }), 8);
assert.equal(thumbLevel(500, { maximumLevel: 10 }), 10);
});
test('a card is drawn from the 2 × 2 tiles around the place', async (t) => {
const drawn = fakeCanvas(t);
const provider = fakeProvider();
const url = await drawThumb(provider, {
lat: 28.05,
lon: 85.6,
range: 160000,
});
assert.equal(url, 'data:image/jpeg;base64,AAAA');
assert.equal(provider.asked.length, 4);
assert.ok(provider.asked.every(([, , level]) => level === 8));
assert.equal(drawn.length, 4);
});
test('no imagery, no card: the placeholder stays', async (t) => {
fakeCanvas(t);
t.mock.timers.enable({ apis: ['setTimeout'] });
const provider = fakeProvider(false);
const pending = drawThumb(provider, { lat: 0, lon: 0, range: 1.6e7 });
for (let i = 0; i < 20; i++) {
await Promise.resolve();
t.mock.timers.tick(1000);
}
assert.equal(await pending, '');
assert.equal(await drawThumb({}, { lat: 0, lon: 0 }), '');
});
+1 -1
View File
@@ -9,7 +9,7 @@ const source = readFileSync(new URL('../../index.html', import.meta.url), 'utf8'
test('the standalone document hosts every view once and keeps element ids unique', async () => {
const hosts = [...source.matchAll(/data-gev-view="([^"]+)"/g)].map((match) => match[1]);
// Order is stacking order for fixed elements that share a z-index.
assert.deepEqual(hosts, ['scene-chrome', 'cockpit', 'display-controls', 'command-dock', 'layer-panels', 'context', 'welcome', 'provider-settings', 'intel-hud']);
assert.deepEqual(hosts, ['scene-chrome', 'cockpit', 'display-controls', 'command-dock', 'layer-panels', 'context', 'welcome', 'provider-settings', 'intel-hud', 'stories']);
assert.deepEqual([...hosts].sort(), Object.keys(APPLICATION_VIEWS).sort());
const html = await readApplicationHtml();
const ids = [...html.matchAll(/\sid="([^"]+)"/g)].map((match) => match[1]);
+30 -7
View File
@@ -25,6 +25,8 @@ export class SceneControls {
this.panel = {
running: false,
hasShots: false,
// Whether the selected scene is published to the Stories page.
inStories: false,
disabled: sceneButtonsDisabled(false, false),
status: '',
progress: 0,
@@ -45,10 +47,12 @@ export class SceneControls {
this.run('renameShot', sceneId, shotId, title),
load: (sceneId, shotId) => this.run('load', sceneId, shotId),
remove: (sceneId, shotId) => this.deleteShot(sceneId, shotId),
selectScene: (sceneId) => this.run('selectScene', sceneId),
create: () => this.createScene(),
deleteScene: () => this.deleteSelectedScene(),
capture: () => this.run('capture'),
stories: () => this.run('stories'),
thumb: () => this.run('thumb'),
tag: (tag) => this.run('tag', tag),
capture: () => this.captureShot(),
update: () => this.run('update'),
next: () => this.run('next'),
export: () => this.run('export'),
@@ -59,7 +63,7 @@ export class SceneControls {
this.run(this.actions.reviewImport ? 'reviewImport' : 'import', file),
});
this.presentPanel({});
// Scene and shot titles are shown translated; the select and the list
// Scene and shot titles are shown translated; the scene name and the list
// show them again.
this.offLocale = onLocaleChange(() => {
this.presentPanel({ playLabel: t('PLAY', { context: 'scene' }) });
@@ -92,6 +96,7 @@ export class SceneControls {
'scene-created',
'scene-deleted',
'project-imported',
'story-details-changed',
].includes(type)
)
this.renderSceneSelect();
@@ -123,6 +128,8 @@ export class SceneControls {
'shot-captured',
'shot-deleted',
'project-imported',
'stories-changed',
'story-details-changed',
].includes(type)
)
this.setButtons(state.running);
@@ -165,18 +172,32 @@ export class SceneControls {
}
}
/** Publish the project to the SceneOptions and SceneShotList views. */
/** Publish the project to the scene name and the SceneShotList view. */
renderSceneSelect() {
if (!this.destroyed) this.store.publishOptions(this.read());
if (!this.destroyed) this.store.publish(this.read());
}
/** NEW SCENE: ask for a name and create the scene. @returns {boolean} */
createScene() {
if (this.destroyed) return;
if (this.destroyed) return false;
const name = window.prompt(
t('New scene name'),
t('Scene {n}', { n: this.read().scenes.length + 1 }),
);
if (name) this.run('create', name);
if (!name) return false;
this.run('create', name);
return true;
}
/** CAPTURE SHOT; with no scene it starts one first, as NEW SCENE does. */
captureShot() {
if (this.destroyed) return;
const state = this.read();
const hasScene = state.scenes.some(
(scene) => scene.id === state.selectedSceneId,
);
if (!hasScene && !this.createScene()) return;
this.run('capture');
}
deleteSelectedScene() {
@@ -221,8 +242,10 @@ export class SceneControls {
this.presentPanel({
running: !!running,
hasShots: shots.length > 0,
inStories: scene?.stories === true,
disabled: sceneButtonsDisabled(running, state.hasRun, {
hasScene: !!scene,
sceneShots: shots.length,
// PLAY and NEXT run on into the following scenes.
playableShots: (state.scenes ?? []).reduce(
(total, item) => total + (item.shots?.length ?? 0),
+286 -23
View File
@@ -37,7 +37,7 @@ function fixture() {
const byId = (id) => document.getElementById(id);
const elements = {
panel: byId('scene-panel'),
select: byId('scene-select'),
name: byId('scene-name'),
new: byId('scene-new-btn'),
delete: byId('scene-delete-btn'),
capture: byId('scene-capture-btn'),
@@ -49,6 +49,8 @@ function fixture() {
import: byId('scene-import-btn'),
file: byId('scene-import-file'),
download: byId('scene-download-btn'),
stories: byId('scene-stories-btn'),
thumb: byId('scene-thumb-btn'),
status: byId('scene-status'),
progress: byId('scene-progress-fill'),
runtime: byId('scene-runtime'),
@@ -78,11 +80,13 @@ function fixture() {
const calls = [];
const actions = Object.fromEntries(
[
'selectScene',
'selectShot',
'renameShot',
'create',
'deleteScene',
'stories',
'thumb',
'tag',
'capture',
'update',
'start',
@@ -110,6 +114,8 @@ function fixture() {
document,
/** The first shot row's label, once the view has rendered. */
label: () => elements.shots.children[0]?.children[0].children[0],
/** The Stories tag chips, in STORY_TAGS order. */
chips: () => [...document.querySelectorAll('.scene-tag-chip')],
restore() {
owner.destroy();
view.unmount();
@@ -122,8 +128,8 @@ test('Scene controls render the supplied selection and running/download states',
const f = fixture();
try {
await nextTick();
assert.equal(f.elements.select.children[0].textContent, '<Scene A>');
assert.equal(f.elements.select.value, 'scene-a');
assert.equal(f.elements.name.textContent, '<Scene A>');
assert.equal(document.getElementById('scene-select'), null);
assert.equal(f.label().textContent, '<Shot A>');
assert.equal(
f.elements.shots.children[0].children[1].textContent,
@@ -184,13 +190,23 @@ test('Authoring disables idle actions that would do nothing', async () => {
assert.equal(f.elements.capture.disabled, false);
assert.equal(f.elements.panel.classList.contains('has-shots'), false);
f.state.scenes = [];
// With no scene selected, PLAY and NEXT have nothing to run even when
// another scene has shots; CAPTURE SHOT starts a scene.
f.state.scenes.push({ id: 'scene-b', title: 'B', shots: [{ id: 'b1' }] });
f.state.selectedSceneId = null;
f.state.selectedShotId = null;
f.owner.setButtons(false);
await nextTick();
assert.equal(f.elements.delete.disabled, true);
assert.equal(f.elements.capture.disabled, true);
assert.equal(f.elements.capture.disabled, false);
assert.equal(f.elements.new.disabled, false);
assert.equal(f.elements.start.disabled, true);
assert.equal(f.elements.next.disabled, true);
assert.equal(f.elements.update.disabled, true);
assert.equal(f.elements.stories.disabled, true);
assert.equal(f.elements.thumb.disabled, true);
assert.ok(f.chips().every((chip) => chip.disabled));
assert.equal(f.elements.export.disabled, false);
} finally {
f.restore();
}
@@ -394,6 +410,7 @@ test('the real director preserves a selected shot label for the following double
},
});
director = new SceneDirector({ camera: { cancelFlight() {} } }, {}, {});
director.selectShot('scene-a');
await nextTick();
const label = f.label();
label.click();
@@ -415,6 +432,67 @@ test('the real director preserves a selected shot label for the following double
}
});
test('the real director names the scene it selects and saves it to Stories', async () => {
const f = fixture();
const previousStorage = globalThis.localStorage;
let saved = null;
let director;
try {
f.owner.destroy();
f.state.scenes.push({ id: 'scene-b', title: 'Scene B', shots: [] });
Object.defineProperty(globalThis, 'localStorage', {
configurable: true,
writable: true,
value: {
getItem: () => JSON.stringify({ version: 3, scenes: f.state.scenes }),
setItem: (_key, value) => {
saved = JSON.parse(value);
},
},
});
director = new SceneDirector({ camera: { cancelFlight() {} } }, {}, {});
await nextTick();
// Nothing is selected on load.
assert.equal(f.elements.name.textContent, 'No scene yet');
assert.equal(
f.elements.shots.querySelectorAll('.scene-shot-row').length,
0,
);
director.selectShot('scene-a');
await nextTick();
assert.equal(f.elements.name.textContent, '<Scene A>');
assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES');
f.elements.stories.click();
await nextTick();
assert.equal(saved.scenes[0].stories, true);
assert.equal(f.elements.status.textContent, 'Saved to Stories');
assert.equal(f.elements.stories.textContent, 'REMOVE FROM STORIES');
// Stories' "Open in GEV" selects programmatically; the name follows.
assert.equal(director.selectShot('scene-b'), true);
await nextTick();
assert.equal(f.elements.name.textContent, 'Scene B');
assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES');
assert.equal(f.elements.stories.disabled, true);
director.selectShot('scene-a');
await nextTick();
f.elements.stories.click();
await nextTick();
assert.equal(Object.hasOwn(saved.scenes[0], 'stories'), false);
assert.equal(f.elements.status.textContent, 'Removed from Stories');
assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES');
} finally {
await director?.destroy();
Object.defineProperty(globalThis, 'localStorage', {
configurable: true,
writable: true,
value: previousStorage,
});
f.restore();
}
});
test('inline shot names save on Enter, cancel on Escape, and reject blank names', async () => {
const f = fixture();
const key = (name) => new KeyboardEvent('keydown', { key: name });
@@ -477,40 +555,63 @@ test('a rename keeps typed text across republishing and ends with its scene', as
}
});
test('the scene select follows option renders, as before', async () => {
test('the read-only scene name follows the selected scene', async () => {
const f = fixture();
try {
await nextTick();
f.state.scenes.push({ id: 'scene-b', title: 'B', shots: [] });
f.state.selectedSceneId = 'scene-b';
f.owner.renderSceneSelect();
await nextTick();
f.state.selectedSceneId = 'scene-b';
assert.equal(f.elements.name.textContent, 'B');
assert.equal(f.elements.name.classList.contains('scene-name-empty'), false);
f.state.scenes = [];
f.state.selectedSceneId = null;
f.owner.renderShotList();
await nextTick();
assert.equal(f.elements.select.value, 'scene-a');
f.owner.renderSceneSelect();
await nextTick();
assert.equal(f.elements.select.value, 'scene-b');
assert.equal(f.elements.name.textContent, 'No scene yet');
assert.equal(f.elements.name.classList.contains('scene-name-empty'), true);
} finally {
f.restore();
}
});
test('an option render restores the published scene after a local pick', async () => {
test('SAVE TO STORIES follows the scene flag and needs a shot', async () => {
const f = fixture();
try {
f.state.scenes.push({ id: 'scene-b', title: 'B', shots: [] });
f.owner.renderSceneSelect();
f.owner.destroy();
const channel = createStateChannel(() => f.state);
const owner = new SceneControls({
read: () => f.state,
actions: f.actions,
subscribe: (listener) => channel.subscribe(listener),
});
await nextTick();
assert.equal(f.elements.select.value, 'scene-a');
// The person picks B; the owner re-renders the shot list only.
f.elements.select.value = 'scene-b';
f.owner.renderShotList();
assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES');
assert.equal(f.elements.stories.disabled, false);
f.elements.stories.click();
assert.deepEqual(f.calls, [['stories']]);
f.state.scenes[0].stories = true;
channel.publish({ type: 'stories-changed' });
await nextTick();
// Something reloads A and renders the options with the same choice.
f.owner.renderSceneSelect();
assert.equal(f.elements.stories.textContent, 'REMOVE FROM STORIES');
assert.equal(useSceneStore(applicationPinia()).panel.inStories, true);
delete f.state.scenes[0].stories;
f.state.scenes[0].shots = [];
channel.publish({ type: 'shot-deleted' });
await nextTick();
assert.equal(f.elements.select.value, 'scene-a');
assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES');
assert.equal(f.elements.stories.disabled, true);
f.state.scenes[0].shots = [{ id: 'shot-a' }];
f.state.running = true;
channel.publish({ type: 'buttons-changed' });
await nextTick();
assert.equal(f.elements.stories.disabled, true, 'off while playing');
owner.destroy();
channel.destroy();
} finally {
f.restore();
}
@@ -601,7 +702,8 @@ test('Authoring refreshes idle buttons from published changes', async () => {
channel.publish({ type: 'scene-deleted' });
await nextTick();
assert.equal(disabled('delete'), true);
assert.equal(disabled('capture'), true);
assert.equal(disabled('capture'), false);
assert.equal(disabled('thumb'), true);
assert.equal(disabled('new'), false);
f.state.scenes = [{ id: 'scene-b', title: 'B', shots: [{ id: 's' }] }];
@@ -666,3 +768,164 @@ test('IMPORT clears its chooser only once the import settles, and is inert witho
f.restore();
}
});
test('CAPTURE SHOT with no scene asks for a name, creates the scene, then captures', async () => {
const f = fixture();
try {
f.state.selectedSceneId = null;
f.state.selectedShotId = null;
f.owner.renderSceneSelect();
f.owner.setButtons(false);
await nextTick();
assert.equal(f.elements.name.textContent, 'No scene yet');
let asked = 0;
window.prompt = () => (asked++ ? null : 'Harbour');
f.elements.capture.click();
assert.deepEqual(f.calls, [['create', 'Harbour'], ['capture']]);
// Cancelling the name captures nothing.
f.elements.capture.click();
assert.equal(asked, 2);
assert.equal(f.calls.length, 2);
// With a scene, CAPTURE SHOT captures straight away.
f.state.selectedSceneId = 'scene-a';
f.elements.capture.click();
assert.deepEqual(f.calls.at(-1), ['capture']);
assert.equal(asked, 2);
} finally {
f.restore();
}
});
test('Stories tag chips and THUMBNAIL follow the current scene', async () => {
const f = fixture();
try {
await nextTick();
const chips = f.chips();
assert.deepEqual(
chips.map((chip) => chip.textContent),
[
'Floods',
'Wildfires',
'Storms',
'Earthquakes',
'Flights',
'Maritime',
'Space',
'Conflict',
'Infrastructure',
'Climate',
],
);
assert.ok(
chips.every((chip) => chip.getAttribute('aria-pressed') === 'false'),
);
assert.ok(chips.every((chip) => !chip.disabled));
assert.equal(f.elements.thumb.disabled, false);
assert.equal(document.getElementById('scene-thumb-preview'), null);
chips[2].click();
f.elements.thumb.click();
assert.deepEqual(f.calls, [['tag', 'Storms'], ['thumb']]);
// The owner publishes fresh scene copies, as the director's read() does.
f.state.scenes[0] = {
...f.state.scenes[0],
storyTags: ['Storms'],
storyThumb: 'data:image/jpeg;base64,AAAA',
};
f.owner.renderSceneSelect();
await nextTick();
assert.equal(f.chips()[2].getAttribute('aria-pressed'), 'true');
assert.equal(f.chips()[2].classList.contains('active'), true);
const preview = document.getElementById('scene-thumb-preview');
assert.equal(preview.getAttribute('src'), 'data:image/jpeg;base64,AAAA');
// At five tags, only the chips already on stay available.
f.state.scenes[0] = {
...f.state.scenes[0],
storyTags: ['Floods', 'Wildfires', 'Storms', 'Earthquakes', 'Flights'],
};
f.owner.renderSceneSelect();
await nextTick();
assert.deepEqual(
f.chips().map((chip) => chip.disabled),
[false, false, false, false, false, true, true, true, true, true],
);
// A run turns them off with the other authoring actions.
f.owner.setButtons(true);
await nextTick();
assert.equal(f.elements.thumb.disabled, true);
assert.ok(f.chips().every((chip) => chip.disabled));
} finally {
f.restore();
}
});
test('the real director captures into a new scene from an empty panel', async () => {
const f = fixture();
const previousStorage = globalThis.localStorage;
let saved = null;
let director;
try {
f.owner.destroy();
Object.defineProperty(globalThis, 'localStorage', {
configurable: true,
writable: true,
value: {
getItem: () => JSON.stringify({ version: 3, scenes: f.state.scenes }),
setItem: (_key, value) => {
saved = JSON.parse(value);
},
},
});
director = new SceneDirector(
{ camera: { cancelFlight() {} } },
{
getCameraState: () => ({
lat: 1,
lon: 2,
alt: 3000,
heading: 0,
pitch: -40,
roll: 0,
}),
getVisualState: () => ({ style: 'normal' }),
},
{ getAll: () => [], getLayerParams: () => null },
);
await nextTick();
assert.equal(f.elements.name.textContent, 'No scene yet');
window.prompt = () => 'Harbour';
f.elements.capture.click();
await nextTick();
assert.equal(f.elements.name.textContent, 'Harbour');
assert.equal(saved.scenes.at(-1).title, 'Harbour');
assert.equal(saved.scenes.at(-1).shots.length, 1);
assert.equal(
f.elements.shots.querySelectorAll('.scene-shot-row').length,
1,
);
assert.equal(f.elements.thumb.disabled, false);
f.chips()[0].click();
await nextTick();
assert.deepEqual(saved.scenes.at(-1).storyTags, ['Floods']);
assert.equal(f.chips()[0].getAttribute('aria-pressed'), 'true');
// Deleting it goes back to no scene.
window.confirm = () => true;
f.elements.delete.click();
await nextTick();
assert.equal(f.elements.name.textContent, 'No scene yet');
assert.equal(f.elements.delete.disabled, true);
} finally {
await director?.destroy();
Object.defineProperty(globalThis, 'localStorage', {
configurable: true,
writable: true,
value: previousStorage,
});
f.restore();
}
});
+23 -9
View File
@@ -50,38 +50,52 @@ export function describeShot(shot) {
/**
* While a scene plays, the authoring and file actions here are off and STOP
* is on. Otherwise a button is off when it would do nothing: DELETE and
* CAPTURE SHOT without a scene, UPDATE SHOT without a selected shot, PLAY and
* NEXT when no scene in the project has a shot (both continue into the
* following scenes).
* is on. Otherwise a button is off when it would do nothing: DELETE, SAVE TO
* STORIES, THUMBNAIL and the tag chips without a scene, UPDATE SHOT
* without a selected shot, SAVE TO STORIES when the scene has no shot, PLAY
* and NEXT without a scene or when no scene in the project has a shot (both
* continue into the following scenes). CAPTURE SHOT without a scene starts
* one. EDIT DETAILS (which needs a shot) and SHARE SCENE keep their own
* checks during playback.
*/
export function sceneButtonsDisabled(
running,
hasRun,
{ hasScene = true, playableShots = 1, hasSelectedShot = true } = {},
{
hasScene = true,
sceneShots = 1,
playableShots = 1,
hasSelectedShot = true,
} = {},
) {
const idleOff = {
delete: !hasScene,
capture: !hasScene,
stories: !hasScene || sceneShots === 0,
thumb: !hasScene,
tags: !hasScene,
update: !hasSelectedShot,
start: playableShots === 0,
next: playableShots === 0,
start: !hasScene || playableShots === 0,
next: !hasScene || playableShots === 0,
};
const disabled = {};
for (const name of [
'start',
'next',
'select',
'new',
'delete',
'capture',
'update',
'thumb',
'tags',
'stories',
'export',
'import',
])
disabled[name] = running || !!idleOff[name];
disabled.stop = !running;
disabled.download = !hasRun;
disabled.details = !hasScene || !hasSelectedShot;
disabled.share = !hasScene;
return disabled;
}
+13 -22
View File
@@ -1,5 +1,5 @@
import { defineStore } from 'pinia';
import { markRaw, shallowRef } from 'vue';
import { computed, markRaw, shallowRef } from 'vue';
/**
* @typedef {object} SceneRowHandlers
@@ -7,10 +7,10 @@ import { markRaw, shallowRef } from 'vue';
* @property {(sceneId: string, shotId: string, title: string) => void} rename
* @property {(sceneId: string, shotId: string) => void} load
* @property {(sceneId: string, shotId: string) => void} remove
* @property {(sceneId: string) => void} selectScene The select's choice.
* @property {(file: File) => Promise<void>|void} importFile A chosen file.
* @property {() => void} create, deleteScene, capture, update, start, stop,
* next, export, download The panel's buttons.
* @property {() => void} create, deleteScene, stories, thumb, capture, update,
* start, stop, next, export, download The panel's buttons.
* @property {(tag: string) => void} tag A Stories tag chip.
*/
/**
@@ -23,15 +23,15 @@ export const useSceneStore = defineStore('gev-scenes', () => {
const scenes = shallowRef(markRaw([]));
const selectedSceneId = shallowRef(null);
const selectedShotId = shallowRef(null);
// The select's choice, updated only when its options are rendered.
const listedSceneId = shallowRef(null);
// Counts option renders: each one re-applies the select's choice, which
// the person may have changed since.
const listedRevision = shallowRef(0);
/** The scene being edited, whose name the panel shows, or null. */
const currentScene = computed(
() =>
scenes.value.find((scene) => scene.id === selectedSceneId.value) ?? null,
);
/**
* The panel's buttons, status line, progress and runtime chip:
* `{running, hasShots, disabled: {[button]: boolean}, status, progress,
* runtime, playLabel}`, or null until an owner presents them.
* `{running, hasShots, inStories, disabled: {[button]: boolean}, status,
* progress, runtime, playLabel}`, or null until an owner presents them.
*/
const panel = shallowRef(null);
@@ -63,13 +63,6 @@ export const useSceneStore = defineStore('gev-scenes', () => {
selectedShotId.value = state.selectedShotId ?? null;
}
/** Publish the project and the select's choice. */
function publishOptions(state) {
publish(state);
listedSceneId.value = state.selectedSceneId ?? null;
listedRevision.value++;
}
/** @param {string|null} id */
function selectShot(id) {
selectedShotId.value = id ?? null;
@@ -83,7 +76,7 @@ export const useSceneStore = defineStore('gev-scenes', () => {
if (token !== owner) return;
owner = null;
attached.value = false;
publishOptions({});
publish({});
}
/** @returns {boolean} Whether `token` is the owner presenting now. */
@@ -104,14 +97,12 @@ export const useSceneStore = defineStore('gev-scenes', () => {
scenes,
selectedSceneId,
selectedShotId,
listedSceneId,
listedRevision,
currentScene,
attached,
panel,
publishPanel,
attach,
publish,
publishOptions,
selectShot,
detach,
owns,
+83
View File
@@ -0,0 +1,83 @@
import { defineStore } from 'pinia';
import { markRaw } from 'vue';
/**
* What the Stories view shows. The controller (src/stories/controller.js)
* owns the globe, the players and the URL; it connects here and the view's
* controls reach it through `controller`.
*/
export const useStoriesStore = defineStore('stories', {
state: () => ({
/** 'closed' | 'explore' | 'story' */
mode: 'closed',
storyId: null,
/** Explore */
query: '',
chips: [],
sort: 'new',
filters: { region: [], length: [] },
picked: null,
pins: [],
feedSnap: 'split',
/** Story */
/** Story card images by story id (none yet: cards show a placeholder). */
thumbs: {},
playback: {
wallMs: 0,
worldMs: null,
durationMs: 0,
playing: false,
exploring: false,
chapterIndex: 0,
},
/** The big Play button over a story that opened paused. */
bigPlay: false,
camera: { lat: 0, lon: 0, altKm: 0 },
muted: true,
expanded: false,
/** Context panel shown over the map while expanded (desktop). */
ctxOpen: false,
/** Phone context sheet: 'peek' | 'half' | 'full' */
sheet: 'peek',
/** Width the person dragged the context panel to; 0 is the default. */
contextWidth: 0,
/** Hints and toasts */
hint: '',
toast: '',
hostedToast: null,
popSeen: false,
hintSeen: false,
sheetHintSeen: false,
controller: null,
/** False where Stories is not offered (GEV embedded inline in a host page). */
available: true,
/** Every story Explore lists, as the controller publishes them. */
stories: [],
}),
getters: {
byId: (state) => (id) => state.stories.find((s) => s.id === id) ?? null,
},
actions: {
connect(controller, stories = []) {
this.controller = markRaw(controller);
this.stories = markRaw(stories);
},
flashHint(text, ms = 1600) {
this.hint = text;
clearTimeout(hintTimer);
hintTimer = setTimeout(() => {
if (this.hint === text) this.hint = '';
}, ms);
},
flashToast(text, ms = 2200) {
this.toast = text;
clearTimeout(toastTimer);
toastTimer = setTimeout(() => {
if (this.toast === text) this.toast = '';
}, ms);
},
},
});
let hintTimer = 0;
let toastTimer = 0;
+136
View File
@@ -0,0 +1,136 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
import { creditPlacement, entryPlacement } from '../stories/format.js';
const css = readFileSync(
new URL('./styles/stories.css', import.meta.url),
'utf8',
).replace(/\/\*[\s\S]*?\*\//g, '');
const view = readFileSync(
new URL('./views/StoriesView.vue', import.meta.url),
'utf8',
);
/** Every declaration block in stories.css whose selector names the credit line. */
function creditBlocks() {
const blocks = [];
const re = /([^{}]+)\{([^{}]*)\}/g;
for (let m; (m = re.exec(css));) {
if (m[1].includes('#cesium-credits'))
blocks.push({ selector: m[1].trim(), body: m[2] });
}
return blocks;
}
test('Stories never hides GEV’s required credit line', () => {
const blocks = creditBlocks();
assert.ok(blocks.length > 0, 'Stories places the credit line');
for (const { selector, body } of blocks) {
assert.doesNotMatch(
body,
/\b(display\s*:\s*none|visibility\s*:\s*hidden|opacity\s*:\s*0(?![.\d]))/,
selector,
);
}
// The rule that hides GEV's chrome while Stories is open exempts the credit.
assert.match(
css,
/body\.stories-mode\s*>\s*:not\([^)]*\[id='cesium-credits'\]/,
);
});
test('a playing scene’s recording mode cannot move the credit under the timeline', () => {
const placement = creditBlocks().find(
({ selector, body }) =>
/^body\.stories-mode:not\(#gs-a\):not\(#gs-b\)\s+#cesium-credits$/.test(
selector,
) && /bottom\s*:/.test(body),
);
assert.ok(placement, 'Stories pins the credit line');
// Two ids outrank body.recording-mode #cesium-credits and the phone shell's
// !important rule (one id each), so the measured place holds while playing.
assert.match(
placement.body,
/bottom:\s*var\(--gs-credit-bottom,\s*\d+px\)\s*!important/,
);
assert.match(
placement.body,
/left:\s*var\(--gs-credit-left,\s*\d+px\)\s*!important/,
);
});
test('the measured place keeps the credit inside the map and on screen', () => {
const rect = (left, top, right, bottom) => ({
left,
top,
right,
bottom,
width: right - left,
height: bottom - top,
});
// Story, desktop: the map ends 80 px above the window's bottom (timeline).
assert.deepEqual(
creditPlacement({ map: rect(0, 60, 1200, 720), width: 1200, height: 800 }),
{ bottom: 86, left: 24 },
);
// Explore, desktop: the feed covers the map's left, so the credit clears it.
assert.deepEqual(
creditPlacement({
map: rect(0, 0, 1200, 800),
feed: rect(0, 60, 420, 800),
width: 1200,
height: 800,
}),
{ bottom: 6, left: 434 },
);
// Explore, phone: the feed is a sheet below the map, not beside it.
assert.deepEqual(
creditPlacement({
map: rect(0, 0, 390, 360),
feed: rect(0, 360, 390, 844),
width: 390,
height: 844,
}),
{ bottom: 490, left: 10 },
);
// A map taller than the window never pushes the credit off screen.
assert.equal(
creditPlacement({ map: rect(0, 0, 800, 900), width: 800, height: 700 })
.bottom,
6,
);
// No map (Stories closing): GEV's own placement applies.
assert.equal(creditPlacement({ map: null, width: 800, height: 700 }), null);
// Closing Stories hands the credit back to GEV.
assert.match(view, /root\.removeProperty\('--gs-credit-bottom'\)/);
assert.match(view, /root\.removeProperty\('--gs-credit-left'\)/);
});
test('the Stories button sits left of whatever is in the top-right corner', () => {
const box = (left, top, width, height) => ({
left,
top,
width,
height,
right: left + width,
bottom: top + height,
});
// GEV: the ACTIVE STYLE readout.
assert.deepEqual(entryPlacement([box(1700, 24, 220, 60), undefined], 1960), {
top: 24,
right: 270,
});
// GEV Hosted: the account avatar beside the readout; the leftmost wins.
assert.deepEqual(
entryPlacement([box(1650, 24, 220, 60), box(1898, 22, 38, 38)], 1960),
{ top: 24, right: 320 },
);
// Hosted with the readout hidden: the avatar alone.
assert.deepEqual(
entryPlacement([box(0, 0, 0, 0), box(1898, 22, 38, 38)], 1960),
{ top: 22, right: 72 },
);
// Nothing there yet.
assert.deepEqual(entryPlacement([null, null], 1960), { top: 14, right: 14 });
});
+2 -2
View File
@@ -92,8 +92,8 @@ test('SCENES actions stay on one line in English', () => {
.length,
0,
);
const [select] = unguardedRules(css('scenes.css'), '#scene-select');
assert.equal(declaration(select, 'white-space'), undefined);
const [name] = unguardedRules(css('scenes.css'), '#scene-name');
assert.equal(declaration(name, 'white-space'), undefined);
});
test('Display and parameter rows keep their English layout', () => {
+65 -10
View File
@@ -162,21 +162,19 @@
flex-wrap: wrap;
}
/* The scene's name takes its own row; NEW SCENE / DELETE share the next. */
#scene-select {
/* The scene being edited, read-only, takes its own row; NEW SCENE / DELETE
share the next. A long name wraps. */
#scene-name {
flex: 1 1 100%;
min-width: 0;
min-height: 32px;
margin: 0;
font-size: 12px;
line-height: 1.4;
overflow-wrap: anywhere;
}
html:not([lang='en']) #scene-select {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: var(--font-mono);
font-size: 10px;
letter-spacing: 0.04em;
#scene-name.scene-name-empty {
color: var(--scene-quiet);
}
/* A translated action longer than its button wraps inside the button instead
@@ -244,6 +242,63 @@ html:not([lang='en']) #scene-panel .scene-controls .scene-btn {
background: color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Stories tags: small toggle chips that wrap; a pressed chip takes the
accent. */
#scene-panel .scene-tag-chips {
gap: 4px;
}
#scene-panel .scene-tag-chip {
flex: 0 0 auto;
padding: 3px 8px;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 999px;
background: transparent;
color: var(--scene-quiet);
font-size: 10px;
line-height: 1.3;
cursor: pointer;
}
#scene-panel .scene-tag-chip.active {
color: var(--accent);
border-color: color-mix(in srgb, var(--accent) 55%, transparent);
background: color-mix(in srgb, var(--accent) 12%, transparent);
}
#scene-panel .scene-tag-chip:disabled {
opacity: 0.4;
cursor: default;
}
/* The Stories card thumbnail, CAPTURE THUMBNAIL and SAVE TO STORIES share a
row; the preview keeps the card's 16:9. */
#scene-panel .scene-story-controls {
align-items: center;
}
/* Two buttons beside the preview: a label that does not fit (REMOVE FROM
STORIES) wraps inside its button, in English too. */
#scene-panel .scene-story-controls .scene-btn {
align-self: stretch;
padding: 8px 6px;
white-space: normal;
overflow-wrap: break-word;
}
.scene-thumb-preview {
flex: 0 0 64px;
width: 64px;
height: 36px;
border-radius: 3px;
object-fit: cover;
}
.scene-thumb-empty {
border: 1px dashed rgba(255, 255, 255, 0.18);
box-sizing: border-box;
}
.scene-shot-hint {
margin: 0 0 8px;
font-size: 11px;
+243
View File
@@ -0,0 +1,243 @@
/* Stories, closed: the Stories button, its first-visit popup and the
back-to-story toast, which every GEV page shows. The rest of Stories'
styles (stories.css) load with Stories itself. */
/* Ported from the GEV Stories prototype (gev-stories-real-globe.html), scoped to #gev-stories. */
#gev-stories {
--bg-dark: #0a0a0f;
--glass-bg: rgba(12, 12, 20, 0.72);
--glass-strong: rgba(14, 14, 24, 0.9);
--glass-border: rgba(255, 255, 255, 0.08);
--glass-border-hover: rgba(255, 255, 255, 0.15);
--accent: #00d4ff;
--accent-dim: rgba(0, 212, 255, 0.15);
--accent-glow: rgba(0, 212, 255, 0.4);
--text-primary: #e8eaed;
--text-secondary: rgba(232, 234, 237, 0.64);
--text-dim: rgba(232, 234, 237, 0.42);
--menu-bg: #12121c;
--warn: #ffb45a;
--live: #ff4d4d;
--cable: #a9b8ff;
--font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--panel-radius: 16px;
--btn-radius: 10px;
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
--review-h: 46px;
color-scheme: dark;
}
#gev-stories {
background: #050508;
color: var(--text-primary);
font-family: var(--font-sans);
font-size: 14px;
line-height: 1.45;
overflow: hidden;
}
#gev-stories .glass {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
}
#gev-stories .tbtn {
height: 38px;
padding: 0 14px;
border-radius: var(--btn-radius);
display: inline-flex;
align-items: center;
gap: 8px;
border: 1px solid var(--glass-border);
background: var(--glass-bg);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
font: 500 12px var(--font-mono);
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-primary);
white-space: nowrap;
transition:
border-color var(--transition-fast),
background var(--transition-fast);
}
#gev-stories .tbtn:hover {
border-color: var(--glass-border-hover);
}
#gev-stories .tbtn svg {
width: 16px;
height: 16px;
flex: none;
}
#gev-stories .tbtn.accent {
border-color: rgba(0, 212, 255, 0.55);
color: var(--accent);
background: rgba(0, 212, 255, 0.08);
box-shadow: 0 0 18px -6px var(--accent-glow);
}
#gev-stories .tbtn.accent:hover {
background: rgba(0, 212, 255, 0.14);
}
#gev-stories .tbtn.solid {
background: var(--accent);
color: #001820;
border-color: transparent;
font-weight: 600;
}
#gev-stories .h-pop {
position: absolute;
z-index: 9;
top: 84px;
right: 74px;
width: 300px;
padding: 16px;
border-radius: var(--panel-radius);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
animation: gsx-popIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
#gev-stories .h-pop::before {
content: '';
position: absolute;
top: -7px;
right: 60px;
width: 12px;
height: 12px;
background: var(--glass-strong);
border-left: 1px solid var(--glass-border);
border-top: 1px solid var(--glass-border);
transform: rotate(45deg);
}
#gev-stories .h-pop {
background: var(--glass-strong);
}
#gev-stories .h-pop .k {
font: 600 11px var(--font-mono);
letter-spacing: 0.16em;
color: var(--accent);
}
#gev-stories .h-pop h2 {
font-size: 17px;
margin: 4px 0 6px;
}
#gev-stories .h-pop p {
color: var(--text-secondary);
font-size: 13px;
}
#gev-stories .h-pop .row {
display: flex;
gap: 8px;
margin-top: 12px;
}
#gev-stories .h-toast {
position: absolute;
z-index: 9;
left: 50%;
bottom: 96px;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 12px;
padding: 10px 10px 10px 16px;
border-radius: 14px;
background: rgba(12, 12, 20, 0.92);
border: 1px solid rgba(0, 212, 255, 0.35);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
animation: gsx-popIn 0.25s ease;
max-width: calc(100% - 28px);
}
#gev-stories .h-toast[hidden] {
display: none;
}
#gev-stories .h-toast b {
font: 600 11px var(--font-mono);
letter-spacing: 0.16em;
text-transform: uppercase;
color: var(--accent);
white-space: nowrap;
}
#gev-stories .h-toast span {
font-size: 13px;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
#gev-stories .h-toast .tbtn {
height: 32px;
flex: none;
}
/* The root only hosts fixed layers; it takes no room of its own. */
#gev-stories {
position: static;
height: 0 !important;
overflow: visible !important;
background: none !important;
}
/* GEV: the Stories entry sits in GEV's top-right row. */
#gev-stories .gs-entry {
position: fixed;
z-index: 1200;
height: 36px;
font: 600 11px var(--font-mono);
letter-spacing: 0.1em;
text-transform: uppercase;
}
#gev-stories .gs-entry svg {
width: 17px;
height: 17px;
}
body:has(#loading-screen:not(.hidden)) #gev-stories .gs-entry,
body:has(#loading-screen:not(.hidden)) #gev-stories .gs-pop,
body.recording-mode #gev-stories .gs-entry,
body.recording-mode #gev-stories .gs-pop,
body.ui-clean-view #gev-stories .gs-entry,
body.ui-clean-view #gev-stories .gs-pop {
display: none;
}
#gev-stories .gs-pop {
position: fixed;
z-index: 1201;
left: auto;
}
#gev-stories .gs-hosted-toast {
position: fixed;
z-index: 1201;
bottom: 110px;
}
@media (max-width: 700px) {
#gev-stories .gs-pop {
left: 12px;
right: 12px !important;
width: auto;
}
}
/* Shared with the screens' panels (stories.css). */
@keyframes gsx-popIn {
from {
opacity: 0;
transform: translateY(-6px);
}
to {
opacity: 1;
transform: none;
}
}
/* Over a live globe a backdrop blur is redrawn every frame (costly on
software WebGL): the closed-state pieces use a near-opaque fill instead. */
#gev-stories .gs-entry,
#gev-stories .gs-pop,
#gev-stories .gs-hosted-toast {
-webkit-backdrop-filter: none;
backdrop-filter: none;
}
#gev-stories .gs-entry {
background: rgba(6, 24, 34, 0.92);
}
#gev-stories .gs-pop,
#gev-stories .gs-hosted-toast {
background: rgba(12, 12, 20, 0.95);
}
File diff suppressed because it is too large. Load diff
+2
View File
@@ -33,6 +33,8 @@ export function createSurfaceKeyboard({
return;
}
if (event.key !== 'Tab') return;
// Stories covers GEV while it is open: Tab stays in Stories.
if (documentRef.body?.classList?.contains?.('stories-mode')) return;
const order = [
...root.querySelectorAll(
'button, input, [href], [tabindex]:not([tabindex="-1"])',
+20 -6
View File
@@ -5,15 +5,14 @@ import UiButton from '../kit/UiButton.vue';
import RailPanel from '../rail/RailPanel.vue';
import { useSceneSharingStore } from '../stores/sceneSharing.js';
import { useSceneStore } from '../stores/scenes.js';
import { STORY_TAG_LIMIT, STORY_TAGS } from '../../scenes/storyTags.js';
import { vClassToggle } from '../rail/classToggle.js';
import SceneDialog from './panels/SceneDialog.vue';
import SceneOptions from './SceneOptions.vue';
import SceneShotList from './SceneShotList.vue';
import CctvPanel from './panels/CctvPanel.vue';
import StreetLevelPanel from './panels/StreetLevelPanel.vue';
import DrawControls from './panels/DrawControls.vue';
import GeoImport from './panels/GeoImport.vue';
import UiSelect from '../kit/UiSelect.js';
import LayerSectionIndex from './panels/LayerSectionIndex.vue';
import LayerFinder from './panels/LayerFinder.vue';
import DataLibraryBrowse from './panels/DataLibraryBrowse.vue';
@@ -24,8 +23,14 @@ const { toolbar, dialog } = storeToRefs(useSceneSharingStore());
// SceneControls presents the Scene panel's buttons, status and progress and
// answers the buttons through the store.
const scenes = useSceneStore();
const { panel: scene } = storeToRefs(scenes);
const { panel: scene, currentScene } = storeToRefs(scenes);
const off = (name) => scene.value?.disabled[name] ?? false;
// The current scene's Stories tags; a chip not yet on is off at the limit.
const tagOn = (tag) => currentScene.value?.storyTags?.includes(tag) ?? false;
const tagOff = (tag) =>
off('tags') ||
(!tagOn(tag) &&
(currentScene.value?.storyTags?.length ?? 0) >= STORY_TAG_LIMIT);
// The hidden file input is the IMPORT button's chooser, open only while an
// owner presents the panel. It is cleared once the import settles, so the same
// file can be chosen again, unless the owner went away meanwhile.
@@ -69,7 +74,7 @@ async function importChosen(event) {
<RailPanel id="scene-panel" start-collapsed v-class-toggle="{ running: scene?.running, 'has-shots': scene?.hasShots }" :title="t('AUTHORING')" :hint="t('Create and edit scenes')" scroll>
<p class="scene-step-heading">{{ t('SCENE') }}</p>
<div class="scene-controls">
<UiSelect class="gev-field" id="scene-select" :aria-label="t('Scene')" :disabled="off('select')" @update:model-value="scenes.act('selectScene', $event)"><SceneOptions /></UiSelect>
<p id="scene-name" :class="{ 'scene-name-empty': !currentScene }">{{ currentScene?.title ?? t('No scene yet') }}</p>
<UiButton id="scene-new-btn" type="button" :disabled="off('new')" @click="scenes.act('create')" class="gev-action-button scene-btn" :title="t('Start a new, empty scene')">{{ t('NEW SCENE') }}</UiButton>
<UiButton tone="alert" id="scene-delete-btn" type="button" :disabled="off('delete')" @click="scenes.act('deleteScene')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Delete this scene and all of its shots')">{{ t('DELETE') }}</UiButton>
</div>
@@ -87,6 +92,15 @@ async function importChosen(event) {
<UiButton id="scene-next-btn" type="button" :disabled="off('next')" @click="scenes.act('next')" class="gev-action-button scene-btn" :title="t('Play the shot after the selected one, moving on to the next scene when needed')">{{ t('NEXT') }}</UiButton>
</div>
<p class="scene-step-heading">{{ t('SAVE & SHARE') }}</p>
<div class="scene-controls scene-tag-chips" role="group" :aria-label="t('Stories tags')">
<UiButton v-for="tag in STORY_TAGS" :key="tag" type="button" class="scene-tag-chip" :pressed="tagOn(tag)" pressed-class="active" :disabled="tagOff(tag)" @click="scenes.act('tag', tag)">{{ t(tag) }}</UiButton>
</div>
<div class="scene-controls scene-story-controls">
<img v-if="currentScene?.storyThumb" id="scene-thumb-preview" class="scene-thumb-preview" :src="currentScene.storyThumb" :alt="t('Story thumbnail')" width="64" height="36" />
<span v-else class="scene-thumb-preview scene-thumb-empty" aria-hidden="true"></span>
<UiButton id="scene-thumb-btn" type="button" :disabled="off('thumb')" @click="scenes.act('thumb')" class="gev-action-button scene-btn" :title="t('Use the current view as the Stories card image')">{{ t('THUMBNAIL') }}</UiButton>
<UiButton id="scene-stories-btn" type="button" :disabled="off('stories')" @click="scenes.act('stories')" class="gev-action-button scene-btn" :title="scene?.inStories ? t('Take this scene off the Stories page') : t('Show this scene on the Stories page')">{{ scene?.inStories ? t('REMOVE FROM STORIES') : t('SAVE TO STORIES') }}</UiButton>
</div>
<div class="scene-controls scene-file-controls">
<UiButton id="scene-export-btn" type="button" :disabled="off('export')" @click="scenes.act('export')" class="gev-action-button scene-btn" :title="t('Download every scene as a JSON file you can import later')">{{ t('EXPORT') }}</UiButton>
<UiButton id="scene-import-btn" type="button" :disabled="off('import')" @click="chooseImport($refs.sceneFile)" class="gev-action-button scene-btn" :title="t('Load scenes from an exported JSON file')">{{ t('IMPORT') }}</UiButton>
@@ -94,8 +108,8 @@ async function importChosen(event) {
<input ref="sceneFile" type="file" id="scene-import-file" accept="application/json,.json" hidden @change="importChosen" />
</div>
<div v-if="toolbar" data-director-authoring class="scene-controls">
<UiButton type="button" class="gev-action-button scene-btn" :title="t('Edit anchors, data packs and shot details')" @click="toolbar.edit()">{{ t('EDIT DETAILS') }}</UiButton>
<UiButton type="button" class="gev-action-button scene-btn" :title="t('Download this scene as JSON or an asset bundle')" @click="toolbar.share()">{{ t('SHARE SCENE') }}</UiButton>
<UiButton type="button" class="gev-action-button scene-btn" :disabled="off('details')" :title="t('Edit anchors, data packs and shot details')" @click="toolbar.edit()">{{ t('EDIT DETAILS') }}</UiButton>
<UiButton type="button" class="gev-action-button scene-btn" :disabled="off('share')" :title="t('Download this scene as JSON or an asset bundle')" @click="toolbar.share()">{{ t('SHARE SCENE') }}</UiButton>
</div>
<div class="scene-progress">
<div id="scene-progress-fill" :style="scene ? { width: `${scene.progress}%` } : undefined">{{ scene?.progress ?? 0 }}%</div>
-31
View File
@@ -1,31 +0,0 @@
<script setup>
import { storeToRefs } from 'pinia';
import { getCurrentInstance, watch } from 'vue';
import { useSceneStore } from '../stores/scenes.js';
// The Scene select's options; selecting one stays with SceneControls.
const { scenes, listedSceneId, listedRevision } = storeToRefs(useSceneStore());
// Every option render shows the published scene, as the select did before:
// `selected` alone is written only when it changes, so it would leave a
// person's later pick standing.
const instance = getCurrentInstance();
watch(
listedRevision,
() => {
const select = instance.proxy.$el?.parentNode;
if (select && listedSceneId.value) select.value = listedSceneId.value;
},
{ flush: 'post' },
);
</script>
<template>
<option
v-for="scene in scenes"
:key="scene.id"
:value="scene.id"
:selected="scene.id === listedSceneId"
>{{ scene.title }}</option
>
</template>
+337
View File
@@ -0,0 +1,337 @@
<script setup>
import {
computed,
defineAsyncComponent,
nextTick,
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
import { storeToRefs } from 'pinia';
import { t } from '../../i18n/index.js';
import { useStoriesStore } from '../stores/stories.js';
import { GEV_LOGO_SYMBOL } from '../../stories/gevLogo.js';
import { creditPlacement, entryPlacement } from '../../stories/format.js';
import { guardStoriesKeyboard } from '../../stories/keyboard.js';
// The screens, their styles and the story data load with Stories (see
// src/stories/boot.js); only the button, popup and toast load with GEV.
const ExploreScreen = defineAsyncComponent(
() => import('./stories/ExploreScreen.vue'),
);
const StoryScreen = defineAsyncComponent(
() => import('./stories/StoryScreen.vue'),
);
/**
* GEV Stories, as the Stories prototype lays it out: a Stories button in
* GEV's top-right row, Explore (the globe beside the story feed) and the
* Story page. Both show GEV's own Cesium globe through their map areas.
*/
const store = useStoriesStore();
const { mode, storyId, toast, hostedToast } = storeToRefs(store);
const story = computed(() => (storyId.value ? store.byId(storyId.value) : null));
const reduceMotion = () =>
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
// ── Entry: in GEV's top-right row, left of what sits in the corner ──
// GEV has its ACTIVE STYLE readout there; GEV Hosted adds the account
// avatar, which can come after Stories mounts (sign-in).
const CORNER = ['style-indicator', 'account-control'];
const entry = ref({ top: 14, right: 14 });
function placeEntry() {
entry.value = entryPlacement(
CORNER.map((id) => document.getElementById(id)?.getBoundingClientRect()),
innerWidth,
);
}
let entryTries = 0;
let entryTimer = 0;
let cornerObserver = null;
const observed = new Set();
// GEV Hosted moves the corner by body class (signed in, guest) without
// resizing it, which a ResizeObserver does not see.
let bodyObserver = null;
function watchCorner() {
placeEntry();
if (!bodyObserver && globalThis.MutationObserver) {
bodyObserver = new MutationObserver(placeEntry);
bodyObserver.observe(document.body, {
attributes: true,
attributeFilter: ['class'],
});
}
if (globalThis.ResizeObserver) cornerObserver ??= new ResizeObserver(placeEntry);
for (const id of CORNER) {
const el = document.getElementById(id);
if (el && cornerObserver && !observed.has(el)) {
cornerObserver.observe(el);
observed.add(el);
}
}
// Keep looking for a while for a control that mounts late.
if (observed.size < CORNER.length && ++entryTries < 20)
entryTimer = setTimeout(watchCorner, 1000);
}
// ── GEV's required credit line: bottom left of the map, at every size ──
// A playing GEV scene turns on GEV's recording mode, whose rule drops the
// credit to the window's bottom edge, under the Stories timeline. Measure
// the map instead and pin the credit just inside it, playing or not.
let creditSlot = null;
let creditObserver = null;
let creditFrame = 0;
let creditTries = 0;
function placeCredit() {
const root = document.documentElement.style;
const at = creditPlacement({
map: creditSlot?.getBoundingClientRect(),
feed: document.querySelector('#gev-stories .ex-feed')?.getBoundingClientRect(),
width: innerWidth,
height: innerHeight,
});
if (!at) {
root.removeProperty('--gs-credit-bottom');
root.removeProperty('--gs-credit-left');
return;
}
root.setProperty('--gs-credit-bottom', `${at.bottom}px`);
root.setProperty('--gs-credit-left', `${at.left}px`);
}
function watchCredit() {
cancelAnimationFrame(creditFrame);
creditObserver?.disconnect();
creditSlot = null;
if (mode.value === 'closed') {
creditTries = 0;
placeCredit();
return;
}
creditSlot = document.querySelector('#gev-stories .map-slot');
if (!creditSlot) {
if (++creditTries < 120) creditFrame = requestAnimationFrame(watchCredit);
return;
}
creditTries = 0;
placeCredit();
if (globalThis.ResizeObserver) {
creditObserver = new ResizeObserver(placeCredit);
creditObserver.observe(creditSlot);
const feed = document.querySelector('#gev-stories .ex-feed');
if (feed) creditObserver.observe(feed);
}
}
// ── One onboarding popup in GEV ──
const POP_KEY = 'gevStoriesPopSeen';
const popOpen = ref(false);
function readPopSeen() {
try {
return localStorage.getItem(POP_KEY) === '1';
} catch {
return store.popSeen;
}
}
function markPopSeen() {
store.popSeen = true;
popOpen.value = false;
try {
localStorage.setItem(POP_KEY, '1');
} catch {
/* storage off: the popup comes back next visit */
}
}
function openExplore() {
markPopSeen();
store.controller.open();
}
// ── Opened in GEV: a toast that leads back to the story ──
let hostedTimer = 0;
watch(hostedToast, (v) => {
clearTimeout(hostedTimer);
if (v) hostedTimer = setTimeout(() => (hostedToast.value = null), 6000);
});
function backToStory() {
const v = hostedToast.value;
hostedToast.value = null;
if (v) store.controller.openStory(v.id, { atMs: v.atMs });
}
const hostedWhen = computed(() => hostedToast.value?.when ?? '');
// ── Card-to-map morph: Play grows the card into the story; Back folds it home ──
const appEl = ref(null);
const rootEl = ref(null);
let unguardKeys = null;
function ghost(id, rect) {
const g = document.createElement('div');
g.className = 'morph';
// Without a picture the ghost keeps the cards' placeholder look (CSS).
const thumb = store.thumbs?.[id] || '';
if (thumb) g.style.background = `#04070a url("${thumb}") center / cover no-repeat`;
Object.assign(g.style, rect);
appEl.value?.appendChild(g);
return g;
}
const rectOf = (el) => {
const r = el.getBoundingClientRect();
return { left: `${r.left}px`, top: `${r.top}px`, width: `${r.width}px`, height: `${r.height}px` };
};
async function playFromExplore({ id, from }) {
if (reduceMotion() || !from?.offsetWidth) {
store.controller.openStory(id, { autoplay: true });
return;
}
const a = rectOf(from);
const g = ghost(id, a);
store.controller.openStory(id, { autoplay: true });
await nextTick();
const map = document.getElementById('stMap');
if (!map) {
g.remove();
return;
}
const b = rectOf(map);
g.animate(
[
{ ...a, borderRadius: '9px', opacity: 1 },
{ ...b, borderRadius: '0px', opacity: 1, offset: 0.8 },
{ ...b, borderRadius: '0px', opacity: 0 },
],
{ duration: 640, easing: 'cubic-bezier(.2,.9,.2,1)' },
).onfinish = () => g.remove();
}
async function backFromStory() {
const id = storyId.value;
const map = document.getElementById('stMap');
if (reduceMotion() || !map?.offsetWidth) {
store.controller.backToExplore();
return;
}
const a = rectOf(map);
const g = ghost(id, a);
store.picked = id;
store.controller.backToExplore();
await nextTick();
await new Promise((r) => requestAnimationFrame(r));
const card = document.querySelector(`#gev-stories .card[data-id="${CSS.escape(id)}"]`);
card?.scrollIntoView({ block: 'nearest' });
const dst = card?.querySelector('.thumb');
if (!dst?.offsetWidth) {
g.remove();
return;
}
g.animate(
[
{ ...a, borderRadius: '0px', opacity: 1 },
{ ...rectOf(dst), borderRadius: '9px', opacity: 1 },
],
{ duration: 560, easing: 'cubic-bezier(.2,.9,.2,1)' },
).onfinish = () => {
g.remove();
card.classList.remove('flash');
void card.offsetWidth;
card.classList.add('flash');
};
}
// ── Escape closes the topmost open layer, then steps back ──
function onKey(e) {
if (e.key !== 'Escape' || mode.value === 'closed' || e.defaultPrevented) return;
const target = e.target;
if (target?.type === 'search' && target.value) return;
const q = (sel) => document.querySelector(`#gev-stories ${sel}`);
e.preventDefault();
if (q('#exFilter')) q('#exFilterBtn')?.click();
else if (store.ctxOpen) store.ctxOpen = false;
else if (store.expanded) {
store.expanded = false;
store.controller.reframe();
} else if (mode.value === 'story') backFromStory();
else store.controller.close();
}
onMounted(() => {
watchCorner();
addEventListener('resize', placeEntry);
addEventListener('resize', placeCredit);
addEventListener('keydown', onKey, true);
unguardKeys = guardStoriesKeyboard({
root: rootEl.value,
// Until Close has put the view back, too (stories-mode stays till then).
isOpen: () =>
mode.value !== 'closed' ||
document.body.classList.contains('stories-mode'),
});
popOpen.value = !readPopSeen();
watchCredit();
});
onBeforeUnmount(() => {
clearTimeout(entryTimer);
clearTimeout(hostedTimer);
cancelAnimationFrame(creditFrame);
cornerObserver?.disconnect();
bodyObserver?.disconnect();
creditObserver?.disconnect();
creditSlot = null;
placeCredit();
removeEventListener('resize', placeEntry);
removeEventListener('resize', placeCredit);
removeEventListener('keydown', onKey, true);
unguardKeys?.();
});
watch(mode, (m) => {
if (m === 'closed') requestAnimationFrame(placeEntry);
else popOpen.value = false;
});
// Each screen (and each story, keyed) mounts its own map slot.
watch([mode, storyId], () => nextTick(watchCredit));
</script>
<template>
<div id="gev-stories" ref="rootEl">
<svg width="0" height="0" style="position: absolute" aria-hidden="true" v-html="GEV_LOGO_SYMBOL"></svg>
<!-- GEV: the Stories entry, its first-visit popup and the Opened-in-GEV toast -->
<template v-if="mode === 'closed' && store.available">
<button
id="hStories"
class="tbtn accent gs-entry"
type="button"
:style="{ top: `${entry.top}px`, right: `${entry.right}px` }"
@click="openExplore"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="3" /><path d="M10 9.5v5l4.5-2.5z" fill="currentColor" /></svg>
<span>{{ t('Stories') }}</span>
</button>
<div
v-if="popOpen"
id="hPop"
class="h-pop gs-pop"
role="region"
aria-labelledby="hPopT"
:style="{ top: `${entry.top + 52}px`, right: `${Math.max(12, entry.right - 40)}px` }"
>
<span class="k">{{ t('NEW') }}</span>
<h2 id="hPopT">{{ t('GEV Stories') }}</h2>
<p>{{ t('Curated, interactive views of what is happening on Earth. Play one, take over the map whenever you like, then pick the story back up.') }}</p>
<div class="row">
<button class="tbtn solid" type="button" @click="openExplore">{{ t('Browse stories') }}</button>
<button class="tbtn" type="button" @click="markPopSeen">{{ t('Not now') }}</button>
</div>
</div>
<div v-if="hostedToast" id="hToast" class="h-toast glass gs-hosted-toast" role="status">
<b>{{ t('Opened in GEV') }}</b>
<span>{{ hostedToast.title }} · {{ hostedWhen }}</span>
<button class="tbtn" type="button" @click="backToStory">{{ t('Back to story') }}</button>
</div>
</template>
<div v-if="mode !== 'closed'" ref="appEl" class="app">
<ExploreScreen v-if="mode === 'explore'" @play="playFromExplore" />
<StoryScreen v-if="mode === 'story' && story" :key="story.id" :story="story" @back="backFromStory" />
<div v-if="toast" id="uxToast" class="ux-toast" role="status" aria-live="polite">{{ toast }}</div>
</div>
</div>
</template>
+2
View File
@@ -10,6 +10,7 @@ import CockpitView from './CockpitView.vue';
import SceneChromeView from './SceneChromeView.vue';
import ProviderSettingsView from './ProviderSettingsView.vue';
import IntelHudView from './IntelHudView.vue';
import StoriesView from './StoriesView.vue';
/**
* Application views by name. A page places each one with a host element,
@@ -26,6 +27,7 @@ export const APPLICATION_VIEWS = Object.freeze({
context: ContextView,
welcome: WelcomeView,
'intel-hud': IntelHudView,
stories: StoriesView,
});
const mounted = new WeakMap();
+1 -1
View File
@@ -11,6 +11,6 @@ const optional = (value) => value ?? undefined;
<template>
<Teleport to="body">
<div v-for="split in splits" :key="split.key" :id="optional(split.view.id)" :hidden="split.view.hidden"><span class="before" :title="optional(split.view.beforeTitle)">{{ split.view.beforeLabel }}</span><button type="button" :class="optional(split.view.handleClass)" role="slider" :aria-label="optional(split.view.ariaLabel)" aria-valuemin="0" aria-valuemax="100" aria-orientation="horizontal" :aria-valuenow="split.view.valueNow" :aria-valuetext="split.view.valueText" @pointerdown="split.controls.pointerdown($event)" @pointermove="split.controls.pointermove($event)" @pointerup="split.controls.pointerup($event)" @pointercancel="split.controls.pointerup($event)" @keydown="split.controls.keydown($event)">↔</button><span class="after" :title="optional(split.view.afterTitle)">{{ split.view.afterLabel }}</span></div>
<div v-for="split in splits" :key="split.key" :id="optional(split.view.id)" data-globe-overlay :hidden="split.view.hidden"><span class="before" :title="optional(split.view.beforeTitle)">{{ split.view.beforeLabel }}</span><button type="button" :class="optional(split.view.handleClass)" role="slider" :aria-label="optional(split.view.ariaLabel)" aria-valuemin="0" aria-valuemax="100" aria-orientation="horizontal" :aria-valuenow="split.view.valueNow" :aria-valuetext="split.view.valueText" @pointerdown="split.controls.pointerdown($event)" @pointermove="split.controls.pointermove($event)" @pointerup="split.controls.pointerup($event)" @pointercancel="split.controls.pointerup($event)" @keydown="split.controls.keydown($event)">↔</button><span class="after" :title="optional(split.view.afterTitle)">{{ split.view.afterLabel }}</span></div>
</Teleport>
</template>
+782
View File
@@ -0,0 +1,782 @@
<script setup>
import {
computed,
nextTick,
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
import { storeToRefs } from 'pinia';
import { t, tn } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import {
FILTERS,
clamp,
fmtDur,
layersFor,
metaFor,
topicsOf,
storyText,
windowText,
} from '../../../stories/storyMeta.js';
import StoriesHeader from './StoriesHeader.vue';
/**
* Explore (prototype `.scr-explore`): the feed beside GEV's Cesium globe,
* which shows through the map area and takes input where nothing of
* Stories sits on it.
*/
const emit = defineEmits(['play']);
const store = useStoriesStore();
const { query, chips, sort, filters, picked, pins, feedSnap } =
storeToRefs(store);
const all = computed(() => store.stories);
// A story's card picture, when there is one; otherwise the card shows its
// placeholder (CSS), never a broken image.
const thumbFor = (s) => (s && store.thumbs?.[s.id]) || '';
const titleOf = (s) => storyText(s.title);
const layerNames = (s) => layersFor(s).map((l) => storyText(l[2]));
// What a story is found by in the feed's search, in the page's language.
function searchText(s) {
const m = metaFor(s);
return [
titleOf(s),
s.creator,
windowText(s),
m.region,
m.place,
...m.topics,
...layerNames(s),
]
.join(' ')
.toLowerCase();
}
const shown = computed(() => {
const words = query.value.toLowerCase().split(/\s+/).filter(Boolean);
const f = filters.value;
const list = all.value.filter((s) => {
const m = metaFor(s);
const txt = searchText(s);
if (words.some((w) => !txt.includes(w))) return false;
if (
chips.value.length &&
!chips.value.some((c) => (c === 'Live' ? s.live : m.topics.includes(c)))
)
return false;
if (f.region?.length && !f.region.includes(m.region)) return false;
if (
f.length?.length &&
!f.length.includes(s.durationMs < 60000 ? 'short' : 'long')
)
return false;
return true;
});
const end = (s) => s.tMaxMs ?? 0;
const by = {
new: (a, b) => end(b) - end(a),
long: (a, b) => b.durationMs - a.durationMs,
az: (a, b) => titleOf(a).localeCompare(titleOf(b)),
}[sort.value];
return [...list].sort(by);
});
const shownIds = computed(() => new Set(shown.value.map((s) => s.id)));
const count = computed(() =>
shown.value.length === all.value.length
? `${all.value.length}`
: `${shown.value.length}/${all.value.length}`,
);
// ── Chips and filters ──
// Every story is a GEV scene: a "made with" filter would not narrow anything.
// The topic chips and region choices are the ones the stories carry, so
// none of them narrows the feed to nothing.
const topics = computed(() => topicsOf(all.value));
const filterGroups = computed(() =>
FILTERS.map(([key, label, opts]) => {
if (key !== 'region') return [key, label, opts];
const regions = new Set(all.value.map((s) => metaFor(s).region));
return [key, label, opts.filter(([value]) => regions.has(value))];
}).filter(([, , opts]) => opts.length > 1),
);
function toggleChip(c) {
if (!c) chips.value = [];
else if (chips.value.includes(c))
chips.value = chips.value.filter((x) => x !== c);
else chips.value = [...chips.value, c];
}
const filterOpen = ref(false);
const filterCount = computed(() =>
filterGroups.value.reduce(
(n, [key]) => n + (filters.value[key]?.length ?? 0),
0,
),
);
function toggleFilter(key, value, on) {
const list = filters.value[key] ?? [];
filters.value = {
...filters.value,
[key]: on ? [...list, value] : list.filter((v) => v !== value),
};
}
function clearFilters() {
filters.value = { region: [], length: [] };
}
function resetAll() {
clearFilters();
chips.value = [];
query.value = '';
filterOpen.value = false;
}
const filterEl = ref(null);
const filterBtn = ref(null);
function onDocDown(e) {
if (
filterOpen.value &&
!filterEl.value?.contains(e.target) &&
!filterBtn.value?.contains(e.target)
)
filterOpen.value = false;
}
// ── Search ──
const searchEl = ref(null);
function onSearchKey(e) {
if (e.key === 'Escape') {
query.value = '';
e.target.blur();
e.preventDefault();
} else if (e.key === 'Enter') {
const first = shown.value[0];
if (first) pick(first.id);
}
}
function onSlash(e) {
if (
e.key === '/' &&
!/INPUT|TEXTAREA|SELECT/.test(document.activeElement?.tagName ?? '')
) {
e.preventDefault();
searchEl.value?.focus();
}
}
function headerSearch() {
if (feedSnap.value === 'map') setFeed('split');
searchEl.value?.focus();
}
// ── Picking and playing ──
const feedEl = ref(null);
function pick(id) {
if (picked.value === id) return;
if (innerWidth <= 700 && feedSnap.value === 'list') setFeed('split');
store.controller.pick(id);
nextTick(() =>
feedEl.value
?.querySelector(`.card[data-id="${CSS.escape(id)}"]`)
?.scrollIntoView({ block: 'nearest', behavior: 'smooth' }),
);
}
function play(id, from) {
emit('play', { id, from });
}
function onCardKey(e, s) {
if ((e.key === 'Enter' || e.key === ' ') && e.target === e.currentTarget) {
e.preventDefault();
if (picked.value === s.id)
play(s.id, e.currentTarget.querySelector('.thumb'));
else pick(s.id);
}
}
// The pin last clicked: a pin plays on its own second click, so a story
// picked from the feed first shows its play button on the pin.
let armedPin = null;
watch(picked, (id) => {
if (id !== armedPin) armedPin = null;
});
function onPin(e, id) {
if (picked.value === id && armedPin === id)
play(id, e.currentTarget.querySelector('.pin-thumb'));
else {
armedPin = id;
if (picked.value !== id) pick(id);
}
}
const pickedStory = computed(() =>
picked.value ? store.byId(picked.value) : null,
);
// ── Pins: projected in window pixels, placed inside the map area ──
const pinsEl = ref(null);
const origin = ref({ x: 0, y: 0 });
function measure() {
const r = pinsEl.value?.getBoundingClientRect();
if (r) origin.value = { x: r.left, y: r.top };
}
watch(pins, measure);
const placedPins = computed(() =>
pins.value.map((p) => ({
...p,
story: store.byId(p.id),
style: {
transform: `translate(${p.x - origin.value.x}px, ${p.y - origin.value.y}px) translate(-50%, -100%)`,
},
})),
);
// ── Phone: drag the list header to trade globe space for list space ──
const FEED = { map: 0.3, split: 0.56, list: 0.86 };
const FEED_ORDER = ['map', 'split', 'list'];
const bodyEl = ref(null);
const dragging = ref(false);
const feedH = ref(null);
function setFeed(snap) {
feedSnap.value = snap;
feedH.value = null;
setTimeout(() => store.controller.reframe(), 320);
}
let fd = null;
function onHeadDown(e) {
if (innerWidth > 700 || e.target.closest('.fh-tools')) return;
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
const body = bodyEl.value;
fd = {
y: e.clientY,
frac: body.querySelector('.ex-feed').offsetHeight / body.clientHeight,
H: body.clientHeight,
lastY: e.clientY,
lastT: performance.now(),
v: 0,
moved: false,
};
}
function onHeadMove(e) {
if (!fd) return;
const dy = e.clientY - fd.y;
if (!fd.moved && Math.abs(dy) > 4) {
fd.moved = true;
dragging.value = true;
}
if (!fd.moved) return;
feedH.value = clamp(fd.frac - dy / fd.H, 0.18, 0.9);
const now = performance.now();
fd.v = (e.clientY - fd.lastY) / Math.max(1, now - fd.lastT);
fd.lastY = e.clientY;
fd.lastT = now;
}
function onHeadUp() {
if (!fd) return;
if (fd.moved) {
const f = feedH.value ?? FEED[feedSnap.value];
let snap;
if (fd.v < -0.5) snap = f < FEED.split ? 'split' : 'list';
else if (fd.v > 0.5) snap = f > FEED.split ? 'split' : 'map';
else
snap = FEED_ORDER.reduce((a, b) =>
Math.abs(FEED[b] - f) < Math.abs(FEED[a] - f) ? b : a,
);
dragging.value = false;
setFeed(snap);
} else setFeed(FEED_ORDER[(FEED_ORDER.indexOf(feedSnap.value) + 1) % 3]);
fd = null;
}
function onGripKey(e) {
const i = FEED_ORDER.indexOf(feedSnap.value);
if (e.key === 'ArrowUp') {
e.preventDefault();
setFeed(FEED_ORDER[Math.min(2, i + 1)]);
} else if (e.key === 'ArrowDown') {
e.preventDefault();
setFeed(FEED_ORDER[Math.max(0, i - 1)]);
} else if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
setFeed(FEED_ORDER[(i + 1) % 3]);
}
}
// Desktop and tablet: drag the feed's right edge to widen it, up to 50 px
// past its default; double-click puts it back.
const FEED_W = 340;
const FEED_W_MAX = FEED_W + 50;
const FEED_W_MIN = 280;
const feedW = ref(FEED_W);
try {
const saved = +localStorage.getItem('gevFeedW');
if (saved) feedW.value = clamp(saved, FEED_W_MIN, FEED_W_MAX);
} catch {
/* storage off: the default width */
}
// The feed sits over the map on desktop: a new width moves the free part of
// the map, which a resize of the map itself would not report.
watch(feedW, () => nextTick(() => store.controller.reframe()));
const resizing = ref(false);
let rw = null;
function setFeedW(px) {
feedW.value = Math.round(clamp(px, FEED_W_MIN, FEED_W_MAX));
try {
localStorage.setItem('gevFeedW', feedW.value);
} catch {
/* storage off: the width lasts this visit */
}
}
function onResizeDown(e) {
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
rw = { x: e.clientX, w: feedW.value };
resizing.value = true;
e.preventDefault();
}
function onResizeMove(e) {
if (rw) setFeedW(rw.w + (e.clientX - rw.x));
}
function onResizeUp() {
rw = null;
resizing.value = false;
}
function onResizeKey(e) {
const d = { ArrowRight: 10, ArrowLeft: -10 }[e.key];
if (!d) return;
e.preventDefault();
setFeedW(feedW.value + d);
}
function onResizeReset() {
feedW.value = FEED_W;
try {
localStorage.removeItem('gevFeedW');
} catch {
/* storage off */
}
}
const bodyStyle = computed(() => ({
'--feed-h': `${(feedH.value ?? FEED[feedSnap.value]) * 100}%`,
...(innerWidth > 700
? {
'--feedw': `${feedW.value}px`,
gridTemplateColumns: `${feedW.value}px minmax(0, 1fr)`,
}
: {}),
}));
onMounted(() => {
document.addEventListener('pointerdown', onDocDown);
// On the window: the Stories keyboard guard stops keys before the document.
addEventListener('keydown', onSlash, true);
addEventListener('resize', measure);
measure();
});
onBeforeUnmount(() => {
document.removeEventListener('pointerdown', onDocDown);
removeEventListener('keydown', onSlash, true);
removeEventListener('resize', measure);
});
defineExpose({
cardThumb: (id) =>
feedEl.value?.querySelector(`.card[data-id="${CSS.escape(id)}"]`),
});
</script>
<template>
<section
id="scrExplore"
class="scr scr-explore"
:aria-label="t('GEV Stories explore')"
>
<StoriesHeader
screen="explore"
@back="store.controller.close()"
@home="store.controller.close()"
@search="headerSearch"
/>
<div
id="exBody"
ref="bodyEl"
class="ex-body"
:class="{ 'feed-dragging': dragging }"
data-side="left"
:style="bodyStyle"
>
<div
class="ex-feed-resize"
:class="{ on: resizing }"
role="separator"
aria-orientation="vertical"
:aria-label="t('Resize story list')"
:aria-valuenow="feedW"
:aria-valuemin="FEED_W_MIN"
:aria-valuemax="FEED_W_MAX"
tabindex="0"
:style="{ left: `${feedW - 5}px` }"
@pointerdown="onResizeDown"
@pointermove="onResizeMove"
@pointerup="onResizeUp"
@pointercancel="onResizeUp"
@dblclick="onResizeReset"
@keydown="onResizeKey"
></div>
<aside class="ex-feed" :aria-label="t('Stories')">
<div class="ex-feed-top">
<div
id="feedHead"
class="ex-feed-head"
@pointerdown="onHeadDown"
@pointermove="onHeadMove"
@pointerup="onHeadUp"
@pointercancel="onHeadUp"
>
<button
id="feedGrip"
class="feed-grip"
type="button"
:aria-label="t('Story list size. Drag, or press to change')"
@keydown="onGripKey"
></button>
<h1>{{ t('GEV Stories') }}</h1>
<span
id="exCount"
:aria-label="
tn(
all.length,
'{n} of {count} story',
'{n} of {count} stories',
{
n: shown.length,
},
)
"
>{{ count }}</span
>
<div class="fh-tools">
<label class="sr" for="exSort">{{ t('Sort stories') }}</label>
<select id="exSort" v-model="sort" class="fh-sort">
<option value="new">{{ t('Newest') }}</option>
<option value="long">{{ t('Longest') }}</option>
<option value="az">{{ t('A–Z') }}</option>
</select>
<button
id="exFilterBtn"
ref="filterBtn"
type="button"
class="fh-filter"
:class="{ on: filterCount }"
:aria-expanded="filterOpen"
aria-controls="exFilter"
:aria-label="
filterCount
? tn(filterCount, '{count} filter on', '{count} filters on')
: t('Filters')
"
@click.stop="filterOpen = !filterOpen"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.9"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="M4 6h16M7 12h10M10 18h4" />
</svg>
<b v-if="filterCount" id="exFilterN">{{ filterCount }}</b>
</button>
</div>
</div>
<div id="exTools" class="ex-tools" @pointerdown.stop @wheel.stop>
<div class="fh-search m-only-search" role="search">
<label class="sr" for="exQm">{{ t('Search stories') }}</label>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
aria-hidden="true"
>
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4.5 4.5" />
</svg>
<input
id="exQm"
ref="searchEl"
v-model="query"
class="ex-q"
type="search"
:placeholder="t('Search stories, places, creators')"
autocomplete="off"
@keydown="onSearchKey"
/>
<button
v-if="query"
type="button"
class="ex-qx"
:aria-label="t('Clear search')"
@click="
query = '';
searchEl?.focus();
"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.2"
stroke-linecap="round"
aria-hidden="true"
>
<path d="M6 6l12 12M18 6 6 18" />
</svg>
</button>
<kbd class="hide-m">/</kbd>
</div>
<div class="fh-row">
<div
id="exChips"
class="fh-chips"
role="group"
:aria-label="t('Topics')"
>
<button
type="button"
class="chip"
:aria-pressed="!chips.length"
@click="toggleChip('')"
>{{ t('All') }}</button
>
<button
v-for="c in topics"
:key="c"
type="button"
class="chip"
:class="{ live: c === 'Live' }"
:aria-pressed="chips.includes(c)"
@click="toggleChip(c)"
><i v-if="c === 'Live'"></i>{{ t(c) }}</button
>
</div>
</div>
<div
v-if="filterOpen"
id="exFilter"
ref="filterEl"
class="ex-filter"
role="dialog"
:aria-label="t('Filter stories')"
>
<fieldset v-for="[key, label, opts] in filterGroups" :key="key">
<legend>{{ t(label) }}</legend>
<label v-for="[value, text] in opts" :key="value" class="fopt">
<input
type="checkbox"
:checked="filters[key]?.includes(value)"
@change="toggleFilter(key, value, $event.target.checked)"
/>
<span>{{ t(text) }}</span>
</label>
</fieldset>
<div class="fact">
<button type="button" class="tbtn" @click="clearFilters">{{
t('Clear')
}}</button>
<button
type="button"
class="tbtn solid"
@click="
filterOpen = false;
filterBtn?.focus();
"
>
{{
tn(
shown.length,
'Show {count} story',
'Show {count} stories',
)
}}
</button>
</div>
</div>
</div>
</div>
<ul id="feed" ref="feedEl" class="feed">
<li v-if="!shown.length" class="feed-empty">
<b>{{ t('No stories match') }}</b>
<span>{{ t('Try another word or clear the filters.') }}</span>
<button type="button" class="tbtn" @click="resetAll">{{
t('Clear all')
}}</button>
</li>
<li v-for="s in shown" :key="s.id">
<div
class="card"
role="button"
tabindex="0"
:data-id="s.id"
:aria-pressed="picked === s.id"
@click="pick(s.id)"
@keydown="onCardKey($event, s)"
>
<span class="thumb">
<img
v-if="thumbFor(s)"
:src="thumbFor(s)"
alt=""
loading="lazy"
/>
<span v-if="s.live" class="chip"
><span class="dot"></span>{{ t('LIVE') }}</span
>
<span v-else class="chip">{{
s.draft ? t('DRAFT') : t('STORY')
}}</span>
<span class="dur">{{ fmtDur(s.durationMs) }}</span>
<button
class="thumb-play"
type="button"
:aria-label="t('Play {title}', { title: titleOf(s) })"
@click.stop="play(s.id, $event.currentTarget.parentElement)"
>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M9 6.5v11l9-5.5z" fill="currentColor" />
</svg>
</button>
</span>
<span class="c-title">{{ titleOf(s) }}</span>
<span class="c-meta">{{ s.creator }} · {{ windowText(s) }}</span>
<span class="c-layers"
><span v-for="l in layerNames(s)" :key="l">{{ l }}</span></span
>
<span class="c-play">
<button
class="tbtn solid"
type="button"
@click.stop="
play(
s.id,
$event.currentTarget
.closest('.card')
.querySelector('.thumb'),
)
"
>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M7 4.5v15l12.5-7.5z" /></svg
>{{ t('Play story') }}
</button>
</span>
</div>
</li>
</ul>
</aside>
<div class="ex-map">
<div class="map-slot"></div>
<div id="pins" ref="pinsEl" class="pins">
<button
v-for="p in placedPins"
:key="p.id"
class="pin"
:class="{ out: !shownIds.has(p.id), hidden: !p.visible }"
type="button"
:data-id="p.id"
:aria-pressed="picked === p.id"
:aria-label="t('Preview {title}', { title: titleOf(p.story) })"
:style="p.style"
@click="onPin($event, p.id)"
>
<span
class="pin-thumb"
:data-preview="t('Click to preview')"
:data-play="t('Click to play')"
:data-tap="t('Tap to play')"
:data-play-short="t('Play')"
><img v-if="thumbFor(p.story)" :src="thumbFor(p.story)" alt=""
/></span>
<span class="pin-lbl">{{ titleOf(p.story).split(':')[0] }}</span>
<span class="pin-dot"></span>
</button>
</div>
<div class="ex-msearch glass" role="search">
<label class="sr" for="exQ">{{ t('Search stories') }}</label>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
aria-hidden="true"
>
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4.5 4.5" />
</svg>
<input
id="exQ"
v-model="query"
class="ex-q"
type="search"
:placeholder="t('Search stories, places, creators')"
autocomplete="off"
@keydown="onSearchKey"
/>
<button
v-if="query"
type="button"
class="ex-qx"
:aria-label="t('Clear search')"
@click="query = ''"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.2"
stroke-linecap="round"
aria-hidden="true"
>
<path d="M6 6l12 12M18 6 6 18" />
</svg>
</button>
<kbd>/</kbd>
</div>
<div
v-if="pickedStory"
id="exPreview"
class="ex-preview glass"
aria-live="polite"
>
<span class="k"><i></i>{{ t('PREVIEW') }}</span>
<h2>{{ titleOf(pickedStory) }}</h2>
<span class="c-meta"
>{{ pickedStory.creator }} · {{ windowText(pickedStory) }}</span
>
<span class="c-layers"
><span v-for="l in layerNames(pickedStory)" :key="l">{{
l
}}</span></span
>
<button
class="tbtn solid"
type="button"
@click="play(pickedStory.id, null)"
>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M7 4.5v15l12.5-7.5z" /></svg
>{{ t('Play story') }}
</button>
</div>
<div v-else class="ex-hint glass">{{
t('Pick a story or a pin to preview it here')
}}</div>
</div>
</div>
</section>
</template>
+181
View File
@@ -0,0 +1,181 @@
<script setup>
import {
computed,
nextTick,
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
/**
* The Stories top bar (prototype `.h-top.s-head`): back, GEV logo and
* wordmark, breadcrumb, the phone title (scrolls when it is too long) and
* the right-hand buttons.
*/
const props = defineProps({
screen: { type: String, required: true },
title: { type: String, default: '' },
});
const emit = defineEmits(['back', 'home', 'crumb', 'search']);
const store = useStoriesStore();
// A scene saved on this device only: a link to it opens nothing elsewhere.
const localOnly = computed(() => !!store.byId(store.storyId)?.mine);
async function share() {
const what = props.screen === 'story' ? t('Story') : t('Stories');
try {
await navigator.clipboard.writeText(store.controller.shareLink());
store.flashToast(t('{what} link copied', { what }));
} catch {
store.flashToast(t('Copy this link: {url}', { url: location.href }), 4000);
}
}
// Long titles scroll gently so the whole name can be read.
const mtitle = ref(null);
let observer = null;
function fitTitle() {
const el = mtitle.value;
const sp = el?.firstElementChild;
if (!sp) return;
const over = sp.scrollWidth - el.clientWidth;
el.classList.toggle('marquee', over > 4);
el.style.setProperty('--mq', `${-(over + 22)}px`);
el.style.setProperty('--mq-dur', `${Math.max(5, (over + 22) / 22)}s`);
}
onMounted(() => {
if (globalThis.ResizeObserver && mtitle.value) {
observer = new ResizeObserver(fitTitle);
observer.observe(mtitle.value);
}
fitTitle();
});
watch(
() => props.title,
() => nextTick(fitTitle),
);
onBeforeUnmount(() => observer?.disconnect());
</script>
<template>
<header class="h-top s-head">
<button
class="s-back glass"
type="button"
:aria-label="
screen === 'story' ? t('Back to stories') : t('Back to the globe')
"
@click="emit('back')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M15 6l-6 6 6 6" />
</svg>
</button>
<div class="h-brand">
<div class="h-brand-row">
<button
class="s-home"
type="button"
:aria-label="t('Back to the globe')"
@click="emit('home')"
>
<svg class="eye" viewBox="0 0 775 520" aria-hidden="true">
<use href="#gevLogo" />
</svg>
</button>
<span class="h-word" translate="no">GOD'S EYE <b>VIEW</b></span>
</div>
<nav class="h-tag s-trail" :aria-label="t('Breadcrumb')">
<template v-if="screen === 'explore'">
<button type="button" @click="emit('home')">{{ t('Globe') }}</button>
<span aria-hidden="true">/</span>
<b>{{ t('Stories') }}</b>
</template>
<template v-else>
<button type="button" @click="emit('crumb')">{{
t('Stories')
}}</button>
<span aria-hidden="true">/</span>
<b>{{ title }}</b>
</template>
</nav>
</div>
<span ref="mtitle" class="s-mtitle glass"
><span>{{ screen === 'explore' ? t('Stories') : title }}</span></span
>
<div class="h-right">
<button
v-if="screen === 'explore'"
class="s-msearch ibtn"
type="button"
:aria-label="t('Search')"
@click="emit('search')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4.5 4.5" />
</svg>
</button>
<button
v-if="!(screen === 'story' && localOnly)"
class="tbtn hide-m"
type="button"
:aria-label="t('Share')"
@click="share"
>
<span class="share-icon" aria-hidden="true">&#x1F517;</span>
<span>{{ t('Share') }}</span>
</button>
<button
v-if="screen === 'explore'"
class="tbtn accent hide-m"
type="button"
@click="emit('home')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M19 12H5M11 6l-6 6 6 6" />
</svg>
<span>{{ t('Back to GEV') }}</span>
</button>
<button
v-else
class="tbtn accent hide-m gs-back-stories"
type="button"
@click="emit('crumb')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M19 12H5M11 6l-6 6 6 6" />
</svg>
<span>{{ t('GEV Stories') }}</span>
</button>
</div>
</header>
</template>
+414
View File
@@ -0,0 +1,414 @@
<script setup>
import { computed, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { t, tn } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import { chapterAt } from '../../../stories/format.js';
import {
anchorStamp,
chapterStamp,
chapterTitle,
clamp,
nowFacts,
storyText,
windowText,
} from '../../../stories/storyMeta.js';
/**
* The context panel (prototype `.st-ctx`): docked on the right on desktop,
* a sheet that peeks above the timeline on a phone. It shows what a GEV
* scene carries: right-now facts, chapters, key moments, sources and
* background, with a search over its chapters, key moments and sources.
*/
const props = defineProps({
story: { type: Object, required: true },
nudge: Boolean,
});
const emit = defineEmits(['chapter', 'anchor', 'open', 'hide']);
const store = useStoriesStore();
const { playback, sheet } = storeToRefs(store);
const k = computed(() => chapterAt(props.story, playback.value.wallMs));
const chTitle = (c) => chapterTitle(props.story, c);
const events = computed(() => props.story.events ?? []);
// The background in the page's language: one text, or parts (a shipped
// scene's layers) translated one by one.
const background = computed(() =>
[]
.concat(props.story.background || [])
.map((part) => storyText(part))
.join(' '),
);
const stamp = (ms, world) => anchorStamp(props.story, ms, world);
const facts = computed(() =>
nowFacts(props.story, playback.value.worldMs, playback.value.wallMs),
);
const peekFacts = computed(() => facts.value.slice(0, 3));
const sheetSum = computed(
() =>
`${k.value + 1}/${props.story.chapters.length} · ${chTitle(props.story.chapters[k.value])} · ${tn(props.story.sources.length, '{count} source', '{count} sources')}`,
);
const titleOf = (s) => storyText(s.title);
const related = computed(() =>
store.stories.filter((x) => x.id !== props.story.id).slice(0, 3),
);
// A related story's card picture, when there is one (CSS draws a placeholder).
const thumbOf = (s) => store.thumbs?.[s.id] || '';
// ── Search this story: its chapters, key moments and sources ──
const GLYPH = { ch: '#', ev: '•', src: '↗' };
const query = ref('');
const active = ref(-1);
const results = computed(() => {
const q = query.value.trim().toLowerCase();
if (!q) return null;
const hit = (x) => `${x.title} ${x.sub}`.toLowerCase().includes(q);
const chs = props.story.chapters
.map((c, i) => ({
type: 'ch',
k: i,
title: chTitle(c),
sub: `${t('Chapter {n}', { n: i + 1 })} · ${chapterStamp(props.story, c)}`,
}))
.filter(hit);
const evs = events.value
.map((ev, i) => ({
type: 'ev',
k: i,
ev,
title: storyText(ev.label),
sub: `${t('Key moments')} · ${stamp(ev.wallMs, ev.tMs)}`,
}))
.filter(hit);
const srcs = props.story.sources
.map((x) => ({
type: 'src',
href: x[2],
title: storyText(x[0]),
sub: storyText(x[1]),
}))
.filter(hit);
return [...chs, ...evs, ...srcs].slice(0, 9);
});
function onQuery() {
active.value = results.value?.length ? 0 : -1;
}
function choose(x) {
if (!x) return;
query.value = '';
if (x.type === 'ch') emit('chapter', x.k);
else if (x.type === 'ev') emit('anchor', x.ev);
else if (x.type === 'src' && x.href && x.href !== '#')
window.open(x.href, '_blank', 'noopener');
}
function onSearchKey(e) {
const list = results.value ?? [];
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
e.preventDefault();
if (!list.length) return;
active.value =
(active.value + (e.key === 'ArrowDown' ? 1 : -1) + list.length) %
list.length;
} else if (e.key === 'Enter') {
e.preventDefault();
choose(list[active.value]);
} else if (e.key === 'Escape') query.value = '';
}
// ── Phone sheet: follows the finger, snaps to peek / half / full ──
const SNAPS = ['peek', 'half', 'full'];
const el = ref(null);
const dragH = ref(null);
const dragging = ref(false);
let sd = null;
function heights() {
const H = el.value?.closest('.st-body')?.clientHeight || innerHeight;
return { peek: 100, half: H * 0.54, full: H * 0.88, H };
}
function setSheet(s) {
sheet.value = s;
dragH.value = null;
setTimeout(() => store.controller.reframe(), 320);
}
function onHandleDown(e) {
if (innerWidth > 700) return;
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
sd = {
y: e.clientY,
h: el.value.offsetHeight,
lastY: e.clientY,
lastT: performance.now(),
v: 0,
moved: false,
};
}
function onHandleMove(e) {
if (!sd) return;
const dy = e.clientY - sd.y;
if (!sd.moved && Math.abs(dy) > 4) {
sd.moved = true;
dragging.value = true;
}
if (!sd.moved) return;
dragH.value = clamp(sd.h - dy, 100, heights().H * 0.92);
const now = performance.now();
sd.v = (e.clientY - sd.lastY) / Math.max(1, now - sd.lastT);
sd.lastY = e.clientY;
sd.lastT = now;
}
let justDragged = false;
function onHandleUp() {
if (!sd) return;
if (sd.moved) {
const hs = heights();
const h = dragH.value ?? hs[sheet.value];
let target;
if (sd.v < -0.5) target = h < hs.half ? 'half' : 'full';
else if (sd.v > 0.5) target = h > hs.half ? 'half' : 'peek';
else
target = SNAPS.reduce((a, b) =>
Math.abs(hs[b] - h) < Math.abs(hs[a] - h) ? b : a,
);
dragging.value = false;
justDragged = true;
setSheet(target);
}
sd = null;
}
function onHandleClick() {
if (justDragged) {
justDragged = false;
return;
}
setSheet(SNAPS[(SNAPS.indexOf(sheet.value) + 1) % 3]);
}
function onHandleKey(e) {
const i = SNAPS.indexOf(sheet.value);
if (e.key === 'ArrowUp') {
e.preventDefault();
setSheet(SNAPS[Math.min(2, i + 1)]);
} else if (e.key === 'ArrowDown') {
e.preventDefault();
setSheet(SNAPS[Math.max(0, i - 1)]);
}
}
defineExpose({ dragging });
</script>
<template>
<aside
id="stCtx"
ref="el"
class="st-ctx"
:class="{ nudge }"
:aria-label="t('Context')"
:style="dragH != null ? { height: `${dragH}px` } : null"
>
<button
id="sheetHandle"
class="sheet-handle"
type="button"
:aria-expanded="sheet !== 'peek'"
:aria-label="
sheet === 'peek'
? t('Context. Swipe up or press to open')
: t('Context. Swipe down or press to close')
"
@pointerdown="onHandleDown"
@pointermove="onHandleMove"
@pointerup="onHandleUp"
@pointercancel="onHandleUp"
@click="onHandleClick"
@keydown="onHandleKey"
>
<span class="pk-top">
<span class="lbl">{{ t('Context') }}</span>
<span id="sheetSum" class="sum">{{ sheetSum }}</span>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 15l6-6 6 6" />
</svg>
</span>
<span id="peekFacts" class="pk-facts" aria-hidden="true">
<span v-for="f in peekFacts" :key="f[1]"
><b :class="{ warn: f[2] }">{{ f[0] }}</b
>{{ t(f[1]) }}</span
>
</span>
</button>
<div class="cx-search-wrap">
<div class="cx-search">
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
aria-hidden="true"
>
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4.5 4.5" />
</svg>
<input
id="cxQ"
v-model="query"
type="search"
:placeholder="t('Search this story')"
autocomplete="off"
spellcheck="false"
:aria-label="t('Search this story')"
role="combobox"
:aria-expanded="!!results"
aria-controls="cxResults"
@input="onQuery"
@keydown="onSearchKey"
/>
<button
class="cx-ic"
type="button"
disabled
:aria-label="t('Voice search (not in this build)')"
:title="t('Voice search (not in this build)')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.9"
stroke-linecap="round"
>
<rect x="9" y="3" width="6" height="11" rx="3" />
<path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21" />
</svg>
</button>
</div>
<ul
v-if="results"
id="cxResults"
class="cx-results"
role="listbox"
:aria-label="t('Search results')"
>
<li v-for="(x, i) in results" :key="`${x.type}:${x.k ?? x.title}`">
<button
type="button"
role="option"
:aria-selected="i === active"
@click="choose(x)"
>
<span class="ic" aria-hidden="true">{{ GLYPH[x.type] }}</span>
<span
><b>{{ x.title }}</b
><span class="sub">{{ x.sub }}</span></span
>
</button>
</li>
<li v-if="!results.length" class="empty">{{
t('Nothing in this story matches.')
}}</li>
</ul>
</div>
<div id="cxScroll" class="cx-scroll">
<div class="cx-sec cx-chapters">
<div class="cx-h">{{ t('Chapters') }}</div>
<ul class="cx-list">
<li v-for="(c, i) in story.chapters" :key="c.id">
<a href="#" @click.prevent="emit('chapter', i)"
>{{ i + 1 }}. {{ chTitle(c) }}</a
>
<span
>{{ chapterStamp(story, c)
}}{{ i === k ? ` · ${t('now')}` : '' }}</span
>
</li>
</ul>
</div>
<div class="cx-sec">
<div class="cx-h">
{{ t('About') }}
<button
class="tbtn cx-close"
type="button"
style="height: 28px; padding: 0 8px"
@click="emit('hide')"
>{{ t('Close') }}</button
>
</div>
<p class="cx-p">
<b>{{ titleOf(story) }}</b
><br />{{ t('by {creator}', { creator: story.creator }) }} ·
{{ windowText(story) }}
</p>
<p v-if="story.description" class="cx-p">{{
storyText(story.description)
}}</p>
</div>
<div v-if="events.length" class="cx-sec">
<div class="cx-h">{{ t('Key moments') }}</div>
<ul class="cx-anchors">
<li v-for="(ev, i) in events" :key="i">
<button
type="button"
:class="{ past: playback.wallMs >= ev.wallMs }"
@click="emit('anchor', ev)"
>
<span class="tchip">{{ stamp(ev.wallMs, ev.tMs) }}</span>
<span class="al"
><i :style="{ background: ev.color }"></i
>{{ storyText(ev.label) }}</span
>
</button>
</li>
</ul>
</div>
<div v-if="story.sources.length" class="cx-sec">
<div class="cx-h">{{ t('Sources') }}</div>
<ul class="cx-list">
<li v-for="src in story.sources" :key="src[0]">
<a :href="src[2] || '#'" target="_blank" rel="noopener"
>{{ storyText(src[0]) }} ↗</a
>
<span>{{ storyText(src[1]) }}</span>
</li>
</ul>
</div>
<div v-if="background" class="cx-sec">
<div class="cx-h">{{ t('Background') }}</div>
<p class="cx-p">{{ background }}</p>
</div>
<div class="cx-sec">
<div class="cx-h">{{ t('Related stories') }}</div>
<div class="cx-related">
<button
v-for="x in related"
:key="x.id"
type="button"
@click="emit('open', x.id)"
>
<span class="thumb"
><img v-if="thumbOf(x)" :src="thumbOf(x)" alt="" loading="lazy"
/></span>
<span
><b>{{ titleOf(x) }}</b
><span class="c-meta">{{ windowText(x) }}</span></span
>
</button>
</div>
</div>
</div>
</aside>
</template>
+53
View File
@@ -0,0 +1,53 @@
<script setup>
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
/**
* The right rail over the story map (prototype `.ov-rail`): Open in GEV (it
* opens the scene in GEV's Scenes panel) and Share.
*/
const store = useStoriesStore();
// A scene saved on this device only: a link to it opens nothing elsewhere.
const localOnly = computed(() => !!store.byId(store.storyId)?.mine);
async function share() {
const url = store.controller.shareLink();
try {
await navigator.clipboard.writeText(url);
store.flashHint(t('Story link copied'), 1800);
} catch {
store.flashHint(url, 2600);
}
}
</script>
<template>
<div id="ovRail" class="ov ov-rail">
<!-- The scene opens in GEV's Scenes panel. -->
<button
id="railGev"
class="rail-btn rail-gev"
type="button"
:aria-label="t('Open this moment in GEV')"
@click="store.controller.openInGev()"
>
<span class="ic"
><svg class="eye" viewBox="0 0 775 520" aria-hidden="true">
<use href="#gevLogo" /></svg></span
>{{ t('Open') }}
</button>
<button
v-if="!localOnly"
id="railShare"
class="rail-btn"
type="button"
:aria-label="t('Share this story')"
@click="share"
>
<span class="ic"
><span class="share-icon" aria-hidden="true">&#x1F517;</span></span
>{{ t('Share') }}
</button>
</div>
</template>
+631
View File
@@ -0,0 +1,631 @@
<script setup>
import {
computed,
nextTick,
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
import { storeToRefs } from 'pinia';
import { formatNumber, t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import { chapterAt } from '../../../stories/format.js';
import {
chapterTitle,
clamp,
clockText,
layersFor,
nowFacts,
storyText,
} from '../../../stories/storyMeta.js';
import StoriesHeader from './StoriesHeader.vue';
import StoryTimeline from './StoryTimeline.vue';
import StoryContext from './StoryContext.vue';
import StoryRail from './StoryRail.vue';
/**
* One story (prototype `.scr-story`): a GEV scene playing on GEV's Cesium
* globe, which shows through the map area.
*/
const props = defineProps({ story: { type: Object, required: true } });
const emit = defineEmits(['back']);
const store = useStoriesStore();
const {
playback,
expanded,
ctxOpen,
sheet,
contextWidth,
camera,
hint,
bigPlay,
} = storeToRefs(store);
const titleOf = (s) => storyText(s.title);
const title = computed(() => titleOf(props.story));
const k = computed(() => chapterAt(props.story, playback.value.wallMs));
const chapter = computed(() => props.story.chapters[k.value]);
const chTitle = (c) => chapterTitle(props.story, c);
const clock = computed(() =>
clockText(
props.story,
playback.value.wallMs,
playback.value.worldMs,
k.value,
),
);
const layers = computed(() => layersFor(props.story));
const facts = computed(() =>
nowFacts(props.story, playback.value.worldMs, playback.value.wallMs),
);
const posText = computed(() => {
const { lat, lon, altKm } = camera.value;
return {
pos: `${Math.abs(lat).toFixed(2)}°${lat >= 0 ? 'N' : 'S'} ${Math.abs(lon).toFixed(2)}°${lon >= 0 ? 'E' : 'W'}`,
// ALT and KM are HUD codes, as in GEV's own readout; the number follows
// the page's language.
alt: ` · ALT ${formatNumber(altKm)} KM`,
};
});
const legendStyle = (l) =>
l[0] === 'dash'
? { borderTop: `2px dashed ${l[1]}` }
: l[0] === 'line'
? { borderTopColor: l[1] }
: { background: l[1] };
const legendClass = (l) => (l[0] === 'dot' ? 'dot' : l[0] === 'sq' ? 'sq' : '');
// ── Navigation within the story ──
const timelineRef = ref(null);
function goChapter(i) {
store.controller.seek(props.story.chapters[i].wallMs + 1);
if (playback.value.exploring) store.controller.resume();
}
function goAnchor(ev) {
store.controller.focusEvent(ev);
if (innerWidth <= 700) sheet.value = 'half';
}
function bigPlayClick() {
bigPlay.value = false;
if (playback.value.exploring) store.controller.resume();
else store.controller.play();
}
// ── Story card: Chapter · On the map · Right now ──
const page = ref(0);
const cardMin = ref(false);
const cardDragging = ref(false);
const trackEl = ref(null);
const cardEl = ref(null);
const pgEls = ref([]);
const trackHeight = ref(null);
const dragOffset = ref(null);
function sizeCard() {
const pg = pgEls.value[page.value];
if (pg) trackHeight.value = pg.offsetHeight;
}
function setPage(p) {
page.value = clamp(p, 0, 2);
dragOffset.value = null;
requestAnimationFrame(sizeCard);
}
const trackStyle = computed(() => ({
transform:
dragOffset.value != null
? `translateX(${dragOffset.value}px)`
: `translateX(${-page.value * 100}%)`,
height: trackHeight.value ? `${trackHeight.value}px` : null,
}));
let pd = null;
function onCardDown(e) {
if (e.target.closest('#pgDots, .pg-min, .pg-mini') || cardMin.value) return;
e.stopPropagation();
pd = {
x: e.clientX,
y: e.clientY,
w: cardEl.value.offsetWidth,
t: performance.now(),
moved: false,
};
try {
cardEl.value.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
}
function onCardMove(e) {
if (!pd) return;
const dx = e.clientX - pd.x;
if (
!pd.moved &&
Math.abs(dx) > 6 &&
Math.abs(dx) > Math.abs(e.clientY - pd.y)
) {
pd.moved = true;
cardDragging.value = true;
}
if (!pd.moved) return;
// Rubber band at the ends.
const ends = (page.value === 0 && dx > 0) || (page.value === 2 && dx < 0);
dragOffset.value = -page.value * pd.w + (ends ? dx * 0.3 : dx);
}
function onCardUp(e) {
if (!pd) return;
if (pd.moved) {
const dx = e.clientX - pd.x;
const fast = Math.abs(dx) / Math.max(1, performance.now() - pd.t) > 0.4;
cardDragging.value = false;
setPage(
page.value + (Math.abs(dx) > pd.w * 0.25 || fast ? (dx < 0 ? 1 : -1) : 0),
);
}
pd = null;
}
function onCardKey(e) {
if (e.key === 'ArrowRight') setPage(page.value + 1);
else if (e.key === 'ArrowLeft') setPage(page.value - 1);
}
const minBtn = ref(null);
const miniBtn = ref(null);
function setCardMin(on) {
cardMin.value = on;
if (!on) requestAnimationFrame(sizeCard);
}
// The card shows for a few seconds at each chapter (new info), then folds
// to its pill so the map has room (prototype, on every screen size here).
let cardTimer = 0;
function cardPeek() {
clearTimeout(cardTimer);
setCardMin(false);
cardTimer = setTimeout(() => {
if (!cardHover) setCardMin(true);
}, 5000);
}
// The card stays open while the pointer is on it, then folds a moment later.
let cardHover = false;
function onCardEnter() {
cardHover = true;
clearTimeout(cardTimer);
}
function onCardLeave() {
cardHover = false;
if (!cardMin.value) cardTimer = setTimeout(() => setCardMin(true), 2500);
}
watch(k, () => cardPeek());
let cardObserver = null;
// ── Phone: controls fade in expanded full screen while playing ──
const controlsHidden = ref(false);
let pokeTimer = 0;
function pokeControls() {
controlsHidden.value = false;
clearTimeout(pokeTimer);
if (
expanded.value &&
playback.value.playing &&
!playback.value.exploring &&
innerWidth <= 700
)
pokeTimer = setTimeout(() => (controlsHidden.value = true), 3000);
}
watch([expanded, () => playback.value.playing], pokeControls);
function onSectionMove(e) {
if (e.pointerType !== 'mouse' || controlsHidden.value) pokeControls();
}
// ── Phone: the first play shows that the context can be pulled up ──
const sheetHint = ref(false);
const nudge = ref(false);
let hintTimers = [];
watch(
() => playback.value.playing,
(on) => {
if (!on || store.sheetHintSeen) return;
hintTimers.push(
setTimeout(() => {
if (store.sheetHintSeen || innerWidth > 700 || sheet.value !== 'peek')
return;
store.sheetHintSeen = true;
sheetHint.value = true;
nudge.value = true;
hintTimers.push(setTimeout(() => (nudge.value = false), 2400));
hintTimers.push(setTimeout(() => (sheetHint.value = false), 5200));
}, 1500),
);
},
);
watch(sheet, () => (sheetHint.value = false));
// ── Desktop: drag the context panel's left edge to resize ──
const resizing = ref(false);
const limits = () => [260, Math.max(280, Math.min(640, innerWidth - 420))];
function setCtxW(px) {
const [a, b] = limits();
contextWidth.value = Math.round(clamp(px, a, b));
try {
localStorage.setItem('gevCtxW', contextWidth.value);
} catch {
/* storage off: the width lasts this visit */
}
}
let rd = null;
function onResizeDown(e) {
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
rd = {
x: e.clientX,
w: document.getElementById('stCtx')?.offsetWidth ?? 340,
};
resizing.value = true;
e.preventDefault();
}
function onResizeMove(e) {
if (rd) setCtxW(rd.w + (rd.x - e.clientX));
}
function onResizeUp() {
if (!rd) return;
rd = null;
resizing.value = false;
store.controller.reframe();
}
function onResizeReset() {
contextWidth.value = 0;
try {
localStorage.removeItem('gevCtxW');
} catch {
/* storage off */
}
store.controller.reframe();
}
function onResizeKey(e) {
const d = { ArrowLeft: 24, ArrowRight: -24 }[e.key];
if (!d) return;
e.preventDefault();
setCtxW((document.getElementById('stCtx')?.offsetWidth ?? 340) + d);
store.controller.reframe();
}
const sectionStyle = computed(() =>
contextWidth.value && !expanded.value
? { '--ctxw': `${contextWidth.value}px` }
: null,
);
onMounted(() => {
try {
const v = +localStorage.getItem('gevCtxW');
if (v) contextWidth.value = v;
} catch {
/* storage off */
}
if (globalThis.ResizeObserver && cardEl.value) {
cardObserver = new ResizeObserver(sizeCard);
cardObserver.observe(cardEl.value);
}
nextTick(sizeCard);
cardPeek();
});
onBeforeUnmount(() => {
clearTimeout(cardTimer);
clearTimeout(pokeTimer);
hintTimers.forEach(clearTimeout);
cardObserver?.disconnect();
});
watch(
() => props.story.id,
() => {
page.value = 0;
cardMin.value = false;
nextTick(sizeCard);
},
);
watch([k, page], () => nextTick(sizeCard));
</script>
<template>
<section
id="scrStory"
class="scr scr-story"
:class="{
exploring: playback.exploring,
expanded,
'ctx-open': ctxOpen,
'ctx-sized': !!contextWidth,
'controls-hidden': controlsHidden,
'sheet-hinting': sheetHint,
'ctx-resizing': resizing,
}"
:aria-label="t('GEV Story')"
:data-sheet="sheet"
data-chapters="timeline"
:style="sectionStyle"
@pointerdown="pokeControls"
@pointermove="onSectionMove"
@keydown="pokeControls"
>
<StoriesHeader
screen="story"
:title="title"
@back="emit('back')"
@crumb="emit('back')"
@home="store.controller.close()"
/>
<div class="st-body">
<aside class="st-chapters" :aria-label="t('Chapters')">
<div class="ch-credit">
<span class="label"
><span class="chip">{{
story.live ? t('LIVE') : story.draft ? t('DRAFT') : t('STORY')
}}</span></span
>
<div class="t">{{ title }}</div>
<div class="c-meta">{{
t('by {creator}', { creator: story.creator })
}}</div>
</div>
<ol class="ch-list">
<li v-for="(c, i) in story.chapters" :key="c.id">
<button
class="ch-item"
:class="{ done: i < k }"
type="button"
:aria-current="i === k ? 'step' : undefined"
@click="goChapter(i)"
>
<span class="n">{{ i + 1 }}</span
><span
><b>{{ chTitle(c) }}</b></span
>
</button>
</li>
</ol>
</aside>
<div class="st-main">
<div id="stMap" class="st-map">
<div class="map-slot"></div>
<div
id="ovChapter"
ref="cardEl"
class="ov ov-chapter glass"
:class="{ min: cardMin, dragging: cardDragging }"
role="region"
aria-roledescription="carousel"
:aria-label="t('Story card')"
tabindex="0"
@pointerdown="onCardDown"
@pointermove="onCardMove"
@pointerup="onCardUp"
@pointercancel="onCardUp"
@keydown="onCardKey"
@focusin="!cardMin && cardPeek()"
@mouseenter="onCardEnter"
@mouseleave="onCardLeave"
>
<div
id="pgTrack"
ref="trackEl"
class="pg-track"
:style="trackStyle"
>
<section
:ref="(el) => (pgEls[0] = el)"
class="pg"
aria-roledescription="slide"
:aria-label="t('Chapter')"
:aria-hidden="page !== 0"
aria-live="polite"
>
<div class="k">{{
t('CHAPTER {n} / {total}', {
n: k + 1,
total: story.chapters.length,
})
}}</div>
<div class="t">{{ chTitle(chapter) }}</div>
<div v-if="chapter.caption" class="c">{{
storyText(chapter.caption)
}}</div>
</section>
<section
:ref="(el) => (pgEls[1] = el)"
class="pg"
aria-roledescription="slide"
:aria-label="t('On the map')"
:aria-hidden="page !== 1"
>
<div class="k">{{ t('ON THE MAP') }}</div>
<div class="pg-legend">
<span v-for="l in layers" :key="l[2]"
><i :class="legendClass(l)" :style="legendStyle(l)"></i
>{{ storyText(l[2]) }}</span
>
</div>
</section>
<section
:ref="(el) => (pgEls[2] = el)"
class="pg"
aria-roledescription="slide"
:aria-label="t('Right now')"
:aria-hidden="page !== 2"
>
<div class="k">{{ t('RIGHT NOW') }} · {{ clock.big }}</div>
<div class="pg-facts">
<div v-for="f in facts" :key="f[1]"
><b :class="{ warn: f[2] }">{{ f[0] }}</b
><span>{{ t(f[1]) }}</span></div
>
</div>
</section>
</div>
<button
id="pgMin"
ref="minBtn"
class="pg-min"
type="button"
:aria-label="t('Minimise card')"
:aria-expanded="!cardMin"
@click.stop="
setCardMin(true);
nextTick(() => miniBtn?.focus());
"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 15l6-6 6 6" />
</svg>
</button>
<button
id="pgMini"
ref="miniBtn"
class="pg-mini"
type="button"
:aria-label="t('Expand card')"
@click.stop="
setCardMin(false);
cardPeek();
nextTick(() => minBtn?.focus());
"
>
<b>{{ k + 1 }}/{{ story.chapters.length }}</b
><span>{{ chTitle(chapter) }}</span>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 9l6 6 6-6" />
</svg>
</button>
<div
id="pgDots"
class="pg-dots"
role="group"
:aria-label="t('Card pages')"
>
<button
v-for="(lbl, i) in [
t('Chapter'),
t('On the map'),
t('Right now'),
]"
:key="i"
type="button"
:aria-label="lbl"
:aria-current="String(i === page)"
@click="setPage(i)"
></button>
</div>
</div>
<div id="ovClock" class="ov ov-clock">
<b>{{ clock.big }}</b
><span>{{ t(clock.small) }}</span>
<span class="pos"
>{{ posText.pos }}<i>{{ posText.alt }}</i></span
>
</div>
<div id="ovLegend" class="ov ov-legend">
<span v-for="l in layers" :key="l[2]" class="glass"
><i :class="legendClass(l)" :style="legendStyle(l)"></i
>{{ storyText(l[2]) }}</span
>
</div>
<div
v-if="bigPlay && !playback.playing"
id="ovPlay"
class="ov ov-play"
>
<button
id="btnBigPlay"
type="button"
:aria-label="t('Play story')"
@click="bigPlayClick"
>
<svg viewBox="0 0 24 24" fill="currentColor">
<path
d="M8 5.7v12.6c0 .9 1 1.4 1.7.9l9.7-6.3a1.1 1.1 0 0 0 0-1.8L9.7 4.8C9 4.3 8 4.8 8 5.7Z"
/>
</svg>
</button>
</div>
<button
id="btnCtx"
class="ov ov-ctxbtn tbtn"
type="button"
:aria-pressed="ctxOpen"
@click="ctxOpen = !ctxOpen"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
>
<rect x="4" y="4" width="16" height="16" rx="3" />
<path d="M14 4v16" />
</svg>
<span>{{ t('Context') }}</span>
</button>
<div v-if="hint" id="ovHint" class="ov ov-hint glass">{{ hint }}</div>
<StoryRail />
</div>
<StoryTimeline ref="timelineRef" :story="story" @anchor="goAnchor" />
</div>
<div
id="ctxResize"
class="ctx-resize"
role="separator"
aria-orientation="vertical"
:aria-label="t('Resize context panel')"
:aria-valuenow="contextWidth || undefined"
tabindex="0"
@pointerdown="onResizeDown"
@pointermove="onResizeMove"
@pointerup="onResizeUp"
@pointercancel="onResizeUp"
@dblclick="onResizeReset"
@keydown="onResizeKey"
></div>
<StoryContext
:story="story"
:nudge="nudge"
@chapter="goChapter"
@anchor="goAnchor"
@open="(id) => store.controller.openStory(id, { autoplay: true })"
@hide="ctxOpen = false"
/>
<div
v-if="sheetHint"
id="sheetHint"
class="sheet-hint"
aria-hidden="true"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.4"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 19V5M6 11l6-6 6 6" />
</svg>
{{ t('Swipe up for context') }}
</div>
</div>
</section>
</template>
+560
View File
@@ -0,0 +1,560 @@
<script setup>
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import { chapterAt } from '../../../stories/format.js';
import {
chapterTitle,
clamp,
clockText,
fmtDur,
storyText,
} from '../../../stories/storyMeta.js';
/**
* The story timeline (prototype `.timeline`): chapter segments with
* magnetic ticks, key-moment pips, a scrub bubble, sound and expand.
* Positions are wall milliseconds on the GEV scene's own clock.
*/
const props = defineProps({ story: { type: Object, required: true } });
const emit = defineEmits(['anchor']);
const store = useStoriesStore();
const { playback, muted, expanded } = storeToRefs(store);
const dur = computed(
() => playback.value.durationMs || props.story.durationMs || 1,
);
const tNow = computed(() => playback.value.wallMs);
const pct = computed(() => clamp((tNow.value / dur.value) * 100, 0, 100));
const k = computed(() => chapterAt(props.story, tNow.value));
const chapters = computed(() => props.story.chapters);
const chTitle = (c) => chapterTitle(props.story, c);
const events = computed(() => props.story.events ?? []);
const seek = (ms) => store.controller.seek(clamp(ms, 0, dur.value - 10));
// ── Play button: pause while playing, resume while exploring, otherwise play ──
const ICON = {
pause:
'<rect x="6.5" y="5" width="4" height="14" rx="1.4"/><rect x="13.5" y="5" width="4" height="14" rx="1.4"/>',
play: '<path d="M8 5.7v12.6c0 .9 1 1.4 1.7.9l9.7-6.3a1.1 1.1 0 0 0 0-1.8L9.7 4.8C9 4.3 8 4.8 8 5.7Z"/>',
resume:
'<path d="M4.5 12a7.5 7.5 0 1 0 2.2-5.3" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/><path d="M3.5 3.8v4.6h4.6" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>',
};
const playMode = computed(() =>
playback.value.exploring && !playback.value.playing
? 'resume'
: playback.value.playing
? 'pause'
: 'play',
);
function togglePlay() {
if (playMode.value === 'resume') store.controller.resume();
else if (playback.value.playing) store.controller.pause();
else store.controller.play();
}
// ── Segments ──
const segs = computed(() =>
chapters.value.map((c, i) => {
const a = (c.wallMs / dur.value) * 100;
const next =
i + 1 < chapters.value.length ? chapters.value[i + 1].wallMs : dur.value;
const b = (next / dur.value) * 100;
const fill =
clamp((tNow.value - c.wallMs) / (next - c.wallMs || 1), 0, 1) * 100;
return {
i,
style: {
left: `calc(${a}% + ${i ? 2 : 0}px)`,
width: `calc(${b - a}% - ${i ? 2 : 0}px - ${i + 1 < chapters.value.length ? 2 : 0}px)`,
},
fill: `${fill}%`,
};
}),
);
// ── Readout ──
const clock = computed(() =>
clockText(props.story, tNow.value, playback.value.worldMs, k.value),
);
const stampAt = (ms) => fmtDur(ms);
const headTime = computed(() => `${fmtDur(tNow.value)} / ${fmtDur(dur.value)}`);
const atEdge = computed(
() => props.story.live && tNow.value >= dur.value - 600,
);
// ── Scrubbing: magnetic chapter ticks, momentum, haptic ticks ──
const track = ref(null);
const scrubbing = ref(false);
const snap = ref(-1);
const hovered = ref(-1);
const ghost = ref(0);
const bubbleAt = ref(null);
let sc = null;
let coastRaf = 0;
let pipSnap = -1;
const reduceMotion = () =>
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
const haptic = () => {
try {
navigator.vibrate?.(3);
} catch {
/* no haptics here */
}
};
function trackAt(clientX) {
const r = track.value.getBoundingClientRect();
let u = clamp((clientX - r.left) / r.width, 0, 1);
let snapped = -1;
chapters.value.forEach((c, i) => {
if (i && Math.abs(u - c.wallMs / dur.value) * r.width < 9) {
u = c.wallMs / dur.value;
snapped = i;
}
});
return { t: u * dur.value, snapped };
}
function scrubTo(target) {
const w = track.value.getBoundingClientRect().width || 1;
let tt = clamp(target, 0, dur.value - 10);
let snapped = -1;
chapters.value.forEach((c, i) => {
if (i && (Math.abs(tt - c.wallMs) / dur.value) * w < 6) {
tt = c.wallMs;
snapped = i;
}
});
let pip = -1;
if (snapped < 0)
events.value.forEach((ev, i) => {
if ((Math.abs(tt - ev.wallMs) / dur.value) * w < 5) {
tt = ev.wallMs;
pip = i;
}
});
if (pip >= 0 && pip !== pipSnap) haptic();
pipSnap = pip;
if (pip >= 0) snapped = -2 - pip;
const ch = chapterAt(props.story, tt);
if (sc && ch !== sc.ch) {
haptic();
sc.ch = ch;
}
seek(tt);
snap.value = snapped;
bubbleAt.value = tt;
return snapped >= 0 || snapped <= -2 ? Math.max(0, snapped) : -1;
}
function onDown(e) {
if (e.target.closest('.tl-pip')) return;
try {
track.value.setPointerCapture(e.pointerId);
} catch {
/* nothing to capture */
}
cancelAnimationFrame(coastRaf);
scrubbing.value = true;
const r = trackAt(e.clientX);
sc = {
lastX: e.clientX,
lastT: performance.now(),
v: 0,
ch: chapterAt(props.story, r.t),
at: r.t,
};
seek(r.t);
snap.value = r.snapped;
bubbleAt.value = r.t;
}
function onMove(e) {
if (!scrubbing.value) {
if (e.target.closest('.tl-pip')) return;
const r = trackAt(e.clientX);
ghost.value = (r.t / dur.value) * 100;
hovered.value = chapterAt(props.story, r.t);
snap.value = r.snapped;
if (r.snapped < 0) {
const w = track.value.clientWidth || 1;
const i = events.value.findIndex(
(ev) => (Math.abs(ev.wallMs - r.t) / dur.value) * w < 5,
);
if (i >= 0) snap.value = -2 - i;
}
bubbleAt.value = r.t;
return;
}
// Slow drags are fine, fast drags coarse.
const now = performance.now();
const dx = e.clientX - sc.lastX;
const dtm = Math.max(1, now - sc.lastT);
const w = track.value.getBoundingClientRect().width || 1;
const gain = clamp(0.25 + (Math.abs(dx) / dtm) * 1.1, 0.25, 2.5);
const before = sc.at;
sc.at = clamp(sc.at + (dx / w) * dur.value * gain, 0, dur.value - 10);
scrubTo(sc.at);
sc.v = (sc.at - before) / dtm;
sc.lastX = e.clientX;
sc.lastT = now;
}
function onUp() {
scrubbing.value = false;
snap.value = -1;
pipSnap = -1;
if (
!sc ||
reduceMotion() ||
Math.abs(sc.v) < 2 ||
performance.now() - sc.lastT > 120
) {
sc = null;
return;
}
// A release coasts with momentum, stopping on a chapter tick.
let v = sc.v * 16;
let at = sc.at;
const coast = () => {
at += v;
const hit = scrubTo(at);
v *= 0.92;
if (hit >= 0 || Math.abs(v) < 20 || at <= 0 || at >= dur.value - 20) {
snap.value = -1;
sc = null;
return;
}
coastRaf = requestAnimationFrame(coast);
};
coastRaf = requestAnimationFrame(coast);
}
function onLeave() {
if (scrubbing.value) return;
ghost.value = 0;
hovered.value = -1;
snap.value = -1;
bubbleAt.value = null;
}
// The bubble follows the knob while playing and the pointer while hovering.
const bubbleT = computed(() => bubbleAt.value ?? tNow.value);
const bubbleK = computed(() => chapterAt(props.story, bubbleT.value));
const bubbleClock = computed(() =>
clockText(
props.story,
bubbleT.value,
bubbleAt.value == null ? playback.value.worldMs : null,
bubbleK.value,
),
);
const bubbleEm = computed(() => {
if (snap.value >= 0) return { text: t('Chapter start'), color: null };
if (snap.value <= -2) {
const ev = events.value[-2 - snap.value];
return ev ? { text: storyText(ev.label), color: ev.color } : null;
}
return null;
});
const bubbleEl = ref(null);
const bubbleStyle = computed(() => {
const w = track.value?.clientWidth || 1;
const half = (bubbleEl.value?.offsetWidth || 120) / 2;
const x = (bubbleT.value / dur.value) * w;
const bx = clamp(x, half, Math.max(half, w - half));
return {
left: `${bx}px`,
'--caret': `${clamp(x - bx + half, 8, half * 2 - 8)}px`,
};
});
// The bubble's picture: the story's card picture, when it has one.
const prevSrc = computed(() => store.thumbs?.[props.story.id] || '');
const prevCanvas = ref(null);
function drawPreview() {
const cv = prevCanvas.value;
const src = prevSrc.value;
if (!cv || !src) return;
const img = new Image();
img.onload = () =>
cv.getContext('2d')?.drawImage(img, 0, 0, cv.width, cv.height);
img.src = src;
}
watch(prevSrc, drawPreview, { flush: 'post' });
onMounted(drawPreview);
// ── Key moments ──
const tip = ref(null);
function tipFor(i) {
const ev = events.value[i];
if (!ev) return;
const w = track.value?.clientWidth || 1;
tip.value = {
ev,
left: clamp((ev.wallMs / dur.value) * w, 90, Math.max(90, w - 90)),
};
}
function pipClick(i) {
haptic();
emit('anchor', events.value[i]);
setTimeout(() => (tip.value = null), 900);
}
// ── Keyboard on the track ──
function goChapter(i) {
seek(chapters.value[i].wallMs + 1);
if (playback.value.exploring) store.controller.resume();
}
// Previous goes to the start of this chapter first, like a video player.
function stepChapter(d) {
const kk = k.value;
const list = chapters.value;
if (d > 0 && kk === list.length - 1) {
seek(dur.value);
return;
}
const to =
d > 0
? Math.min(list.length - 1, kk + 1)
: tNow.value - list[kk].wallMs > 1500
? kk
: Math.max(0, kk - 1);
goChapter(to);
}
function onKey(e) {
if (e.target !== track.value) return;
// A key the timeline handles is the timeline's alone.
const handled = () => {
e.preventDefault();
e.stopPropagation();
};
let tt = tNow.value;
if (e.shiftKey && (e.key === 'ArrowRight' || e.key === 'ArrowLeft')) {
stepChapter(e.key === 'ArrowRight' ? 1 : -1);
handled();
return;
}
if (e.key === 'PageUp') tt += dur.value / 10;
else if (e.key === 'PageDown') tt -= dur.value / 10;
else if (/^[0-9]$/.test(e.key)) tt = dur.value * (+e.key / 10);
else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') tt += 2000;
else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') tt -= 2000;
else if (e.key === 'Home') tt = 0;
else if (e.key === 'End') tt = dur.value;
else if (e.key === ']') {
goChapter(Math.min(chapters.value.length - 1, k.value + 1));
handled();
return;
} else if (e.key === '[') {
goChapter(Math.max(0, k.value - 1));
handled();
return;
} else if (e.key === ' ' || e.key === 'Enter') {
togglePlay();
handled();
return;
} else return;
handled();
seek(tt);
}
// ── Sound, expand ──
const VOL = {
off: '<path d="M4 9.5h3.5L12 5.5v13l-4.5-4H4z" fill="currentColor" stroke="none"/><path d="M16 9.5l5 5M21 9.5l-5 5"/>',
on: '<path d="M4 9.5h3.5L12 5.5v13l-4.5-4H4z" fill="currentColor" stroke="none"/><path d="M15.5 9a4.5 4.5 0 0 1 0 6M18 6.5a8 8 0 0 1 0 11"/>',
};
function toggleExpand() {
store.expanded = !store.expanded;
store.ctxOpen = false;
setTimeout(() => store.controller.reframe(), 320);
}
function jumpLive() {
seek(dur.value);
if (playback.value.exploring) store.controller.resume();
}
onBeforeUnmount(() => cancelAnimationFrame(coastRaf));
defineExpose({ goChapter });
</script>
<template>
<div id="timeline" class="timeline" :data-kind="story.live ? 'live' : ''">
<button
id="tlPlay"
class="tl-play"
:class="{ resume: playMode === 'resume' }"
type="button"
:aria-label="
playMode === 'resume'
? t('Resume story')
: playMode === 'pause'
? t('Pause')
: t('Play')
"
@click="togglePlay"
>
<svg
id="tlIcon"
viewBox="0 0 24 24"
fill="currentColor"
v-html="ICON[playMode]"
></svg>
</button>
<div
id="tlTrack"
ref="track"
class="tl-track"
:class="{ dragging: scrubbing, 'on-pip': !!tip }"
role="slider"
tabindex="0"
:aria-label="t('Story time')"
aria-valuemin="0"
aria-valuemax="100"
:aria-valuenow="Math.round(pct)"
:aria-valuetext="`${clock.big}, ${t('chapter')} ${k + 1}: ${chTitle(chapters[k])}`"
@pointerdown="onDown"
@pointermove="onMove"
@pointerup="onUp"
@pointercancel="onUp"
@pointerleave="onLeave"
@keydown="onKey"
>
<div class="tl-rail">
<div id="tlFill" class="tl-fill" :style="{ width: `${pct}%` }"></div>
</div>
<div id="tlTicks">
<span
v-for="s in segs"
:key="s.i"
class="tl-seg"
:class="{ now: s.i === k, hov: s.i === hovered, snap: s.i === snap }"
:data-k="s.i"
:style="s.style"
><i :style="{ width: s.fill }"></i
></span>
</div>
<div
id="tlGhost"
class="tl-ghost"
:style="{ width: `${ghost}%` }"
aria-hidden="true"
></div>
<div id="tlHead" class="tl-head" aria-hidden="true">
<span id="tlHeadCh"
><b>{{ k + 1 }}</b
>/{{ chapters.length }} · {{ chTitle(chapters[k]) }}</span
>
<span id="tlHeadTime">{{ headTime }}</span>
</div>
<div id="tlPips" role="group" :aria-label="t('Key moments')">
<button
v-for="(ev, i) in events"
:key="i"
type="button"
class="tl-pip"
:class="{ snap: snap === -2 - i }"
:data-e="i"
:aria-label="t('Key moment: {label}', { label: storyText(ev.label) })"
:style="{ left: `${(ev.wallMs / dur) * 100}%`, color: ev.color }"
@pointerdown.stop
@pointerover="tipFor(i)"
@pointerout="tip = null"
@focus="tipFor(i)"
@blur="tip = null"
@click.stop="pipClick(i)"
@keydown.space.stop
@keydown.enter.stop
>
<i :style="{ background: ev.color }"></i>
</button>
</div>
<div
v-if="tip"
id="tlTip"
class="tl-tip"
role="tooltip"
:style="{ left: `${tip.left}px` }"
>
<i :style="{ background: tip.ev.color }"></i
><b>{{ storyText(tip.ev.label) }}</b
><span>{{ stampAt(tip.ev.wallMs) }}</span>
</div>
<div class="tl-knob" :style="{ left: `${pct}%` }"></div>
<div
id="tlBubble"
ref="bubbleEl"
class="tl-bubble"
:data-snap="snap >= 0 ? 'ch' : snap <= -2 ? 'pip' : ''"
:style="bubbleStyle"
>
<canvas
v-if="prevSrc"
id="tlPrev"
ref="prevCanvas"
width="320"
height="180"
aria-hidden="true"
></canvas>
<div id="tlBubbleTxt">
<b>{{ bubbleK + 1 }} · {{ chTitle(chapters[bubbleK]) }}</b>
<span class="tt">{{ bubbleClock.big }}</span>
<em
v-if="bubbleEm"
:style="bubbleEm.color ? { color: bubbleEm.color } : null"
>{{ bubbleEm.text }}</em
>
</div>
</div>
</div>
<span id="tlTime" class="tl-time" aria-hidden="true">
<b v-if="story.live">{{ clock.big }}</b>
<span v-else class="tt-c">{{ headTime }}</span>
</span>
<button
v-if="story.live"
id="tlLive"
class="tl-live"
:class="{ edge: atEdge }"
type="button"
:aria-label="t('Jump to live')"
@click="jumpLive"
>
<i></i>{{ t('LIVE') }}
</button>
<button
id="tlVol"
class="tl-vol"
type="button"
:aria-label="muted ? t('Unmute') : t('Mute')"
:aria-pressed="!muted"
@click="muted = !muted"
>
<svg
id="tlVolIcon"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.9"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
v-html="muted ? VOL.off : VOL.on"
></svg>
</button>
<button
id="stExpand"
class="tl-vol"
type="button"
:aria-label="expanded ? t('Exit expanded map') : t('Expand map')"
:aria-pressed="expanded"
@click="toggleExpand"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.9"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
</svg>
</button>
</div>
</template>
+2
View File
@@ -203,6 +203,8 @@ export function createWildlifeSightingCard({
const keydown = (event) => {
if (!selected.value || event.key !== 'Escape') return;
// Stories owns Escape while it is open (the card is behind it).
if (documentRef.body?.classList?.contains?.('stories-mode')) return;
event.preventDefault();
event.stopImmediatePropagation();
layer.clearSightingSelection();
+11
View File
@@ -444,6 +444,17 @@ export function createGevActionRunner({
runOptions = {},
) {
const args = rawArgs && typeof rawArgs === 'object' ? rawArgs : {};
// Stories covers GEV and owns its camera and scenes: an open-mic session
// must not fly, load or change what is behind it.
if (globalThis.document?.body?.classList?.contains?.('stories-mode'))
return {
ok: false,
action: name,
applied: false,
refused: 'stories-open',
error: 'Stories is open. Close Stories first.',
say: 'Stories is open. Close Stories first to control the globe.',
};
const current = () =>
!runOptions.signal?.aborted &&
(typeof runOptions.isCurrent !== 'function' || runOptions.isCurrent());
+42
View File
@@ -258,6 +258,48 @@ test('zoom to globe adopts the shared visible reset route and returns its result
assert.equal(calls, 1);
});
test('voice changes nothing behind Stories while it is open', async () => {
globalThis.window = globalThis.window || {
clearTimeout,
setTimeout,
requestIdleCallback: null,
};
const viewer = {
clock: { onTick: { addEventListener: () => () => {} } },
scene: { canvas: { addEventListener() {}, removeEventListener() {} } },
camera: { moveEnd: { addEventListener() {} } },
};
let calls = 0;
const styleManager = {
async resetToGlobeView() {
calls += 1;
return { ok: true };
},
};
const runner = createGevActionRunner({
viewer,
styleManager,
dataManager: { layers: new Map(), getAll: () => [] },
});
const classes = new Set(['stories-mode']);
const priorDocument = globalThis.document;
globalThis.document = {
...(priorDocument ?? {}),
body: { classList: { contains: (c) => classes.has(c) } },
};
try {
const refused = await runner('zoom_to_globe');
assert.equal(refused.ok, false);
assert.equal(refused.refused, 'stories-open');
assert.equal(calls, 0);
classes.clear();
await runner('zoom_to_globe');
assert.equal(calls, 1, 'works again once Stories has closed');
} finally {
globalThis.document = priorDocument;
}
});
test('dependent voice navigation waits for the destination viewport to arrive', async () => {
globalThis.window = globalThis.window || {
clearTimeout,
+3 -1
View File
@@ -55,9 +55,11 @@ export class RealtimeInput {
bindPushToTalkShortcut() {
if (this.shortcutKeyDownHandler) return;
this.shortcutKeyDownHandler = (event) => {
// Space types in chat; it never talks while chat is open.
// Space types in chat; it never talks while chat is open, nor while
// Stories owns the keyboard (body.stories-mode).
if (
this.ui.state?.chat?.open === true ||
globalThis.document?.body?.classList?.contains?.('stories-mode') ||
!shouldHandlePushToTalkKeyDown(event)
)
return;
+1
View File
@@ -55,4 +55,5 @@
@import './src/ui/styles/cockpit-panels.css';
@import './src/ui/styles/ai-chat.css';
@import './src/ui/styles/scope-off-shadows.css';
@import './src/ui/styles/stories-entry.css';
@import './src/ui/styles/cyber.css';