Merge origin/main into byrdit/cctv-visible-only-fetch

This commit is contained in:
German Khokhlov committed 2026-11-19 18:33:29 +04:00
commit d19ae89630
445 files changed
+27359 -9232

No files matched your search

+2 -46
View File
@@ -126,10 +126,8 @@ const tickStyle = (tick) =>
<div v-if="generic && hud.veil" class="cockpit-veil" :class="{ streaks: hud.veil.streaks }" :style="veilStyle" aria-hidden="true"></div>
<!-- In orbit the picture keeps only the nadir reticle, readout and zoom. -->
<CockpitOrbital v-if="orbital" />
<!-- One optical coordinate system: every targeting mark shares this center.
Decorative only; telemetry and interactive panels remain separate.
A bridge looks out through straight window mullions instead: a header
beam, two pane posts and the sill either side of the console. -->
<!-- A bridge looks out through straight window mullions: a header beam,
two pane posts and the sill either side of the console. -->
<svg v-if="bridge" class="cockpit-frame-lines cockpit-bridge-frame" viewBox="0 0 1200 720" preserveAspectRatio="none" aria-hidden="true" focusable="false">
<g fill="none" stroke="currentColor">
<path d="M0 96H1200 M0 101H1200"/>
@@ -137,48 +135,6 @@ const tickStyle = (tick) =>
<path d="M0 600H324 M876 600H1200"/>
</g>
</svg>
<svg v-else-if="!orbital && !generic" class="cockpit-frame-lines" viewBox="0 0 1200 720" preserveAspectRatio="none" aria-hidden="true" focusable="false">
<g fill="none" stroke="currentColor">
<path d="M42 106H234L266 126H334 M866 126H934L966 106H1158 M42 114H226L258 136H318 M882 136H942L974 114H1158"/>
<path d="M42 616H226L254 598H320 M880 598H946L974 616H1158 M42 624H238L266 606H330 M870 606H934L962 624H1158"/>
<path d="M322 650H878L858 622H728L708 634H492L472 622H342Z M348 659H852"/>
<path d="M72 160H144L158 174V186 M1056 160H1128L1142 174V186 M72 562H144L158 548V536 M1056 562H1128L1142 548V536"/>
</g>
<path class="cockpit-frame-warning" d="M338 645H476L490 654H710L724 645H862" fill="none"/>
<path class="cockpit-frame-meter" d="M372 642H418 M782 642H828"/>
</svg>
<div v-if="!bridge && !orbital && !generic" class="cockpit-scan-array" aria-hidden="true">
<svg class="cockpit-target-geometry" viewBox="0 0 600 600" fill="none" focusable="false">
<g class="cockpit-target-hairline">
<circle cx="300" cy="300" r="276"/>
<circle class="cockpit-target-drift" cx="300" cy="300" r="250" stroke-dasharray="1 13"/>
<circle cx="300" cy="300" r="164"/>
<path d="M190 237V363 M410 237V363 M99 227H139 M461 227H501 M99 373H139 M461 373H501"/>
<path d="M86 113H118L134 129 M514 113H482L466 129 M86 487H118L134 471 M514 487H482L466 471"/>
</g>
<g class="cockpit-target-side-arcs">
<path d="M70 167A266 266 0 0 0 70 433 M530 167A266 266 0 0 1 530 433"/>
</g>
<g class="cockpit-target-ticks">
<path d="M166 125A220 220 0 0 1 434 125 M166 475A220 220 0 0 0 434 475"/>
</g>
<g class="cockpit-target-dots">
<path d="M180 130A208 208 0 0 1 420 130 M180 470A208 208 0 0 0 420 470"/>
</g>
<g class="cockpit-target-warning-dots">
<path d="M172 112A227 227 0 0 1 428 112 M172 488A227 227 0 0 0 428 488"/>
</g>
<g class="cockpit-target-core">
<!-- One outer ring and a spaced rotor leave the aiming center open. -->
<circle class="cockpit-target-orbit" cx="300" cy="300" r="132" stroke-dasharray="186 21"/>
<circle class="cockpit-target-rotor" cx="300" cy="300" r="104" stroke-dasharray="128 35" transform="rotate(9 300 300)"/>
<path class="cockpit-target-spokes" d="M206 206L250 250 M350 350L394 394 M394 206L350 250 M250 350L206 394"/>
<path d="M168 291H180V309H168 M432 291H420V309H432"/>
<circle cx="206" cy="206" r="3"/><circle cx="394" cy="206" r="3"/>
<circle cx="206" cy="394" r="3"/><circle cx="394" cy="394" r="3"/>
</g>
</svg>
</div>
<div v-if="!orbital" class="cockpit-visor-shell" aria-hidden="true">
<!-- A ship's bridge keeps no roll arc or pitch ladder. -->
<div v-if="!bridge && !generic" class="cockpit-roll-arc">
+4 -4
View File
@@ -79,7 +79,7 @@ function selectMapSource(chip) {
<span class="panel-divider"></span>
</button>
<div id="control-panel-popover" class="dock-popover-content">
<UiButton variant="icon" class="dock-pin-btn" data-pin-target="control-panel" :label="t('Pin visual presets')" :title="t('Keep visual presets open')" :pressed="!!panels['control-panel']?.pinned" @click="pin($event, 'control-panel')"><img src="/pin.svg" alt="" /></UiButton>
<UiButton class="dock-pin-btn" data-pin-target="control-panel" :label="t('Pin visual presets')" :title="t('Keep visual presets open')" :pressed="!!panels['control-panel']?.pinned" @click="pin($event, 'control-panel')"><img src="/pin.svg" alt="" /></UiButton>
<div id="style-buttons" class="button-grid">
<button class="style-btn active" data-style="normal" @click="display.act('setStyle', 'normal')" v-class-toggle="{ ...(style && { active: style.name === 'normal' }) }" :title="t('Show the globe without a visual filter.')">
<span class="btn-icon">◯</span>
@@ -144,7 +144,7 @@ function selectMapSource(chip) {
<div id="location-mini-poi" class="location-mini-poi">{{ loc ? loc.status.poi : t('Landmark: --') }}</div>
</div>
<div id="location-bar-popover" class="dock-popover-content">
<UiButton variant="icon" class="dock-pin-btn" data-pin-target="location-bar" :label="t('Pin location tray')" :title="t('Keep location tray open')" :pressed="!!panels['location-bar']?.pinned" @click="pin($event, 'location-bar')"><img src="/pin.svg" alt="" /></UiButton>
<UiButton class="dock-pin-btn" data-pin-target="location-bar" :label="t('Pin location tray')" :title="t('Keep location tray open')" :pressed="!!panels['location-bar']?.pinned" @click="pin($event, 'location-bar')"><img src="/pin.svg" alt="" /></UiButton>
<div id="poi-row" class="poi-row-container" v-class-toggle="{ expanded: !!loc?.poisExpanded }"><UiButton v-for="poi in loc?.pois" :key="`${loc.poiCity}:${poi.index}`" class="poi-pill" :pressed="Boolean(poi.active)" pressed-class="active" :data-poi-index="poi.index" @click="locationControls?.choosePoi(poi.index)"><span class="poi-pill-key">{{ poi.key }}</span><span class="poi-pill-name">{{ poi.name }}</span></UiButton></div>
<div class="location-bar-divider" id="location-bar-divider" v-class-toggle="{ visible: !!loc?.poisExpanded }"></div>
<div class="location-city-row">
@@ -153,10 +153,10 @@ function selectMapSource(chip) {
<button id="search-toggle" class="search-toggle-btn" :title="t('Search any location')" @click="locationControls?.toggleSearch()">
<span>&#x1F50E;</span>
</button>
<input type="text" id="location-search" v-class-toggle="{ expanded: !!loc?.searchExpanded, searching: !!loc?.searching }" :placeholder="t('Search any location...')" autocomplete="off" spellcheck="false" :aria-label="t('Search location by name or coordinates')" :aria-invalid="loc?.searchError ? 'true' : null" :aria-describedby="loc?.searchError ? 'location-search-error' : null" />
<input type="text" id="location-search" v-class-toggle="{ expanded: !!loc?.searchExpanded, searching: !!loc?.searching }" :placeholder="t('Search any location...')" autocomplete="off" spellcheck="false" :aria-label="t('Search location by name or coordinates')" :aria-invalid="loc?.searchOrigin !== 'omnibar' && loc?.searchError ? 'true' : null" :aria-describedby="loc?.searchOrigin !== 'omnibar' && loc?.searchError ? 'location-search-error' : null" />
</div>
</div>
<p id="location-search-error" class="location-search-error" role="alert">{{ loc?.searchError }}</p>
<p id="location-search-error" class="location-search-error" role="alert">{{ loc?.searchOrigin === 'omnibar' ? '' : loc?.searchError }}</p>
</div>
</div>
</div>
+6 -21
View File
@@ -14,10 +14,10 @@ import AwarenessPanel from './panels/AwarenessPanel.vue';
import BhoteKoshiPanel from './panels/BhoteKoshiPanel.vue';
import EntityCard from './panels/EntityCard.vue';
import ViewContext from './panels/ViewContext.vue';
import MissionDetail from './panels/MissionDetail.vue';
import MissionRoster from './panels/MissionRoster.vue';
import SpaceMissionsPanel from './panels/SpaceMissionsPanel.vue';
import RadioPanel from './panels/RadioPanel.vue';
import UiButton from '../kit/UiButton.vue';
import UiSearchField from '../kit/UiSearchField.vue';
import { cockpitEntryFace } from '../cockpitPresentation.js';
import { LAYER_TABS, TAB_AFFECTS, activeTab, availableTabs, contextReady, enabledLayerIds, setEnabledLayers, tabTarget } from '../contextLayerTabs.js';
import { shownLayerName } from '../layerNames.js';
@@ -75,7 +75,7 @@ const setPane = (id) => (el) => {
if (target instanceof HTMLElement && target.parentElement !== el) el.appendChild(target);
}
};
// Turning Radio or Launches on asks for the main tab, where they show.
// Turning on Radio reveals the Inspector.
const showView = () => (activeTab.value = 'view');
onMounted(() => {
globalThis.addEventListener?.('gev:context-show-view', showView);
@@ -190,13 +190,7 @@ watch(
</button>
</template>
<div class="cyber-panel-body ui-scroll" data-rail-scroller>
<div v-if="contextSearchOpen" class="context-search" role="search">
<span class="material-symbols-outlined" aria-hidden="true">search</span>
<input ref="searchInput" v-model="contextSearchText" type="search" class="context-search__input" :placeholder="searchHint" :aria-label="searchHint" autocomplete="off" spellcheck="false" @keydown.esc.stop="closeContextSearch" />
<button v-if="contextSearchText" type="button" class="context-search__clear" :aria-label="t('Clear search')" :title="t('Clear search')" @click="contextSearchText = ''; searchInput?.focus()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
</div>
<UiSearchField v-if="contextSearchOpen" ref="searchInput" v-model="contextSearchText" class="context-search" role="search" input-class="context-search__input" :label="searchHint" :placeholder="searchHint" autocomplete="off" spellcheck="false" :clear-label="t('Clear search')" clear-class="context-search__clear" @escape="closeContextSearch" />
<div v-if="availableTabs.length" class="context-tabs" role="tablist" :aria-label="t('Context tabs')">
<button id="context-tab-btn-view" type="button" role="tab" class="context-tabs__tab" :class="{ active: activeTab === 'view' }" :aria-selected="String(activeTab === 'view')" aria-controls="context-tab-view" :tabindex="activeTab === 'view' ? 0 : -1" @click="activeTab = 'view'" @keydown.left.prevent="switchTab" @keydown.right.prevent="switchTab">
<span class="material-symbols-outlined" aria-hidden="true">visibility</span><span class="context-tabs__label">{{ t('Inspector') }}</span>
@@ -221,14 +215,10 @@ watch(
<span class="material-symbols-outlined" aria-hidden="true">radar</span>
<span>{{ t('CONTACTS') }}</span>
</button>
<button id="global-context-missions-btn" class="context-mode-button" v-class-toggle="{ active: ctx?.missionsActive }" type="button" role="tab" tabindex="0" :aria-selected="String(ctx?.missionsActive ?? false)" :aria-disabled="ctx && String(ctx.busy)" :aria-busy="ctx && String(ctx.busy)" aria-controls="context-missions-view">
<span class="material-symbols-outlined" aria-hidden="true">rocket_launch</span>
<span>{{ t('SPACE MISSIONS') }}</span>
</button>
</div>
<div id="context-mode-standby" class="context-mode-standby" :hidden="ctx?.enabled">
<strong>{{ t('SELECT CONTEXT') }}</strong>
<span>{{ t('CONTACTS — nearest planes · vessels · sites') }}<br>{{ t('SPACE MISSIONS — launches & orbital assets') }}</span>
<span>{{ t('CONTACTS — nearest planes · vessels · sites') }}</span>
</div>
<section id="context-flights-view" class="context-mode-view" role="tabpanel" aria-labelledby="global-context-flights-btn" :hidden="!ctx?.flightsActive">
<div class="global-context-actions" :aria-label="t('Contact Context actions')">
@@ -241,12 +231,6 @@ watch(
</div>
<AwarenessPanel v-if="!contactsMatchCard" />
</section>
<section id="context-missions-view" class="context-mode-view" role="tabpanel" aria-labelledby="global-context-missions-btn" :hidden="!ctx?.missionsActive">
<div id="space-mission-panel-host">
<MissionRoster />
<MissionDetail />
</div>
</section>
<div v-if="contextOpen" v-show="activeTab === 'view'" id="context-tab-view" role="tabpanel" aria-labelledby="context-tab-btn-view" :class="{ 'context-searching': contextSearchOpen && contextSearchText.trim() }">
<EntityCard :with-contacts="contactsMatchCard">
<AwarenessPanel v-if="contactsMatchCard" compact />
@@ -255,6 +239,7 @@ watch(
</div>
</div>
</RailPanel>
<SpaceMissionsPanel />
<BhoteKoshiPanel />
</aside>
+2 -2
View File
@@ -78,7 +78,7 @@ async function importChosen(event) {
<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>
<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>
<UiButton tone="danger" 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>
<p class="scene-step-heading">{{ t('SHOTS') }}</p>
<div class="scene-controls">
@@ -90,7 +90,7 @@ async function importChosen(event) {
<p class="scene-step-heading">{{ t('PREVIEW') }}</p>
<div class="scene-controls">
<UiButton variant="primary" id="scene-start-btn" type="button" class="gev-action-button scene-btn scene-btn-primary" :title="t('Play from this scene through the rest of the project')" :disabled="off('start')" @click="scenes.act('start')">{{ scene?.playLabel ?? t('PLAY', { context: 'scene' }) }}</UiButton>
<UiButton tone="alert" id="scene-stop-btn" type="button" :disabled="off('stop')" @click="scenes.act('stop')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Stop playback (Esc)')">{{ t('STOP') }}</UiButton>
<UiButton tone="danger" id="scene-stop-btn" type="button" :disabled="off('stop')" @click="scenes.act('stop')" class="gev-action-button gev-action-button--danger scene-btn scene-btn-danger" :title="t('Stop playback (Esc)')">{{ t('STOP') }}</UiButton>
<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>
+7 -27
View File
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from 'pinia';
import { computed, onBeforeUnmount, onMounted, shallowRef } from 'vue';
import { computed } from 'vue';
import { t } from '../../i18n/index.js';
import { vClassToggle } from '../rail/classToggle.js';
import { vFieldValue } from '../rail/fieldValue.js';
@@ -8,6 +8,7 @@ import { vStatusText } from '../rail/statusText.js';
import { useLocaleStore } from '../stores/locale.js';
import { useProviderSettingsStore } from '../stores/providerSettings.js';
import LocalePicker from './panels/LocalePicker.vue';
import UiCloseButton from '../kit/UiCloseButton.vue';
const { picker } = storeToRefs(useLocaleStore());
// The key setup owner (src/keySetup.js) presents the chip, the dialog and its
@@ -18,23 +19,6 @@ const available = computed(() => view.value?.available !== false);
const chip = computed(() => view.value?.chip ?? null);
const dialog = computed(() => view.value?.dialog ?? { hidden: true, visible: false });
// Cyber puts the chip in the top toolbar; every other theme keeps it first in
// the corner row, beside the language picker.
const cyber = shallowRef(false);
let themeObserver = null;
onMounted(() => {
const theme = document.documentElement;
const sync = () => {
cyber.value =
theme.dataset.uiTheme === 'cyber' &&
Boolean(document.getElementById('top-center-actions'));
};
themeObserver = new MutationObserver(sync);
themeObserver.observe(theme, { attributes: true, attributeFilter: ['data-ui-theme'] });
sync();
});
onBeforeUnmount(() => themeObserver?.disconnect());
// The status line is a live region; vStatusText re-announces repeats.
const statusText = computed(() => ({
text:
@@ -55,21 +39,17 @@ const removeTitle = (title) =>
<!-- Bottom-right HUD row: the POWER UP chip (while keys are missing) and
the language picker, once the shell publishes it. -->
<div id="corner-actions">
<Teleport v-if="available" :to="cyber ? '#top-center-actions' : 'body'" :disabled="!cyber">
<button id="key-setup-chip" type="button" :hidden="!chip || chip.hidden" aria-haspopup="dialog" aria-controls="key-setup" :title="chip?.title" :aria-label="chip?.title" @click="controls?.open()">
<span class="material-symbols-outlined" aria-hidden="true">bolt</span>
<span data-key-setup-chip-label>{{ chip ? chip.label : t('POWER UP') }}</span>
</button>
</Teleport>
<button v-if="available" id="key-setup-chip" type="button" :hidden="!chip || chip.hidden" aria-haspopup="dialog" aria-controls="key-setup" :title="chip?.title" :aria-label="chip?.title" @click="controls?.open()">
<span class="material-symbols-outlined" aria-hidden="true">bolt</span>
<span data-key-setup-chip-label>{{ chip ? chip.label : t('POWER UP') }}</span>
</button>
<LocalePicker v-if="picker" :key="picker.current" :current="picker.current" :on-select="picker.onSelect" :focus="picker.focus" />
</div>
<aside v-if="available" id="key-setup" role="dialog" aria-labelledby="key-setup-title" aria-describedby="key-setup-description" :hidden="dialog.hidden" v-class-toggle="{ visible: dialog.visible }" :data-ready="view?.ready ? 'true' : undefined" @transitionend="controls?.transitionEnd()">
<div class="key-setup-scanline" aria-hidden="true"></div>
<header class="key-setup-header">
<span class="key-setup-kicker">{{ t('GROUND STATION · PROVIDER SETTINGS') }}</span>
<button type="button" class="key-setup-close" data-key-setup-close :aria-label="t('Close key setup')" @click="controls?.close()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="key-setup-close" glyph="icon" data-key-setup-close :label="t('Close key setup')" @click="controls?.close()" />
</header>
<h2 id="key-setup-title">{{ t('Power up the globe') }}</h2>
<p id="key-setup-description">{{ t('The globe already flies keyless. Every key below switches on another real feed — paste one and it\'s saved into this app\'s local configuration, then the server restarts itself. Server-side keys stay on this machine; Google Maps and Cesium ion run in the browser and must be provider-restricted. Keys you configured elsewhere are shown but never touched.') }}</p>
+2
View File
@@ -19,6 +19,7 @@ import AwarenessDirection from './panels/AwarenessDirection.vue';
import UiButton from '../kit/UiButton.vue';
import GlobeActions from './panels/GlobeActions.vue';
import { useGlobeActionsStore } from '../stores/globeActions.js';
import Omnibar from './panels/Omnibar.vue';
import RenderFailure from './panels/RenderFailure.vue';
import WorldTimeline from './panels/WorldTimeline.vue';
@@ -90,6 +91,7 @@ const vToastText = {
<!-- Top-center camera and share actions -->
<GlobeActions />
<Omnibar />
<div id="global-loading-status" role="status" aria-live="polite" aria-atomic="true" :hidden="loading ? loading.hidden : true" :data-state="loading?.state ?? undefined">
<SplitFlapText id="global-loading-label" :text="loading ? loading.label : t('LOADING LIVE DATA')" :stopped="!!loading?.stopped" />
<span id="global-loading-detail">{{ loading ? loading.detail : '' }}</span>
+1 -1
View File
@@ -161,7 +161,7 @@ function onRenameKey(shot, event) {
><UiIcon name="arrow_downward" :size="12"
/></UiButton>
<UiButton
tone="alert"
tone="danger"
class="gev-action-button gev-action-button--danger gev-action-button--compact scene-shot-btn scene-shot-danger"
@click="act('remove', shot)"
>{{ t('DEL') }}</UiButton
+6 -6
View File
@@ -18,6 +18,7 @@ import {
entryPlacement,
} from '../../stories/format.js';
import { guardStoriesKeyboard } from '../../stories/keyboard.js';
import UiButton from '../kit/UiButton.vue';
// 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.
@@ -318,18 +319,17 @@ watch([mode, storyId], () => nextTick(watchCredit));
<!-- GEV: the Stories entry, its first-visit popup and the Opened-in-GEV toast -->
<template v-if="mode === 'closed' && store.available">
<button
<UiButton
id="hStories"
class="tbtn accent gs-entry"
:class="{ 'gs-entry-compact': entry.compact }"
type="button"
:aria-label="entry.compact ? t('Stories') : undefined"
: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>
</UiButton>
<div
v-if="popOpen"
id="hPop"
@@ -342,14 +342,14 @@ watch([mode, storyId], () => nextTick(watchCredit));
<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>
<UiButton class="tbtn solid" @click="openExplore">{{ t('Browse stories') }}</UiButton>
<UiButton class="tbtn" @click="markPopSeen">{{ t('Not now') }}</UiButton>
</div>
</div>
<div v-if="openedToast" id="hToast" class="h-toast glass gs-opened-toast" role="status">
<b>{{ t('Opened in GEV') }}</b>
<span>{{ openedToast.title }} · {{ openedWhen }}</span>
<button class="tbtn" type="button" @click="backToStory">{{ t('Back to story') }}</button>
<UiButton class="tbtn" @click="backToStory">{{ t('Back to story') }}</UiButton>
</div>
</template>
+284 -54
View File
@@ -1,22 +1,148 @@
<script setup>
import { storeToRefs } from 'pinia';
import { nextTick, ref, watch } from 'vue';
import { msg, t } from '../../i18n/index.js';
import {
FIRST_RUN_TIP,
environmentalLabel,
} from '../../firstRunCopy.js';
import { FIRST_RUN_LINKS, environmentalLabel } from '../../firstRunCopy.js';
import UiButton from '../kit/UiButton.vue';
import UiCheckbox from '../kit/UiCheckbox.vue';
import UiIcon from '../kit/UiIcon.vue';
import { useFirstRunStore } from '../stores/firstRun.js';
import { useStoriesStore } from '../stores/stories.js';
// The launcher initFirstRunExperience presents, and the controls it connects.
const { launcher, controls } = storeToRefs(useFirstRunStore());
// The card stays hidden until it is initialized; these show in the markup.
const DESCRIPTION = msg(
'It feels like a forbidden cockpit—then you realize the sources are public and the data is real.',
);
const ENVIRONMENTAL_SUB = msg(
'Live earthquakes and active fires, from USGS and NASA',
);
// Where the visitor starts: a tile selects it, ENTER GOD MODE runs it. A clean
// globe unless they pick a mission.
const start = ref('explore');
const settling = ref(false);
function selectStart(choice) {
if (settling.value || launcher.value?.busy === 'true' || launcher.value?.closing) return;
start.value = choice;
}
// Three short steps instead of one dense card: mode, where to start, then the
// three things worth knowing. Back and Next move between them; Skip closes.
// The suppress box's hook, as one object, so the box is not rendered again
// with every render of the welcome.
const suppressBoxAttrs = { 'data-first-run-suppress': '' };
const STEPS = 3;
const step = ref(1);
const direction = ref('forward');
function go(next, event) {
if (event?.detail > 1) return;
if (settling.value || launcher.value?.busy === 'true' || launcher.value?.closing) return;
settling.value = true;
direction.value = next > step.value ? 'forward' : 'back';
step.value = Math.min(STEPS, Math.max(1, next));
}
// A press belongs to the step it began on: one begun while the steps were
// changing (and released after) runs nothing. Keyboard clicks (detail 0)
// have no press.
let pressedOn = null;
function onPrimaryDown() {
pressedOn = settling.value ? null : step.value;
}
// A quick second click still moves to the next step, so the button never
// looks dead; only the launch itself takes a single click, so a double click
// that began on NEXT never confirms the start it lands on.
function onPrimary(event) {
if (settling.value) return;
const pressed = pressedOn;
pressedOn = null;
if (event.detail >= 1 && pressed !== step.value) return;
if (step.value < STEPS) go(step.value + 1);
else if (event.detail <= 1) controls.value?.choose(start.value);
}
// GEV Stories opens in place: the card closes as Skip would, then Explore
// takes the globe. The Stories announcement stays hidden while Stories loads,
// so it does not flash up between the card closing and Explore opening; it is
// still not marked seen. The card is left out where Stories is not offered.
const stories = useStoriesStore();
let openingStories = false;
function openStories(event) {
if (event?.detail > 1) return;
if (settling.value || launcher.value?.busy === 'true' || launcher.value?.closing) return;
if (!stories.available || !stories.controller) return;
if (openingStories) return;
const body = globalThis.document?.body;
// Stories says at once whether it opens (it refuses while another mode
// holds the globe): only then does the card close, so a refusal never
// leaves nothing on screen.
const opening = stories.controller.open();
if (opening === false) return;
openingStories = true;
body?.classList.add('first-run-opening-stories');
controls.value?.dismiss();
Promise.resolve(opening)
.catch(() => {})
.finally(() => {
openingStories = false;
body?.classList.remove('first-run-opening-stories');
});
}
function onPrimaryKeydown(event) {
if (event.repeat) event.preventDefault();
}
function beforeStepEnter() {
globalThis.document?.querySelector('#first-run-launcher .first-run-choices')
?.scrollTo({ top: 0, behavior: 'instant' });
}
function afterStepEnter() {
settling.value = false;
controls.value?.refreshLayout();
}
// Keyboard users stay on the main action as the steps change.
watch(step, async () => {
await nextTick();
if (!launcher.value?.visible || launcher.value?.closing) return;
globalThis.document
?.querySelector('#first-run-launcher [data-first-run-primary]')
?.focus?.({ preventScroll: true });
});
const TITLES = [
msg('Welcome to God\'s Eye View'),
msg('Where do you want to start?'),
msg('Three things to know'),
];
const LEADS = [
msg('It feels like a forbidden cockpit—then you realize the sources are public and the data is real.'),
msg('Pick one to begin with. You can change everything later.'),
msg('That is all you need to get going.'),
];
// A callout opens from the chip's start edge unless that would run past the
// scrolling list, which clips it; then it opens from the end edge, and where
// neither side has room it narrows (and wraps) to the roomier side.
function alignCallout(event) {
const chip = event.target?.closest?.('[data-callout]');
const list = chip?.closest('.first-run-choices');
if (!chip || !list) return;
delete chip.dataset.calloutAlign;
chip.style.removeProperty('--first-run-callout-max');
const after = globalThis.getComputedStyle?.(chip, '::after');
const width = parseFloat(after?.width);
if (!Number.isFinite(width)) return;
const box = chip.getBoundingClientRect();
const bounds = list.getBoundingClientRect();
const inset = parseFloat(after.insetInlineStart) || 0;
const extra = ['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth']
.reduce((sum, key) => sum + (parseFloat(after[key]) || 0), 0);
const size = after.boxSizing === 'border-box' ? width : width + extra;
const rtl = globalThis.getComputedStyle?.(chip).direction === 'rtl';
const roomStart = rtl ? box.right - inset - bounds.left : bounds.right - box.left - inset;
const roomEnd = rtl ? bounds.right - box.left - inset : box.right - inset - bounds.left;
if (size <= roomStart) return;
if (roomEnd > roomStart) chip.dataset.calloutAlign = 'end';
if (size > Math.max(roomStart, roomEnd)) {
chip.style.setProperty('--first-run-callout-max', `${Math.floor(Math.max(roomStart, roomEnd))}px`);
}
}
// A refused save puts the box back where the stored preference is.
function onSuppress(event) {
const box = event.currentTarget;
@@ -25,62 +151,166 @@ function onSuppress(event) {
</script>
<template>
<!-- Explicit mission choice on a fresh session. Live feeds are not auto-enabled
<!-- Explicit first choice on a fresh session. Live feeds are not auto-enabled
until the visitor asks; shared links skip this surface entirely. It returns
every session until "Don't show this again" is ticked — see
src/firstRunExperience.js for the full show policy. -->
<!-- Tints the globe behind the card; click-through, so the card stays non-modal. -->
<div v-if="!launcher?.removed && launcher?.shown" class="first-run-backdrop" :class="{ visible: launcher?.visible }" aria-hidden="true"></div>
<aside v-if="!launcher?.removed" id="first-run-launcher" role="dialog" aria-labelledby="first-run-title" aria-describedby="first-run-description" :class="{ visible: launcher?.visible }" :hidden="!launcher?.shown" :aria-hidden="launcher?.closing ? 'true' : undefined" :aria-busy="launcher?.busy ?? undefined" :data-state="launcher?.state ?? undefined">
<div class="first-run-scanline" aria-hidden="true"></div>
<header class="first-run-header">
<span class="first-run-kicker">{{ t('MISSION CONTROL · FIRST LAUNCH') }}</span>
</header>
<h2 id="first-run-title">{{ t('Choose your first view') }}</h2>
<!-- The card's one persuasive line, owner-authored and VERBATIM (2026-08-23)
— including the unspaced em dash. The arc it has to carry: this looks
like something you should not have access to → the sources are all
public → the data is real. Tile subcopy stays purely functional. -->
<p id="first-run-description">{{ launcher?.description ?? DESCRIPTION }}</p>
<div class="first-run-choices ui-scroll" :data-scrollable="launcher?.scrollable ?? undefined">
<button type="button" data-first-run-choice="contacts" :aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose('contacts')">
<span class="material-symbols-outlined" aria-hidden="true">radar</span>
<span><strong>{{ t('LIVE CONTACTS') }}</strong><small>{{ t('Aircraft, vessels and nearby intelligence') }}</small></span>
<span class="material-symbols-outlined first-run-arrow" aria-hidden="true">arrow_forward</span>
</button>
<button type="button" data-first-run-choice="space-missions" :aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose('space-missions')">
<span class="material-symbols-outlined" aria-hidden="true">rocket_launch</span>
<span><strong>{{ t('SPACE MISSIONS') }}</strong><small>{{ t('Launches, spacecraft and orbital context') }}</small></span>
<span class="material-symbols-outlined first-run-arrow" aria-hidden="true">arrow_forward</span>
</button>
<button type="button" data-first-run-choice="environmental" :aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose('environmental')">
<span class="material-symbols-outlined" aria-hidden="true">local_fire_department</span>
<!-- The title is ENVIRONMENTAL_LABEL_CHOICE's label once initialized. -->
<!-- Subcopy names BOTH feeds this tile turns on, because the launcher
optimizes for the fully configured experience (owner ruling,
2026-08-23) — see the mission table in src/firstRunExperience.js. -->
<span><strong data-first-run-environmental-title>{{ launcher?.environmentalTitle ?? environmentalLabel().title }}</strong><small>{{ launcher?.environmentalSub ?? ENVIRONMENTAL_SUB }}</small></span>
<span class="material-symbols-outlined first-run-arrow" aria-hidden="true">arrow_forward</span>
</button>
<button type="button" class="first-run-explore" data-first-run-choice="explore" :aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose('explore')">
<span class="material-symbols-outlined" aria-hidden="true">public</span>
<span><strong>{{ t('EXPLORE MANUALLY') }}</strong><small>{{ t('Begin with a clean globe') }}</small></span>
<span class="material-symbols-outlined first-run-arrow" aria-hidden="true">arrow_forward</span>
</button>
</div>
<div class="first-run-footer">
<label class="first-run-suppress">
<input type="checkbox" data-first-run-suppress @change="onSuppress" />
<span>{{ t('Don\'t show this again') }}</span>
</label>
<ol role="img" class="first-run-dots" :aria-label="t('Step {step} of {total}', { step, total: STEPS })">
<li v-for="n in STEPS" :key="n" :class="{ on: n === step, done: n < step }" aria-hidden="true"></li>
</ol>
<!-- A button, not just a hint: phones and tablets have no ESC key. It
closes exactly as ESC does, for this session only. Touch screens
see DISMISS; a keyboard keeps the ESC hint (first-run.css). -->
<button type="button" class="first-run-dismiss" data-first-run-dismiss @click="controls?.dismiss()">
<span class="first-run-dismiss-key">{{ t('ESC to dismiss') }}</span>
<span class="first-run-dismiss-touch">{{ t('DISMISS') }}</span>
</button>
see SKIP; a keyboard sees SKIP · ESC (first-run.css). -->
<UiButton class="first-run-dismiss" data-first-run-dismiss @click="controls?.dismiss()">
<span class="first-run-dismiss-key">{{ t('SKIP · ESC') }}</span>
<span class="first-run-dismiss-touch">{{ t('SKIP') }}</span>
</UiButton>
</header>
<h2 id="first-run-title">{{ t(TITLES[step - 1]) }}</h2>
<p class="first-run-step-announcement" role="status" aria-live="polite" aria-atomic="true">{{ t(TITLES[step - 1]) }}</p>
<p id="first-run-description">{{ t(LEADS[step - 1]) }}</p>
<div class="first-run-choices ui-scroll" :data-scrollable="launcher?.scrollable ?? undefined">
<Transition :name="`first-run-step-${direction}`" mode="out-in" @before-enter="beforeStepEnter" @after-enter="afterStepEnter">
<div v-if="step === 1" key="1" class="first-run-step">
<section class="first-run-section" aria-labelledby="first-run-mode-heading">
<h3 id="first-run-mode-heading" class="first-run-section-title">{{ t('Choose your mode') }}</h3>
<div class="first-run-modes" role="list" aria-labelledby="first-run-mode-heading">
<div class="first-run-mode" role="listitem" data-first-run-mode="god">
<div class="first-run-preview first-run-preview--god" aria-hidden="true"><i><svg class="first-run-globe" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="1"><circle cx="32" cy="32" r="26" /><path d="M6 32h52M10 19h44M10 45h44" /><g class="first-run-meridians"><ellipse cx="32" cy="32" rx="26" ry="26" style="--m: 0" /><ellipse cx="32" cy="32" rx="26" ry="26" style="--m: 0.38" /><ellipse cx="32" cy="32" rx="26" ry="26" style="--m: 0.71" /><ellipse cx="32" cy="32" rx="26" ry="26" style="--m: 0.92" /></g></svg></i><svg class="first-run-callouts" viewBox="0 0 120 120" fill="none" stroke="currentColor" stroke-width="1"><path class="first-run-brackets" d="M8 18V8h10M102 8h10v10M112 102v10h-10M18 112H8v-10" /><circle class="first-run-orbit" cx="60" cy="60" r="34" /><g class="first-run-callout first-run-callout--a"><circle class="first-run-blip" cx="69" cy="50" r="1.6" /><circle class="first-run-ping" cx="69" cy="50" r="1.6" /><polyline class="first-run-leader" points="69,50 86,33 108,33" pathLength="1" /><path class="first-run-label" d="M88 29h18M88 37h11" /></g><g class="first-run-callout first-run-callout--b"><circle class="first-run-blip" cx="50" cy="71" r="1.6" /><circle class="first-run-ping" cx="50" cy="71" r="1.6" /><polyline class="first-run-leader" points="50,71 33,88 12,88" pathLength="1" /><path class="first-run-label" d="M14 84h18M14 92h11" /></g><g class="first-run-time"><line class="first-run-time-track" x1="26" y1="106" x2="94" y2="106" /><path class="first-run-time-ticks" d="M26 104v4 M34.5 105v2 M43 104v4 M51.5 105v2 M60 104v4 M68.5 105v2 M77 104v4 M85.5 105v2 M94 104v4" /><line class="first-run-time-played" x1="26" y1="106" x2="94" y2="106" /><g class="first-run-time-head"><line x1="26" y1="101" x2="26" y2="111" /><path d="M24 100h4l-2 2.5z" /></g></g></svg></div>
<div class="first-run-mode-body">
<p class="first-run-mode-title"><strong>{{ t('God') }}</strong> <span class="first-run-tag">{{ t('FUN') }}</span></p>
<p class="first-run-mode-copy">{{ t('The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.') }}</p>
<ul class="first-run-mode-points">
<li>{{ t('Keyhole HUD') }}</li>
<li>{{ t('Visual presets') }}</li>
</ul>
</div>
<span class="first-run-radio" aria-hidden="true"></span>
</div>
<div class="first-run-mode" role="listitem" data-first-run-mode="analyst">
<div class="first-run-preview first-run-preview--analyst" aria-hidden="true"><i></i></div>
<div class="first-run-mode-body">
<p class="first-run-mode-title"><strong>{{ t('Analyst') }}</strong> <span class="first-run-tag first-run-tag--soon">{{ t('COMING SOON') }}</span></p>
<p class="first-run-mode-copy">{{ t('A cleaner, readable view where every value shows its source. For research and reporting.') }}</p>
</div>
<span class="first-run-radio" aria-hidden="true"></span>
</div>
</div>
</section>
</div>
<div v-else-if="step === 2" key="2" class="first-run-step">
<section class="first-run-section" aria-labelledby="first-run-start-heading">
<h3 id="first-run-start-heading" class="first-run-section-title">{{ t('Start with') }}</h3>
<div class="first-run-missions first-run-missions--tiles" role="group" aria-labelledby="first-run-start-heading">
<UiButton data-first-run-start="space-missions" :pressed="start === 'space-missions'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('space-missions')">
<UiIcon name="rocket_launch" :size="null" />
<span><strong>{{ t('SPACE MISSIONS') }}</strong><small>{{ t('Launches, spacecraft and orbital context') }}</small></span>
</UiButton>
<UiButton data-first-run-start="environmental" :pressed="start === 'environmental'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('environmental')">
<UiIcon name="local_fire_department" :size="null" />
<!-- The title is ENVIRONMENTAL_LABEL_CHOICE's label once initialized. -->
<!-- Subcopy names BOTH feeds this tile turns on, because the launcher
optimizes for the fully configured experience (owner ruling,
2026-08-23) — see the mission table in src/firstRunExperience.js. -->
<span><strong data-first-run-environmental-title>{{ launcher?.environmentalTitle ?? environmentalLabel().title }}</strong><small>{{ launcher?.environmentalSub ?? t(ENVIRONMENTAL_SUB) }}</small></span>
</UiButton>
<UiButton data-first-run-start="explore" :pressed="start === 'explore'" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="selectStart('explore')">
<UiIcon name="public" :size="null" />
<span><strong>{{ t('EXPLORE MANUALLY') }}</strong><small>{{ t('Begin with a clean globe') }}</small></span>
</UiButton>
</div>
</section>
</div>
<div v-else key="3" class="first-run-step">
<ul class="first-run-tips">
<li class="first-run-tip first-run-tip--search">
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="search" :size="null" /><i class="first-run-tip-caret"></i></span>
<strong>{{ t('Search places') }}</strong>
<small>{{ t('Type a place into the search bar.') }}</small>
</li>
<li class="first-run-tip first-run-tip--layers">
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="layers" :size="null" /><i class="first-run-tip-dot"></i></span>
<strong>{{ t('Turn on layers') }}</strong>
<small>{{ t('Turn layers on to see flights, ships, cameras, weather and more.') }}</small>
</li>
<li class="first-run-tip first-run-tip--context">
<span class="first-run-tip-art" aria-hidden="true"><UiIcon name="my_location" :size="null" /><i class="first-run-tip-ring"></i></span>
<strong>{{ t('Click anything') }}</strong>
<small>{{ t('Select a map item to see its details.') }}</small>
</li>
</ul>
<section class="first-run-section" aria-labelledby="first-run-deeper-heading">
<h3 id="first-run-deeper-heading" class="first-run-section-title">{{ t('Go deeper') }}</h3>
<div v-if="stories.available" class="first-run-link-card first-run-stories">
<div class="first-run-preview first-run-preview--stories" aria-hidden="true"><UiIcon name="movie" :size="null" /></div>
<div class="first-run-link-body">
<p class="first-run-mode-title"><strong translate="no">GEV Stories</strong> <span class="first-run-tag">{{ t('NEW') }}</span></p>
<p class="first-run-mode-copy">{{ 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>
<UiButton class="first-run-link-button" data-first-run-stories :aria-disabled="String(settling || launcher?.busy === 'true')" @click="openStories">{{ t('BROWSE STORIES') }}</UiButton>
</div>
</section>
<section class="first-run-section" aria-labelledby="first-run-more-heading">
<h3 id="first-run-more-heading" class="first-run-section-title">{{ t('More from Halfpixel') }}</h3>
<div class="first-run-link-row first-run-link-row--chips" @pointerover="alignCallout" @focusin="alignCallout">
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.youtube" :data-callout="t('Bilawal on YouTube')" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">▶</span>
<span class="first-run-link-body"><strong translate="no">YouTube</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.x" :data-callout="t('Bilawal on {site}', { site: 'X' })" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">X</span>
<span class="first-run-link-body"><strong translate="no">X</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.instagram" :data-callout="t('Bilawal on {site}', { site: 'Instagram' })" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">IG</span>
<span class="first-run-link-body"><strong translate="no">Instagram</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.linkedin" :data-callout="t('Bilawal on {site}', { site: 'LinkedIn' })" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">in</span>
<span class="first-run-link-body"><strong translate="no">LinkedIn</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.website" :data-callout="t('Bilawal\'s website')" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">B</span>
<span class="first-run-link-body"><strong translate="no">bilawal.ai</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.halfpixel" :data-callout="t('The studio behind GEV')" target="_blank" rel="noopener noreferrer">
<span class="first-run-link-badge" aria-hidden="true">HP</span>
<span class="first-run-link-body"><strong translate="no">halfpixel.ai</strong></span>
</a>
<a class="first-run-link-card first-run-link-card--quiet" :href="FIRST_RUN_LINKS.source" target="_blank" rel="noopener noreferrer" :data-callout="t('Open source. Self-host, fork, add a layer.')">
<span class="first-run-link-badge" aria-hidden="true">&lt;/&gt;</span>
<span class="first-run-link-body"><strong translate="no">GitHub</strong></span>
</a>
</div>
</section>
</div>
</Transition>
</div>
<!-- Kept out of the footer row: it swaps to mission progress and errors, and
a live region that also holds layout makes the row jump as it speaks. -->
<p class="first-run-note" data-first-run-status role="status" aria-live="polite">{{ launcher?.status ?? FIRST_RUN_TIP }}</p>
<div class="first-run-footer">
<UiCheckbox class="first-run-suppress" :input-attrs="suppressBoxAttrs" @change="onSuppress">
<span>{{ t('Don\'t show this again') }}</span>
</UiCheckbox>
<!-- The status line: empty until a mission reports progress or an
error. It sits in the footer row, so it never changes the card's
height. -->
<p class="first-run-note" data-first-run-status role="status" aria-live="polite">{{ launcher?.status ?? '' }}</p>
<!-- The card's main action: God mode, starting where the selected tile
says (a clean globe by default). -->
<UiButton v-if="step > 1" class="first-run-back" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="go(step - 1, $event)">{{ t('BACK') }}</UiButton>
<UiButton class="first-run-enter" :data-first-run-choice="step === STEPS ? start : undefined" :data-first-run-next="step < STEPS ? '' : undefined" data-first-run-primary aria-describedby="first-run-title first-run-description" @pointerdown="onPrimaryDown" @keydown.enter="onPrimaryKeydown" :aria-disabled="String(settling || launcher?.busy === 'true')" @click="onPrimary">
{{ step < STEPS ? t('NEXT') : t('ENTER GOD MODE') }} <UiIcon name="arrow_forward" :size="null" />
</UiButton>
</div>
</aside>
</template>
+2 -1
View File
@@ -2,6 +2,7 @@
import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useBhoteKoshiPanelStore } from '../../stores/bhoteKoshiPanel.js';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSlider from '../../kit/UiSlider.js';
// The Bhote Koshi reconstruction controls, at the end of the context rail,
@@ -19,7 +20,7 @@ const sliderValue = (event, scale) => Number(event.target.value) / scale;
<div class="bhote-event-kicker">{{ t('EVENT RECONSTRUCTION · 26 AUG 2026') }}</div>
<div class="bhote-event-title">{{ t('BHOTE KOSHI OUTBURST FLOOD') }}</div>
</div>
<button class="bhote-event-icon-btn" type="button" data-action="close" :title="t('Close event layer')" :aria-label="t('Close event layer')" @click="call('close')">×</button>
<UiCloseButton class="bhote-event-icon-btn" data-action="close" :title="t('Close event layer')" :label="t('Close event layer')" @click="call('close')" />
</div>
<div class="bhote-event-status-row">
<span class="bhote-event-status observed" :hidden="panel.refs.observedStatus.hidden">{{ t('OBSERVED IMAGERY') }}</span>
+11 -10
View File
@@ -4,6 +4,9 @@ import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useCctvStore } from '../../stores/cctv.js';
import { usePanelChromeStore } from '../../stores/panelChrome.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// A selected camera's card: a thumbnail of its latest frame, a few facts,
// and a button that opens the full CCTV panel. The frame and facts come from
@@ -72,20 +75,18 @@ function openPanel() {
<img v-if="src" :src="src" :alt="name || t('Camera frame')" />
<span v-else>{{ t('Acquiring frame…') }}</span>
<span v-if="sourceBadge?.label" class="cctv-preview__badge">{{ sourceBadge.label }}</span>
<button v-if="src" type="button" class="cctv-preview__expand" :aria-label="t('Show a bigger view')" :title="t('Show a bigger view')" @click="big = true">
<span class="material-symbols-outlined" aria-hidden="true">open_in_full</span>
</button>
<UiButton v-if="src" class="cctv-preview__expand" :label="t('Show a bigger view')" @click="big = true">
<UiIcon name="open_in_full" :size="null" />
</UiButton>
</div>
<Teleport to="body">
<div v-if="big" class="cctv-popup" role="dialog" :aria-label="name || t('Camera view')" @click.self="big = false">
<figure class="cctv-popup__card">
<header class="cctv-popup__head">
<span class="material-symbols-outlined" aria-hidden="true">videocam</span>
<UiIcon name="videocam" :size="null" />
<strong>{{ name || t('Camera view') }}</strong>
<span v-if="sourceBadge?.label" class="cctv-popup__badge">{{ sourceBadge.label }}</span>
<button type="button" class="cctv-popup__close" :aria-label="t('Close')" @click="big = false">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="cctv-popup__close" glyph="icon" :label="t('Close')" @click="big = false" />
</header>
<img :src="src" :alt="name || t('Camera frame')" />
<figcaption v-if="facts.length">
@@ -100,8 +101,8 @@ function openPanel() {
<dd>{{ fact.value }}</dd>
</div>
</dl>
<button type="button" class="entity-card__action cctv-preview__more" @click="openPanel">
<span class="material-symbols-outlined" aria-hidden="true">videocam</span>{{ t('More info') }}
</button>
<UiButton class="entity-card__action cctv-preview__more" @click="openPanel">
<UiIcon name="videocam" :size="null" />{{ t('More info') }}
</UiButton>
</section>
</template>
+2 -1
View File
@@ -5,6 +5,7 @@ import { t } from '../../../i18n/index.js';
import { useVoiceStore } from '../../stores/voice.js';
import { ASSISTANT_NAME } from '../../../voice/control.js';
import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The typed chat in the command dock, as its owner (src/voice/chatControl.js)
// writes the voice control presenter. Messages arrive apart from the view, so
@@ -68,7 +69,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];
<div id="gev-chat-header-actions">
<PanelLayoutButtons :docked="props.view.layout.docked" :minimized="props.view.chat.minimized" @dock="emit('layout-dock')" @minimize="emit('chat-minimize')" />
<button v-if="props.view.panel" id="gev-voice-settings-button" class="gev-voice-settings-button" type="button" :aria-label="t('Settings')" :title="t('Settings')" aria-controls="gev-voice-panel" :aria-expanded="String(props.view.voicePanel.settingsExpanded)" @click="emit('settings-button')"><span class="material-symbols-outlined gev-voice-settings-icon" aria-hidden="true">settings</span></button>
<button id="gev-chat-close" type="button" :aria-label="t('Close chat')" @click="emit('chat-close')">×</button>
<UiCloseButton id="gev-chat-close" :label="t('Close chat')" @click="emit('chat-close')" />
</div>
</header>
<div id="gev-chat-messages" ref="list" role="log" :aria-label="t('Conversation')" aria-live="polite" :aria-busy="props.view.chat.busy || props.view.chat.revealing ? 'true' : undefined" @scroll.passive="onListScroll">
@@ -139,6 +139,30 @@ test('Browse opens a modal on the search field, packs last; Escape returns to Br
assert.equal(document.activeElement, $('#data-library-browse'));
});
test('a backdrop click and a close the browser made itself return to Browse', async (t_) => {
const { owner } = mount(t_);
owner.open();
await settle();
$('#data-library .data-library-intro').click();
await settle();
assert.equal($('#data-library').open, true, 'a click inside keeps it open');
$('#data-library').click();
await settle();
assert.equal($('#data-library').open, false);
assert.equal(document.activeElement, $('#data-library-browse'));
owner.open();
await settle();
assert.equal(document.activeElement, $('#data-library input[type="search"]'));
// An Escape the page may not cancel: the browser closes it first.
$('#data-library').close();
await settle();
assert.equal($('#data-library').open, false);
assert.equal(document.activeElement, $('#data-library-browse'));
owner.open();
await settle();
assert.equal($('#data-library').open, true, 'the owner closed it too');
});
test('filters narrow the list as the viewer types and picks', async (t_) => {
const { owner } = mount(t_);
owner.open();
+31 -42
View File
@@ -3,6 +3,9 @@ import { storeToRefs } from 'pinia';
import { computed, nextTick, useTemplateRef, watch } from 'vue';
import { formatNumber, t, tn } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiDialog from '../../kit/UiDialog.vue';
import UiSelect from '../../kit/UiSelect.js';
import {
libraryStatTiles,
@@ -22,27 +25,18 @@ const { controls } = storeToRefs(useDataLibraryStore());
const root = useTemplateRef('root');
const search = useTemplateRef('search');
watch(
() => props.view.open,
async (open, wasOpen) => {
await nextTick();
const dialog = root.value;
if (!dialog) return;
if (open) {
if (!dialog.open) dialog.showModal?.();
search.value?.focus();
return;
}
if (dialog.open) dialog.close();
// The browser may already have closed it (Escape is not always
// cancelable); either way focus returns to Browse, unless the viewer
// has moved it somewhere else meanwhile.
const active = document.activeElement;
if (wasOpen && (!active || active === document.body || dialog.contains(active)))
document.getElementById('data-library-browse')?.focus();
},
{ immediate: true },
);
// UiDialog opens and closes the dialog as `view.open` says, once the content
// has rendered; Escape and a click on the backdrop dismiss.
const onOpened = () => search.value?.focus();
// The browser may already have closed it (Escape is not always cancelable);
// either way focus returns to Browse, unless the viewer has moved it
// somewhere else meanwhile.
const onClosed = () => {
const dialog = root.value?.element;
const active = document.activeElement;
if (!active || active === document.body || dialog?.contains(active))
document.getElementById('data-library-browse')?.focus();
};
watch(
() => props.view.focusSearch,
async () => {
@@ -79,36 +73,32 @@ const resetLabel = computed(() =>
? t('Confirm: remove every added entry from Data Layers')
: t('Remove every added entry from Data Layers'),
);
// A click on the backdrop (the dialog box itself, outside its content)
// dismisses, like Escape.
const onDialogClick = (event) => {
if (event.target === event.currentTarget) controls.value?.close();
};
</script>
<template>
<dialog
<UiDialog
id="data-library"
ref="root"
class="data-library-dialog"
data-panel-surface
aria-labelledby="data-library-title"
aria-describedby="data-library-intro"
@cancel.prevent="controls?.close()"
@close="view.open && controls?.close()"
@click="onDialogClick"
:open="view.open"
backdrop-dismiss
@dismiss="controls?.close()"
@browser-close="controls?.close()"
@opened="onOpened"
@closed="onClosed"
>
<header class="data-library-header" data-panel-header>
<h2 id="data-library-title" class="panel-title panel-surface-title">
{{ t('DATA LIBRARY') }}
</h2>
<UiButton
<UiCloseButton
class="panel-surface-control data-library-close"
:label="t('Close data library')"
:native-title="false"
@click="controls?.close()"
>×</UiButton
>
/>
</header>
<div class="data-library-body" data-panel-body>
<dl class="data-library-stats" :aria-label="t('Data Library at a glance')">
@@ -154,14 +144,13 @@ const onDialogClick = (event) => {
@update:model-value="controls?.setFamily($event)"
/>
</label>
<label class="data-library-check">
<input
type="checkbox"
:checked="view.filter.availableOnly"
@change="controls?.setAvailableOnly($event.target.checked)"
/>
<UiCheckbox
class="data-library-check"
:model-value="view.filter.availableOnly"
@update:model-value="controls?.setAvailableOnly($event)"
>
<span>{{ t('Only what this instance serves') }}</span>
</label>
</UiCheckbox>
</div>
<div class="data-library-toolbar">
<p class="data-library-status" role="status" aria-live="polite">
@@ -189,5 +178,5 @@ const onDialogClick = (event) => {
/>
</ul>
</div>
</dialog>
</UiDialog>
</template>
+33 -35
View File
@@ -11,6 +11,8 @@ import UiSegmented from '../../kit/UiSegmented.vue';
import UiSlider from '../../kit/UiSlider.js';
import { useDisplayStore } from '../../stores/display.js';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSelect from '../../kit/UiSelect.js';
import { StyleParameterRows } from '../../styleParameters.js';
import VisualPresets from './VisualPresets.vue';
@@ -37,7 +39,7 @@ const pillWords = computed(() => ({
}));
const hud = computed(() => view.value?.hud ?? null);
const sonar = computed(() => view.value?.sonar ?? null);
const sonarOn = computed(() => sonar.value?.enabled ?? true);
const sonarOn = computed(() => sonar.value?.enabled ?? false);
const detection = computed(() => view.value?.detection ?? null);
const detectButton = computed(() => detection.value?.button ?? null);
const allocation = computed(() => detection.value?.allocation ?? 'ELASTIC');
@@ -84,44 +86,43 @@ const allocationOptions = computed(() => [
<p class="pp-section-heading">{{ t('Overlay') }}</p>
<Teleport :to="cockpitPortal?.hud ?? 'body'" :disabled="!cockpitPortal?.hud">
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: hud?.visible }" :aria-pressed="String(Boolean(hud?.visible))" id="hud-toggle" @click="act('toggleHud')" :title="t('Intelligence HUD (H)')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(hud?.visible)" pressed-class="active" id="hud-toggle" @click="act('toggleHud')" :title="t('Intelligence HUD (H)')">
<span class="pp-icon">&#x25CE;</span>
<span class="pp-label" translate="no">HUD</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: hud?.visible }" id="hud-layout-row">
<span class="pp-slider-mini-label">{{ t('Layout') }}</span>
<UiSelect id="hud-layout-select" class="pp-select gev-field gev-field--compact" :model-value="hud?.variant ?? 'tactical'" @update:model-value="act('setHudLayout', $event)" :aria-label="t('HUD layout')">
<option value="tactical">{{ t('Tactical') }}</option>
<option value="minimal">{{ t('Minimal') }}</option>
<option value="cyber">{{ t('Cyber') }}</option>
</UiSelect>
</div>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-toggle-row" id="cyber-sonar-row">
<div class="pp-slider-row cyber-sonar-control cyber-sonar-toggle-row" :class="{ visible: hud?.visible }" id="cyber-sonar-row">
<span class="pp-slider-mini-label">{{ t('Sonar') }}</span>
<UiButton class="pp-mode-btn" :pressed="sonarOn" pressed-class="active" id="cyber-sonar-toggle" @click="act('toggleSonar')" :title="t('Cyber sonar contact scanner')" :aria-label="t('Cyber sonar contact scanner')">{{ sonarOn ? t('ON') : t('OFF') }}</UiButton>
<UiButton class="pp-mode-btn" :pressed="sonarOn" pressed-class="active" id="cyber-sonar-toggle" @click="act('toggleSonar')" :title="t('Sonar contact scanner')" :aria-label="t('Sonar contact scanner')">{{ sonarOn ? t('ON') : t('OFF') }}</UiButton>
</div>
<output id="cyber-sonar-status" class="cyber-sonar-control" role="status"></output>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" id="cyber-sonar-rings-row">
<output id="cyber-sonar-status" class="cyber-sonar-control" role="status" :hidden="!(hud?.visible && sonarOn)"></output>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" :class="{ visible: hud?.visible && sonarOn }" id="cyber-sonar-rings-row">
<label class="pp-slider-mini-label" for="cyber-sonar-rings">{{ t('Rings') }}</label>
<UiSlider class="pp-slider" id="cyber-sonar-rings" @update:model-value="act('setSonarRings', $event)" min="3" max="12" step="1" :model-value="sonar?.rings ?? 8" :aria-label="t('Sonar ring count')" />
<span class="pp-slider-value" id="cyber-sonar-rings-value">{{ sonar?.rings ?? 8 }}</span>
</div>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" id="cyber-sonar-range-row">
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" :class="{ visible: hud?.visible && sonarOn }" id="cyber-sonar-range-row">
<label class="pp-slider-mini-label" for="cyber-sonar-range">{{ t('Range') }}</label>
<UiSlider class="pp-slider" id="cyber-sonar-range" @update:model-value="act('setSonarRange', $event)" min="60" max="120" step="1" :model-value="sonar?.range ?? 100" :aria-label="t('Sonar ring range')" />
<span class="pp-slider-value" id="cyber-sonar-range-value">{{ pct(sonar?.range ?? 100) }}</span>
</div>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" id="cyber-sonar-intensity-row">
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" :class="{ visible: hud?.visible && sonarOn }" id="cyber-sonar-intensity-row">
<label class="pp-slider-mini-label" for="cyber-sonar-intensity">{{ t('Power') }}</label>
<UiSlider class="pp-slider" id="cyber-sonar-intensity" @update:model-value="act('setSonarIntensity', $event)" min="0" max="100" step="1" :model-value="sonar?.intensity ?? 70" :aria-label="t('Sonar intensity')" />
<span class="pp-slider-value" id="cyber-sonar-intensity-value">{{ pct(sonar?.intensity ?? 70) }}</span>
</div>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" id="cyber-sonar-opacity-row">
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" :class="{ visible: hud?.visible && sonarOn }" id="cyber-sonar-opacity-row">
<label class="pp-slider-mini-label" for="cyber-sonar-opacity">{{ t('Opacity') }}</label>
<UiSlider class="pp-slider" id="cyber-sonar-opacity" @update:model-value="act('setSonarOpacity', $event)" min="35" max="100" step="1" :model-value="sonar?.opacity ?? 84" :aria-label="t('Cyber contact and label opacity')" :title="t('Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes')" />
<UiSlider class="pp-slider" id="cyber-sonar-opacity" @update:model-value="act('setSonarOpacity', $event)" min="35" max="100" step="1" :model-value="sonar?.opacity ?? 84" :aria-label="t('Sonar contact and label opacity')" :title="t('Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes')" />
<span class="pp-slider-value" id="cyber-sonar-opacity-value">{{ pct(sonar?.opacity ?? 84) }}</span>
</div>
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" id="cyber-sonar-sector-row">
<div class="pp-slider-row cyber-sonar-control cyber-sonar-setting" :class="{ visible: hud?.visible && sonarOn }" id="cyber-sonar-sector-row">
<label class="pp-slider-mini-label" for="cyber-sonar-sector">{{ t('Sector') }}</label>
<UiSlider class="pp-slider" id="cyber-sonar-sector" @update:model-value="act('setSonarSector', $event)" min="8" max="60" step="1" :model-value="sonar?.sector ?? 24" :aria-label="t('Sonar sector width')" />
<span class="pp-slider-value" id="cyber-sonar-sector-value">{{ `${sonar?.sector ?? 24}°` }}</span>
@@ -183,11 +184,10 @@ const allocationOptions = computed(() => [
</div>
</Teleport>
<div class="pp-toggle-group">
<label class="pp-toggle-btn pp-scope-toggle" :title="t('Scope — the circular viewport mask')">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">adjust</span>
<UiCheckbox class="pp-toggle-btn pp-scope-toggle" :title="t('Scope — the circular viewport mask')" input-id="scope-toggle" trailing :model-value="scopeOn" @update:model-value="act('setScopeEnabled', $event)">
<UiIcon class="pp-icon" name="adjust" :size="null" />
<span class="pp-label">{{ t('Scope') }}</span>
<input type="checkbox" id="scope-toggle" @change="act('setScopeEnabled', $event.target.checked)" :checked="scopeOn" />
</label>
</UiCheckbox>
<div class="pp-slider-row visible" id="scope-slider-row">
<span class="pp-slider-mini-label">{{ t('Feather') }}</span>
<UiSlider class="pp-slider" id="scope-feather-slider" @update:model-value="act('setScopeFeather', $event)" min="0" max="200" :model-value="scopeFeather" :disabled="!scopeOn" :aria-label="t('Scope edge feather')" :title="t('Scope edge feather as a percentage of the keyhole radius')" />
@@ -199,24 +199,23 @@ const allocationOptions = computed(() => [
<span class="pp-slider-value" id="scope-opacity-value">{{ pct(scopeOpacity) }}</span>
</div>
</div>
<button class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
<UiButton class="pp-toggle-btn" id="clean-view-toggle" @click="act('toggleCleanView')" :title="t('Hide UI chrome')">
<span class="pp-icon">&#x25A1;</span>
<span class="pp-label">{{ t('Clean UI') }}</span>
</button>
</UiButton>
<p class="pp-section-heading">{{ t('Effects') }}</p>
<div class="pp-toggle-group">
<UiButton class="pp-toggle-btn" :pressed="celestial?.active ?? false" pressed-class="active" id="celestial-toggle" @click="act('toggleCelestial')" :title="celestialTitle" :disabled="celestial ? !celestial.supported : undefined" :aria-disabled="celestial ? String(!celestial.supported) : undefined">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">flare</span>
<UiIcon class="pp-icon" name="flare" :size="null" />
<span class="pp-label">{{ t('Celestial') }}</span>
</UiButton>
</div>
<!-- Sky: only where the renderer has a sky to set. -->
<div v-if="sky" class="pp-toggle-group" id="sky-group">
<label v-for="row in skyRows" :key="row.key" class="pp-toggle-btn pp-scope-toggle" :id="`sky-${row.key}-row`">
<span class="pp-icon material-symbols-outlined" aria-hidden="true">{{ row.icon }}</span>
<UiCheckbox v-for="row in skyRows" :key="row.key" class="pp-toggle-btn pp-scope-toggle" :id="`sky-${row.key}-row`" :input-id="`sky-${row.key}-toggle`" trailing :model-value="sky.switches[row.key]" @update:model-value="act('setSkySwitch', row.key, $event)">
<UiIcon class="pp-icon" :name="row.icon" :size="null" />
<span class="pp-label">{{ row.label }}</span>
<input type="checkbox" :id="`sky-${row.key}-toggle`" @change="act('setSkySwitch', row.key, $event.target.checked)" :checked="sky.switches[row.key]" />
</label>
</UiCheckbox>
<div class="pp-slider-row visible" id="sky-milkyway-row">
<span class="pp-slider-mini-label">{{ t('Milky Way') }}</span>
<UiSlider class="pp-slider" id="sky-milkyway-slider" @update:model-value="act('setSkyMilkyWay', $event)" min="0" max="100" :model-value="sky.milkyWay" :aria-label="t('Milky Way')" />
@@ -226,11 +225,10 @@ const allocationOptions = computed(() => [
<!-- Groups the application adds (store `publishGroup`). -->
<div v-for="group in groups" :key="group.id" class="pp-toggle-group" :id="`${group.id}-group`">
<template v-for="row in group.rows" :key="row.id">
<label v-if="row.kind === 'toggle'" class="pp-toggle-btn pp-scope-toggle" :title="row.title">
<span v-if="row.icon" class="pp-icon material-symbols-outlined" aria-hidden="true">{{ row.icon }}</span>
<UiCheckbox v-if="row.kind === 'toggle'" class="pp-toggle-btn pp-scope-toggle" :title="row.title" :input-id="`${group.id}-${row.id}-toggle`" trailing :model-value="row.checked" @update:model-value="row.onChange?.($event)">
<UiIcon v-if="row.icon" class="pp-icon" :name="row.icon" :size="null" />
<span class="pp-label">{{ row.label }}</span>
<input type="checkbox" :id="`${group.id}-${row.id}-toggle`" @change="row.onChange?.($event.target.checked)" :checked="row.checked" />
</label>
</UiCheckbox>
<div v-else-if="row.kind === 'note'" class="pp-slider-row visible" :id="`${group.id}-${row.id}`">
<span class="pp-slider-mini-label">{{ row.text }}</span>
</div>
@@ -242,28 +240,28 @@ const allocationOptions = computed(() => [
</template>
</div>
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: view?.bloom.active }" :aria-pressed="String(Boolean(view?.bloom.active))" id="bloom-toggle" @click="act('toggleBloom')" :title="t('Bloom / Glow')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(view?.bloom.active)" pressed-class="active" id="bloom-toggle" @click="act('toggleBloom')" :title="t('Bloom / Glow')">
<span class="pp-icon">&#x2728;</span>
<span class="pp-label">{{ t('Bloom') }}</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: view?.bloom.active }" id="bloom-slider-row">
<UiSlider class="pp-slider" id="bloom-intensity-slider" @update:model-value="act('setBloomIntensity', $event)" min="0" max="200" :model-value="view?.bloom.intensity ?? 0" :aria-label="t('Bloom intensity')" />
<span class="pp-slider-value" id="bloom-intensity-value">{{ pct(view?.bloom.intensity ?? 0) }}</span>
</div>
</div>
<div class="pp-toggle-group">
<button class="pp-toggle-btn" :class="{ active: view?.sharpen.active }" :aria-pressed="String(Boolean(view?.sharpen.active))" id="sharpen-toggle" @click="act('toggleSharpen')" :title="t('Sharpening')">
<UiButton class="pp-toggle-btn" :pressed="Boolean(view?.sharpen.active)" pressed-class="active" id="sharpen-toggle" @click="act('toggleSharpen')" :title="t('Sharpening')">
<span class="pp-icon">&#x1F50D;</span>
<span class="pp-label">{{ t('Sharpen') }}</span>
</button>
</UiButton>
<div class="pp-slider-row" :class="{ visible: view?.sharpen.active }" id="sharpen-slider-row">
<UiSlider class="pp-slider" id="sharpen-intensity-slider" @update:model-value="act('setSharpenIntensity', $event)" min="0" max="100" :model-value="view?.sharpen.intensity ?? 49" :aria-label="t('Sharpen intensity')" />
<span class="pp-slider-value" id="sharpen-intensity-value">{{ pct(view?.sharpen.intensity ?? 49) }}</span>
</div>
</div>
<button type="button" class="pp-reset-btn" :title="t('Reset Visual to its defaults: Normal look, HUD, scope, labels and effects')" @click="act('resetVisual')">
<span class="material-symbols-outlined" aria-hidden="true">restart_alt</span>{{ t('Reset to default') }}
</button>
<UiButton class="pp-reset-btn" :title="t('Reset Visual to its defaults: Normal look, HUD, scope, labels and effects')" @click="act('resetVisual')">
<UiIcon name="restart_alt" :size="null" />{{ t('Reset to default') }}
</UiButton>
</div>
</div>
</template>
+2 -1
View File
@@ -6,6 +6,7 @@ import { DRAW_COLOR_CSS } from '../../../annotations/drawMarks.js';
import { vFieldValue } from '../../rail/fieldValue.js';
import { vFocusSafeChildren } from '../../rail/focusSafeChildren.js';
import DrawSwatches from './DrawSwatches.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import { useDisplayStore } from '../../stores/display.js';
// UTILITIES ▸ Draw's shapes, one row each like Import's files: the colour
@@ -99,5 +100,5 @@ function leave() {
</script>
<template>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><button type="button" class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :title="row.labels.swatch" :aria-label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id"></button><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><button type="button" class="geo-import-action" data-control="toggle" :title="row.labels.toggle" :aria-label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ row.hidden ? 'visibility_off' : 'visibility' }}</span></button><button v-for="action in row.actions" :key="action.id" type="button" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :title="action.label" :aria-label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ action.icon }}</span></button><button type="button" class="geo-import-action" data-control="fly" :title="row.labels.fly" :aria-label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">my_location</span></button><button type="button" class="geo-import-action" data-control="remove" :title="row.labels.remove" :aria-label="row.labels.remove" @click="display.act('removeDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">close</span></button><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
<ul class="geo-import-list draw-mark-list" :class="{ visible: listed }" id="draw-mark-list" v-focus-safe-children="leave" :aria-label="t('Drawn shapes')"><li v-for="row in rows" :key="row.id" class="geo-import-row draw-mark-row" :class="{ 'hidden-mark': row.hidden }" :data-mark-id="row.id" @keydown="onRowKey(row, $event)"><button type="button" class="geo-import-swatch draw-mark-swatch" data-control="swatch" :style="{ background: DRAW_COLOR_CSS[row.color] }" :title="row.labels.swatch" :aria-label="row.labels.swatch" :aria-expanded="String(picking === row.id)" :aria-controls="`draw-mark-colors-${row.id}`" @click="picking = picking === row.id ? null : row.id"></button><DrawSwatches v-if="picking === row.id" :id="`draw-mark-colors-${row.id}`" class="draw-mark-colors" data-control="picker" autofocus :label="row.labels.colors" :model-value="row.color" @update:model-value="recolor(row, $event)" @choose="closePicker(row.id)" /><input type="text" class="geo-import-name draw-mark-name" data-control="name" maxlength="120" autocomplete="off" spellcheck="false" v-field-value="row.name" :placeholder="row.placeholder" :aria-label="row.labels.name" @keydown="onNameKey(row, $event)" @focusout="commit(row, $event.currentTarget)"><button type="button" class="geo-import-action" data-control="toggle" :title="row.labels.toggle" :aria-label="row.labels.toggle" @click="display.act('toggleDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ row.hidden ? 'visibility_off' : 'visibility' }}</span></button><button v-for="action in row.actions" :key="action.id" type="button" class="geo-import-action draw-mark-action" :data-control="`action-${action.id}`" :data-action="action.id" :title="action.label" :aria-label="action.label" :aria-disabled="String(row.busy)" @click="display.act('runDrawMarkAction', row.id, action.id)"><span class="material-symbols-outlined" aria-hidden="true">{{ action.icon }}</span></button><button type="button" class="geo-import-action" data-control="fly" :title="row.labels.fly" :aria-label="row.labels.fly" @click="display.act('flyToDrawMark', row.id)"><span class="material-symbols-outlined" aria-hidden="true">my_location</span></button><UiCloseButton class="geo-import-action" glyph="icon" data-control="remove" :title="row.labels.remove" :label="row.labels.remove" @click="display.act('removeDrawMark', row.id)" /><span v-if="row.actions.length" class="draw-mark-note" role="status" :aria-busy="String(row.busy)">{{ row.busy ? '…' : row.note }}</span></li></ul>
</template>
+25 -23
View File
@@ -10,6 +10,9 @@ import AltitudeGraph from './AltitudeGraph.vue';
import { contextNeedle, contextSearchText, matchesContextSearch } from '../../contextSearch.js';
import RouteGlobe from './RouteGlobe.vue';
import CctvPreview from './CctvPreview.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import { useCctvStore } from '../../stores/cctv.js';
import SpotConditions from './SpotConditions.vue';
import { shownLayerName } from '../../layerNames.js';
@@ -364,10 +367,10 @@ watch(
<AircraftModelHero v-if="modelKnown" :key="card.key" class="entity-hero__layer" :class="{ 'is-shown': activeFlightPreview === 'model' }" :active="activeFlightPreview === 'model'" :aircraft="card.aircraftModel" :heading="card.heading || 0" :callouts="callouts" @failed="modelFailed = true" @cycle="showOtherView" />
<FlightCockpitView v-if="cockpitMade && cockpitKnown" :key="`cockpit-${card.key}`" class="entity-hero__layer" :class="{ 'is-shown': activeFlightPreview === 'cockpit' }" :active="activeFlightPreview === 'cockpit'" :lat="card.lat" :lon="card.lon" :altitude-m="card.altitudeM" :heading="card.heading" :speed-mps="card.speedMps" @failed="onCockpitFailed" />
<div v-if="cockpitKnown || (routeKnown && modelKnown) || (photoAvailable && (routeKnown || modelKnown))" class="entity-card__preview-switch" role="group" :aria-label="t('Preview')">
<button v-if="photoAvailable" type="button" :class="{ active: activeFlightPreview === 'photo' }" :aria-pressed="String(activeFlightPreview === 'photo')" :aria-label="t('Photos')" :title="t('Photos')" @click="choosePreview('photo')"><span class="material-symbols-outlined" aria-hidden="true">photo_camera</span></button>
<button v-if="routeKnown" type="button" :class="{ active: activeFlightPreview === 'route' }" :aria-pressed="String(activeFlightPreview === 'route')" :aria-label="t('Route')" :title="t('Route')" @click="choosePreview('route')"><span class="material-symbols-outlined" aria-hidden="true">timeline</span></button>
<button v-if="modelKnown" type="button" :class="{ active: activeFlightPreview === 'model' }" :aria-pressed="String(activeFlightPreview === 'model')" :title="t('3D model')" @click="choosePreview('model')">{{ t('3D') }}</button>
<button v-if="cockpitKnown" type="button" :class="{ active: activeFlightPreview === 'cockpit' }" :aria-pressed="String(activeFlightPreview === 'cockpit')" :aria-label="t('Cockpit view')" :title="t('Cockpit view')" @click="choosePreview('cockpit')"><span class="material-symbols-outlined" aria-hidden="true">visibility</span></button>
<UiButton v-if="photoAvailable" :pressed="activeFlightPreview === 'photo'" pressed-class="active" :label="t('Photos')" @click="choosePreview('photo')"><UiIcon name="photo_camera" :size="null" /></UiButton>
<UiButton v-if="routeKnown" :pressed="activeFlightPreview === 'route'" pressed-class="active" :label="t('Route')" @click="choosePreview('route')"><UiIcon name="timeline" :size="null" /></UiButton>
<UiButton v-if="modelKnown" :pressed="activeFlightPreview === 'model'" pressed-class="active" :title="t('3D model')" @click="choosePreview('model')">{{ t('3D') }}</UiButton>
<UiButton v-if="cockpitKnown" :pressed="activeFlightPreview === 'cockpit'" pressed-class="active" :label="t('Cockpit view')" @click="choosePreview('cockpit')"><UiIcon name="visibility" :size="null" /></UiButton>
</div>
</template>
<a v-else-if="heroKind === 'photo'" :key="photo.src" class="entity-hero__layer entity-hero__photo is-shown" :href="photo.link || undefined" target="_blank" rel="noopener">
@@ -378,7 +381,7 @@ watch(
<CctvPreview v-else-if="heroKind === 'camera'" :camera-id="card.identity?.id || ''" />
<!-- No imagery for it yet: its icon, with its headline figures beside it. -->
<div v-else class="entity-hero__placeholder" :class="{ 'entity-hero__placeholder--bare': props.withContacts || !tiles.length }">
<span class="material-symbols-outlined entity-hero__glyph" aria-hidden="true">{{ card.icon }}</span>
<UiIcon class="entity-hero__glyph" :name="card.icon" :size="null" />
<div v-if="!props.withContacts && tiles.length" class="entity-hero__figures">
<div v-for="fact in tiles" :key="fact.field" class="entity-hero__figure">
<strong>{{ factFigure(fact).number }}<small v-if="factFigure(fact).unit">{{ factFigure(fact).unit }}</small></strong>
@@ -390,15 +393,13 @@ watch(
</div>
<header class="entity-card__head">
<span class="material-symbols-outlined entity-card__icon" aria-hidden="true">{{ card.icon }}</span>
<UiIcon class="entity-card__icon" :name="card.icon" :size="null" />
<div class="entity-card__name">
<span class="entity-card__kind">{{ kindLine }}</span>
<h3 class="entity-card__title">{{ shownTitle }}</h3>
<span v-if="subtitle" class="entity-card__subtitle">{{ subtitle }}</span>
</div>
<button type="button" class="entity-card__close" :aria-label="t('Close card')" :title="t('Close card')" @click="store.clear()">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="entity-card__close" glyph="icon" :label="t('Close card')" :title="t('Close card')" @click="store.clear()" />
</header>
<div class="entity-card__meta">
@@ -407,14 +408,14 @@ watch(
</div>
<div v-if="card.warnings?.length" class="entity-card__warning" role="alert">
<span class="material-symbols-outlined" aria-hidden="true">warning</span>
<UiIcon name="warning" :size="null" />
<span>{{ card.warnings.map((warning, index) => sayWords(card.warningWords?.[index], warning)).join(' · ') }}</span>
</div>
<div v-if="card.route" class="entity-card__route" :class="{ 'entity-card__route--unverified': !card.route.verified, 'entity-card__route--progress': routeProgress }">
<strong>{{ card.route.from }}</strong>
<span class="entity-card__route-line" :style="routeProgress ? { '--route-share': `${(routeProgress.share * 100).toFixed(1)}%` } : null" aria-hidden="true">
<span class="material-symbols-outlined">flight</span>
<UiIcon name="flight" :size="null" />
</span>
<strong>{{ card.route.to }}</strong>
</div>
@@ -436,7 +437,7 @@ watch(
class="entity-card__route-note"
:title="t('The scheduled route for this flight number does not match where the plane is; it may be another leg of the same flight.')"
>
<span class="material-symbols-outlined" aria-hidden="true">warning</span>{{ t('Scheduled · unverified: does not match where the plane is') }}
<UiIcon name="warning" :size="null" />{{ t('Scheduled · unverified: does not match where the plane is') }}
</p>
<div v-if="!props.withContacts && tiles.length && heroKind !== 'none' && !contextNeedle" class="entity-card__tiles" :style="{ gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))` }">
@@ -463,20 +464,21 @@ watch(
<div class="entity-card__actions">
<!-- On an aircraft or a satellite, Cockpit leads: it is the action people come for. -->
<button v-if="store.canCockpit()" type="button" class="entity-card__action entity-card__action--primary" data-entity-cockpit-entry @click="store.cockpit()">
<span class="material-symbols-outlined" aria-hidden="true">{{ card.layerId === 'satellites' ? 'satellite_alt' : 'flight' }}</span>{{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }}
</button>
<UiButton v-if="store.canCockpit()" class="entity-card__action entity-card__action--primary" data-entity-cockpit-entry @click="store.cockpit()">
<UiIcon :name="card.layerId === 'satellites' ? 'satellite_alt' : 'flight'" :size="null" />{{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }}
</UiButton>
<div class="entity-card__action-row">
<button type="button" class="entity-card__action" @click="store.flyTo()">
<span class="material-symbols-outlined" aria-hidden="true">my_location</span>{{ t('Fly to') }}
</button>
<button v-if="store.canFollow()" type="button" class="entity-card__action" :class="{ 'entity-card__action--on': store.isFollowing() }" :aria-pressed="String(store.isFollowing())" @click="store.follow()">
<span class="material-symbols-outlined" aria-hidden="true">navigation</span>{{ store.isFollowing() ? t('Following') : t('Follow') }}
</button>
<UiButton class="entity-card__action" @click="store.flyTo()">
<UiIcon name="my_location" :size="null" />{{ t('Fly to') }}
</UiButton>
<UiButton v-if="store.canFollow()" class="entity-card__action" :pressed="Boolean(store.isFollowing())" pressed-class="entity-card__action--on" @click="store.follow()">
<UiIcon name="navigation" :size="null" />{{ store.isFollowing() ? t('Following') : t('Follow') }}
</UiButton>
</div>
<button type="button" class="entity-card__action entity-card__action--ask" @click="store.ask()">
<!-- The chat bubble is no Material symbol the page loads, so it stays drawn. -->
<UiButton class="entity-card__action entity-card__action--ask" @click="store.ask()">
<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z" /></svg>{{ t('Ask GEV about {name}', { name: shownTitle }) }}
</button>
</UiButton>
</div>
<slot />
+24 -23
View File
@@ -22,6 +22,9 @@ const finder = {
<script setup>
import { nextTick, onBeforeUnmount, onMounted, ref, watch, computed } from 'vue';
import { msg, t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSearchField from '../../kit/UiSearchField.vue';
// Search and filter for the Data Layers list. The rows are rendered elsewhere
// (LayerRows), so this works on the list as it stands: it marks rows that
@@ -184,7 +187,8 @@ async function toggleFilter() {
}
function closeFilter({ refocus = false } = {}) {
filtering.value = false;
if (refocus) triggerEl.value?.focus();
// The trigger is a UiButton; its root is the button.
if (refocus) triggerEl.value?.$el?.focus();
}
function onMenuKey(event) {
if (event.key === 'Escape') {
@@ -222,40 +226,37 @@ if (props.part === 'buttons') {
<template>
<template v-if="part === 'buttons'">
<button id="layer-finder-search-btn" type="button" class="layer-finder__btn" :class="{ active: searching || query }" :aria-pressed="String(searching)" :aria-label="t('Search layers')" :title="t('Search layers')" @click="toggleSearch">
<span class="material-symbols-outlined" aria-hidden="true">search</span>
</button>
<UiButton id="layer-finder-search-btn" class="layer-finder__btn" :class="{ active: searching || query }" :pressed="Boolean(searching)" :aria-label="t('Search layers')" :title="t('Search layers')" @click="toggleSearch">
<UiIcon name="search" :size="null" />
</UiButton>
<span ref="filterEl" class="layer-finder__filter">
<button ref="triggerEl" type="button" class="layer-finder__btn" :class="{ active: show !== 'all' || category }" :aria-expanded="String(filtering)" aria-controls="layer-finder-menu" :aria-label="t('Filter layers')" :title="t('Filter layers')" @click="toggleFilter">
<span class="material-symbols-outlined" aria-hidden="true">filter_list</span>
</button>
<UiButton ref="triggerEl" class="layer-finder__btn" :class="{ active: show !== 'all' || category }" :aria-expanded="String(filtering)" aria-controls="layer-finder-menu" :aria-label="t('Filter layers')" :title="t('Filter layers')" @click="toggleFilter">
<UiIcon name="filter_list" :size="null" />
</UiButton>
<span v-if="filtering" id="layer-finder-menu" ref="menuEl" class="layer-finder__menu" role="group" :aria-label="t('Filter layers')" @keydown="onMenuKey">
<span role="group" :aria-label="t('Status')">
<span class="layer-finder__menu-head" aria-hidden="true">{{ t('Status') }}</span>
<button v-for="s in SHOWS" :key="s.id" type="button" :aria-pressed="String(show === s.id)" :class="{ active: show === s.id }" @click="show = s.id">
<span class="material-symbols-outlined" aria-hidden="true">{{ show === s.id ? 'radio_button_checked' : 'radio_button_unchecked' }}</span>{{ t(s.label) }}
</button>
<UiButton v-for="s in SHOWS" :key="s.id" :pressed="show === s.id" pressed-class="active" @click="show = s.id">
<UiIcon :name="show === s.id ? 'radio_button_checked' : 'radio_button_unchecked'" :size="null" />{{ t(s.label) }}
</UiButton>
</span>
<span v-if="categories.length" role="group" :aria-label="t('Category')">
<span class="layer-finder__menu-head" aria-hidden="true">{{ t('Category') }}</span>
<button v-for="c in categories" :key="c.key" type="button" :aria-pressed="String(category === c.key)" :class="{ active: category === c.key }" @click="pickCategory(c.key)">
<span class="material-symbols-outlined" aria-hidden="true">{{ category === c.key ? 'radio_button_checked' : 'radio_button_unchecked' }}</span>{{ c.label }}
</button>
<UiButton v-for="c in categories" :key="c.key" :pressed="category === c.key" pressed-class="active" @click="pickCategory(c.key)">
<UiIcon :name="category === c.key ? 'radio_button_checked' : 'radio_button_unchecked'" :size="null" />{{ c.label }}
</UiButton>
</span>
</span>
</span>
</template>
<div v-else-if="searching || narrowed" class="layer-finder__bar">
<label v-if="searching" class="layer-finder__field">
<span class="material-symbols-outlined" aria-hidden="true">search</span>
<input id="layer-finder-input" v-model="query" type="search" :placeholder="t('Search layers…')" :aria-label="t('Search layers')" @keydown.esc.stop.prevent="closeSearch" />
</label>
<button v-if="show !== 'all'" type="button" class="layer-finder__chip" @click="show = 'all'">
{{ show === 'on' ? t('On') : t('Off') }}<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<button v-if="category" type="button" class="layer-finder__chip" @click="category = ''">
{{ categoryLabel }}<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiSearchField v-if="searching" v-model="query" tag="label" class="layer-finder__field" input-id="layer-finder-input" :label="t('Search layers')" :placeholder="t('Search layers…')" @escape="(event) => { event.preventDefault(); closeSearch(); }" />
<UiButton v-if="show !== 'all'" class="layer-finder__chip" @click="show = 'all'">
{{ show === 'on' ? t('On') : t('Off') }}<UiIcon name="close" :size="null" />
</UiButton>
<UiButton v-if="category" class="layer-finder__chip" @click="category = ''">
{{ categoryLabel }}<UiIcon name="close" :size="null" />
</UiButton>
<p v-if="narrowed && shown === 0" class="layer-finder__empty" role="status">{{ t('No layers match') }}</p>
</div>
</template>
+7 -6
View File
@@ -3,17 +3,18 @@ import { storeToRefs } from 'pinia';
import { nextTick, ref, watch } from 'vue';
import { t } from '../../../i18n/index.js';
import UiSlider from '../../kit/UiSlider.js';
import { useContextStore } from '../../stores/context.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The selected space mission inside Context. The launches layer presents it
// The selected space mission. The launches layer presents it
// and hides the panel while none is selected; the roster beside it hides
// while it shows. Buttons call the layer's panel commands.
const { mission: m, missionsLayer: layer } = storeToRefs(useContextStore());
const { mission: m, layer } = storeToRefs(useSpaceMissionsStore());
const root = ref(null);
// Each newly presented selection returns the Context panel to the top.
const SCROLLER = ":root[data-ui-theme='cyber'] .cyber-panel-body, .global-context-panel-inner";
// Each newly presented selection returns the mission panel to the top.
const SCROLLER = '.space-missions-panel-inner';
watch(
() => m.value?.scrollRequest,
async (request) => {
@@ -27,7 +28,7 @@ watch(
<template>
<aside id="space-mission-panel" ref="root" class="context-space-mission-detail" :aria-label="t('Selected Space Mission')" :hidden="!m">
<div class="space-mission-view-header"><span>{{ t('SELECTED SPACE MISSION') }}</span><button type="button" data-mission-close :title="t('Show all missions')" :aria-label="t('Deselect mission')" @click="layer?.deselectMission()">×</button></div>
<div class="space-mission-view-header"><span>{{ t('SELECTED SPACE MISSION') }}</span><UiCloseButton data-mission-close bare :title="t('Show all missions')" :label="t('Deselect mission')" @click="layer?.deselectMission()" /></div>
<div class="space-mission-detail">
<strong data-mission-title>{{ m ? m.title : t('MISSION') }}</strong>
<span data-mission-field data-mission-provider :hidden="m && !m.provider">{{ m?.provider }}</span>
+2 -2
View File
@@ -2,13 +2,13 @@
import { storeToRefs } from 'pinia';
import { onBeforeUpdate, onUpdated, ref } from 'vue';
import { t } from '../../../i18n/index.js';
import { useContextStore } from '../../stores/context.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
import UiEmpty from '../../kit/UiEmpty.vue';
// The Space Missions roster. The launches layer presents it; until it does,
// the list shows its loading line. Hover and keyboard focus drive the
// layer's preview, and a click selects the mission.
const { missionRoster: roster, missionsLayer: layer } = storeToRefs(useContextStore());
const { roster, layer } = storeToRefs(useSpaceMissionsStore());
const root = ref(null);
const CONTINUATION = '[data-mission-roster-focus-continuation]';
File diff suppressed because it is too large. Load diff
+82
View File
@@ -0,0 +1,82 @@
<script setup>
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The Omnibar's guided walk: the spotlight ring and the callout beside it,
// teleported to the end of `to` (the page's body). `startGuide()` in
// src/ui/omnibarGuide.js owns every decision and every word: it renders this
// with the `view` it computes for each step and keeps the parts the template
// never binds: the guide's `visible` class, the callout's entrance replay
// (its `swap` class), place and side, the ring's and the extra rings' boxes,
// and focus. It finds those elements in the rendered tree itself.
defineProps({
to: { type: Object, required: true },
view: { type: Object, required: true },
onClose: { type: Function, required: true },
onSkip: { type: Function, required: true },
onOffer: { type: Function, required: true },
onNext: { type: Function, required: true },
});
/** A progress segment's attributes: no class at all for one still to come. */
const dot = (name) => (name ? { class: name } : {});
</script>
<!-- Only line breaks inside tags: the markup has no whitespace between elements. -->
<template><Teleport :to="to"
><div class="gev-guide"
><div class="gev-guide-ring"><i></i></div
><div
class="gev-guide-callout"
role="dialog"
aria-modal="false"
tabindex="-1"
aria-labelledby="gev-guide-title"
aria-describedby="gev-guide-text"
><div class="gev-guide-head"
><p id="gev-guide-title" class="gev-guide-title">{{ view.title }}</p
><p class="gev-guide-count">{{ view.count }}</p
><UiCloseButton
class="gev-guide-close"
:label="view.endLabel"
:title="view.endLabel"
@click="onClose()" /></div
><ol class="gev-guide-progress" aria-hidden="true"
><li
v-for="(name, i) in view.progress"
:key="`${view.step}-${i}`"
v-bind="dot(name)"></li></ol
><div class="gev-guide-body"
><p id="gev-guide-text" class="gev-guide-text">{{ view.text }}</p
><p class="gev-guide-hint" :hidden="view.hintHidden"
><span class="gev-guide-hint-dot"></span
><span>{{ view.hint }}</span></p
></div
><div class="gev-guide-actions"
><p class="gev-guide-keys" :hidden="view.keysHidden"
><kbd>{{ view.keyCap }}</kbd><span>{{ view.keyText }}</span></p
><span
><UiButton
class="gev-guide-skip"
:hidden="view.skipHidden"
@click="onSkip()"
>{{ view.skipLabel }}</UiButton
><UiButton
class="gev-guide-offer"
:hidden="view.offerHidden"
@click="onOffer()"
>{{ view.offerLabel }}</UiButton
><UiButton
class="gev-guide-next"
:class="{ quiet: view.nextQuiet }"
:hidden="view.nextHidden"
@click="onNext()"
>{{ view.nextLabel }}</UiButton
></span
></div
><p class="gev-guide-status" role="status" aria-live="polite">{{
view.status
}}</p></div
></div
></Teleport
></template>
+7 -1
View File
@@ -1,19 +1,25 @@
<script setup>
import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useDisplayStore } from '../../stores/display.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
// The phone shell's tab bar and sheet backdrop. They join the end of the
// page when the shell first publishes, after the scene's credits, and leave
// it when the shell is destroyed; desktop CSS hides them meanwhile.
const { phoneShell: phone } = storeToRefs(useDisplayStore());
const { enabled: missionsEnabled } = storeToRefs(useSpaceMissionsStore());
const tabs = computed(() =>
phone.value?.tabs.filter((tab) => tab.sheet !== 'missions' || missionsEnabled.value),
);
</script>
<template>
<Teleport v-if="phone" to="body">
<div id="mobile-sheet-backdrop" :hidden="!phone.sheet"></div>
<nav id="mobile-tab-bar" :aria-label="t('Panels')" :aria-hidden="String(!phone.enabled)">
<button v-for="tab in phone.tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
<button v-for="tab in tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
</nav>
</Teleport>
</template>
+110
View File
@@ -0,0 +1,110 @@
<script setup>
import { ref } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The Québec 511 camera's floating player and its map preview, teleported to
// the end of the page. `createQuebecCctvOverlay()` owns every decision: it
// renders this with the `view` it computes and keeps the imperative parts,
// which the template never binds: each video's source, playback and load, the
// panel's dragged position, and the marker's per-frame visibility and place.
// The elements those parts need are exposed.
defineProps({
view: { type: Object, required: true },
});
const emit = defineEmits([
'close',
'play',
'refresh',
'keydown',
'headerPointerdown',
'liveError',
'liveLoadeddata',
'stillError',
'stillLoadeddata',
]);
const panel = ref(null);
const header = ref(null);
const close = ref(null);
const live = ref(null);
const marker = ref(null);
const still = ref(null);
defineExpose({ panel, header, close, live, marker, still });
// Each video's load and failure go to the owner, which marks the source.
const liveListeners = {
error: () => emit('liveError'),
loadeddata: () => emit('liveLoadeddata'),
};
const stillListeners = {
error: () => emit('stillError'),
loadeddata: () => emit('stillLoadeddata'),
};
</script>
<!-- Only line breaks inside tags: the markup has no whitespace between elements. -->
<template><Teleport to="body"
><section
ref="panel"
class="qci-panel"
:hidden="view.panelHidden"
role="region"
:aria-label="t('CCTV camera')"
@keydown="emit('keydown', $event)"
><header
ref="header"
class="qci-header"
@pointerdown="emit('headerPointerdown', $event)"
><strong>{{ view.title }}</strong
><UiCloseButton
ref="close"
:label="t('Close camera preview')"
@click="emit('close')" /></header
><p class="qci-coordinates">{{ view.coordinates }}</p
><p class="qci-credit" :hidden="view.creditHidden">{{ view.credit }}</p
><video
ref="live"
class="qci-live"
controls
muted
autoplay
loop
playsinline
:hidden="view.liveHidden"
:aria-label="t('CCTV camera')"
v-on="liveListeners"></video
><div class="qci-actions" :hidden="view.actionsHidden"
><UiButton
class="qci-play"
:hidden="view.playHidden"
@click="emit('play')"
>{{ t('Play') }}</UiButton
><UiButton :hidden="view.refreshHidden" @click="emit('refresh')">{{
t('Refresh map still')
}}</UiButton></div
><p class="qci-note" :hidden="view.noteHidden">{{ view.note }}</p
><a
target="_blank"
rel="noopener noreferrer"
:href="view.sourceHref"
:hidden="view.sourceHidden"
>{{ t("Open this image on the provider's site") }}</a
></section
><div
ref="marker"
class="qci-marker"
:class="{ 'qci-marker-link-only': view.markerLinkOnly }"
hidden
><video
ref="still"
class="qci-marker-still"
muted
playsinline
preload="none"
:hidden="view.stillHidden"
aria-hidden="true"
v-on="stillListeners"></video
><span class="qci-marker-label">{{ view.markerLabel }}</span></div
></Teleport
></template>
+6 -10
View File
@@ -1,21 +1,17 @@
<script setup>
import { storeToRefs } from 'pinia';
import { computed, onBeforeUnmount, onMounted, shallowRef, useTemplateRef } from 'vue';
import { computed, shallowRef } from 'vue';
import { t, tn } from '../../../i18n/index.js';
import UiDialog from '../../kit/UiDialog.vue';
import { vStatusText } from '../../rail/statusText.js';
import { useSceneSharingStore } from '../../stores/sceneSharing.js';
// One open scene sharing dialog, as src/ui/sceneSharing.js presents it. The
// parent keys this by dialog, so each one opens as a fresh modal.
// parent keys this by dialog, so each one opens as a fresh modal: UiDialog
// opens it on mount and closes it on unmount.
const props = defineProps({ view: { type: Object, required: true } });
const { controls } = storeToRefs(useSceneSharingStore());
const root = useTemplateRef('root');
onMounted(() => root.value?.showModal?.());
onBeforeUnmount(() => {
if (root.value?.open) root.value.close();
});
const bodyItems = computed(() => props.view.items.filter((item) => item.place === 'body'));
const footerItems = computed(() => props.view.items.filter((item) => item.place === 'footer'));
// Typing reaches the item before any republish, so a field is rewritten only
@@ -46,7 +42,7 @@ const chooserStyle = (focused) => ({ padding: '3px 9px', border: '1px solid #397
</script>
<template>
<dialog ref="root" data-director-dialog class="director-sharing-dialog" :aria-label="view.title" :style="dialogStyle" @cancel.prevent="controls?.cancel()">
<UiDialog open data-director-dialog class="director-sharing-dialog" :aria-label="view.title" :style="dialogStyle" @dismiss="controls?.cancel()" @browser-close="controls?.cancel()">
<h2 style="margin-bottom: 12px">{{ view.title }}</h2>
<div>
<template v-for="item in bodyItems" :key="item.id">
@@ -60,5 +56,5 @@ const chooserStyle = (focused) => ({ padding: '3px 9px', border: '1px solid #397
<div>
<button v-for="item in footerItems" :key="item.id" type="button" :style="buttonStyle" :disabled="item.disabled" :autofocus="item.autofocus || undefined" v-bind="item.hook ? { [item.hook]: '' } : {}" @click="controls?.click(item.id)">{{ item.label }}</button>
</div>
</dialog>
</UiDialog>
</template>
@@ -0,0 +1,43 @@
<script setup>
import { storeToRefs } from 'pinia';
import { nextTick, ref, watch } from 'vue';
import { t } from '../../../i18n/index.js';
import RailPanel from '../../rail/RailPanel.vue';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
import MissionDetail from './MissionDetail.vue';
import MissionRoster from './MissionRoster.vue';
const { enabled, mission } = storeToRefs(useSpaceMissionsStore());
const host = ref(null);
watch(
() => Boolean(mission.value),
async (selected) => {
// Keep keyboard focus in the panel when the selected mission replaces the roster.
if (!host.value?.contains(document.activeElement)) return;
await nextTick();
const control = selected
? '[data-mission-close]'
: '[data-mission-roster-id]';
host.value?.querySelector(control)?.focus();
},
);
</script>
<template>
<RailPanel
id="space-missions-panel"
:title="t('Space Missions')"
:hidden="!enabled"
:glow="false"
start-collapsed
sideways
scroll
rail-scroller
>
<div id="space-mission-panel-host" ref="host">
<MissionRoster />
<MissionDetail />
</div>
</RailPanel>
</template>
+20 -18
View File
@@ -5,6 +5,8 @@ import { compassName, hazardsNear, regionalBrief, weatherLook } from '../../spot
import { distanceKm } from '../../../data/entityContext.js';
import { CONTEXT_RADIUS_STEPS, contextRadiusKm, setContextRadiusKm } from '../../contextRadius.js';
import { contextNeedle, matchesContextSearch } from '../../contextSearch.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
import UiSlider from '../../kit/UiSlider.js';
import { sayWords, useEntityCardStore } from '../../stores/entityCard.js';
import { useOmnibarStore } from '../../stores/omnibar.js';
@@ -265,7 +267,7 @@ const sources = computed(() => {
<template v-if="entity">
<div v-if="weather || entity" class="spot-conditions__weather" :class="{ 'spot-conditions__weather--timed': entity }">
<template v-if="weather">
<span class="material-symbols-outlined spot-conditions__weather-icon" aria-hidden="true">{{ look.icon }}</span>
<UiIcon class="spot-conditions__weather-icon" :name="look.icon" :size="null" />
<div class="spot-conditions__weather-now">
<strong>{{ round(weather.temperatureC) }}°C</strong>
<span>{{ t(look.label) }}<template v-if="Number.isFinite(weather.apparentTemperatureC)"> · {{ t('feels {n}°', { n: round(weather.apparentTemperatureC) }) }}</template></span>
@@ -298,18 +300,18 @@ const sources = computed(() => {
<div v-for="block in trafficBlocks" v-show="!searching || block.items.length" :key="block.id" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">{{ block.icon }}</span>
<UiIcon :name="block.icon" :size="null" />
<span>{{ block.title }}</span>
<span class="spot-conditions__count">{{ block.count }}</span>
</h4>
<ul v-if="block.items.length">
<li v-for="item in block.items" :key="item.key">
<button type="button" @click="store.select(item.identity, { fly: true })">
<UiButton @click="store.select(item.identity, { fly: true })">
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ item.title }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(item.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
<p v-else class="spot-conditions__none">{{ block.none }}</p>
@@ -317,14 +319,14 @@ const sources = computed(() => {
<div v-show="!searching || shownHazards.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">warning</span>
<UiIcon name="warning" :size="null" />
<span>{{ t('Hazards within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count" :class="{ 'spot-conditions__count--hot': hazards.length }">{{ loading ? '…' : searching ? shownHazards.length : hazards.length }}</span>
</h4>
<ul v-if="shownHazards.length">
<li v-for="hazard in shownHazards" :key="`${hazard.kind}-${hazard.title}-${hazard.distanceKm}`" :class="`spot-conditions__hazard--${hazard.kind}`">
<button type="button" @click="flyTo(hazard)">
<span class="material-symbols-outlined" aria-hidden="true">{{ hazard.icon }}</span>
<UiButton @click="flyTo(hazard)">
<UiIcon :name="hazard.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ hazard.title }}</span>
<span v-if="hazard.detail || hazard.time" class="spot-conditions__row-detail">{{ [hazard.detail, ago(hazard.time)].filter(Boolean).join(' · ') }}</span>
@@ -333,7 +335,7 @@ const sources = computed(() => {
</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(hazard.distanceKm) }} {{ t(hazard.direction) }}</span>
</button>
</UiButton>
</li>
</ul>
<p v-else-if="!loading" class="spot-conditions__none">{{ t('No earthquakes, tropical storms or wildfires reported within {radius}.', { radius: radiusText }) }}</p>
@@ -341,40 +343,40 @@ const sources = computed(() => {
<div v-if="alerts.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">emergency_home</span>
<UiIcon name="emergency_home" :size="null" />
<span>{{ t('Broadcast alerts within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count spot-conditions__count--hot">{{ alerts.length }}</span>
</h4>
<ul>
<li v-for="alert in alerts" :key="alert.key" class="spot-conditions__hazard--alert">
<button type="button" @click="store.select(alert.identity, { fly: true })">
<span class="material-symbols-outlined" aria-hidden="true">{{ alert.icon }}</span>
<UiButton @click="store.select(alert.identity, { fly: true })">
<UiIcon :name="alert.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ alert.title }}</span>
<span class="spot-conditions__row-detail">{{ sayWords(alert.words, alert.text) }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(alert.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
</div>
<div v-if="groups?.other.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">layers</span>
<UiIcon name="layers" :size="null" />
<span>{{ t('Also within {radius}', { radius: radiusText }) }}</span>
<span class="spot-conditions__count">{{ groups.other.length }}</span>
</h4>
<ul>
<li v-for="item in groups.other" :key="item.key">
<button type="button" @click="store.select(item.identity, { fly: true })">
<span class="material-symbols-outlined" aria-hidden="true">{{ item.icon }}</span>
<UiButton @click="store.select(item.identity, { fly: true })">
<UiIcon :name="item.icon" :size="null" />
<span class="spot-conditions__row-main">
<span class="spot-conditions__row-title">{{ item.title }}</span>
<span class="spot-conditions__row-detail">{{ shownLayerName(item.layerName, item.layerId) }}</span>
</span>
<span class="spot-conditions__row-meta">{{ distance(item.distanceKm) }}</span>
</button>
</UiButton>
</li>
</ul>
</div>
@@ -384,7 +386,7 @@ const sources = computed(() => {
<slot name="before-weather" />
<div v-if="weather || entity" class="spot-conditions__weather" :class="{ 'spot-conditions__weather--timed': entity }">
<template v-if="weather">
<span class="material-symbols-outlined spot-conditions__weather-icon" aria-hidden="true">{{ look.icon }}</span>
<UiIcon class="spot-conditions__weather-icon" :name="look.icon" :size="null" />
<div class="spot-conditions__weather-now">
<strong>{{ round(weather.temperatureC) }}°C</strong>
<span>{{ t(look.label) }}<template v-if="Number.isFinite(weather.apparentTemperatureC)"> · {{ t('feels {n}°', { n: round(weather.apparentTemperatureC) }) }}</template></span>
@@ -407,7 +409,7 @@ const sources = computed(() => {
<div v-if="articles.length" class="spot-conditions__block">
<h4>
<span class="material-symbols-outlined" aria-hidden="true">newspaper</span>
<UiIcon name="newspaper" :size="null" />
<span>{{ t('Local news') }}</span>
<span v-if="brief?.newsQuery" class="spot-conditions__query">{{ brief.newsQuery }}</span>
</h4>
+2 -1
View File
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { computed, shallowRef, watch } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSegmented from '../../kit/UiSegmented.vue';
import RailPanel from '../../rail/RailPanel.vue';
import RailChips from '../../rail/RailChips.vue';
@@ -139,7 +140,7 @@ const vThumb = {
<UiSegmented class="sl-seg" item-class="sl-seg-btn" active-class="is-active" keyboard="radio" :hidden="!viewer.renderModes" :label="t('Image fit')" :options="renderModeOptions" :model-value="viewer.renderMode" @update:model-value="store.act('setRenderMode', $event)" />
</div>
<div class="sl-viewer-tools sl-viewer-tools-right">
<button id="sl-viewer-close" class="sl-viewer-x" type="button" :title="t('Close the image and deselect it on the map')" :aria-label="t('Close the street-level image')">×</button>
<UiCloseButton id="sl-viewer-close" class="sl-viewer-x" bare :title="t('Close the image and deselect it on the map')" :label="t('Close the street-level image')" />
</div>
</div>
<div id="sl-viewer-error" class="sl-error" role="alert" :hidden="!(embedOverlay || expanded) || !view?.error"><span aria-hidden="true">⚠</span> {{ view?.error || '' }}</div>
+2 -3
View File
@@ -10,6 +10,7 @@ import { shownLayerName } from '../../layerNames.js';
import { entityKind } from '../../../data/entityContext.js';
import SpotConditions from './SpotConditions.vue';
import SunDial from './SunDial.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import AltitudeGraph from './AltitudeGraph.vue';
// What the Context panel shows while nothing is picked: where the camera is
@@ -322,9 +323,7 @@ const distance = (km) =>
</span>
</span>
<span class="view-context__live-state" :class="`view-context__live-state--${layer.state.tone}`">{{ layer.state.text }}</span>
<button type="button" class="view-context__live-off" :aria-label="t('Turn off {name}', { name: layer.name })" :title="t('Turn off {name}', { name: layer.name })" @click="turnOff(layer)">
<span class="material-symbols-outlined" aria-hidden="true">close</span>
</button>
<UiCloseButton class="view-context__live-off" glyph="icon" :label="t('Turn off {name}', { name: layer.name })" :title="t('Turn off {name}', { name: layer.name })" @click="turnOff(layer)" />
</div>
<div v-if="layer.breakdown" class="view-context__split">
<p class="view-context__split-basis">{{ layer.breakdown.basis }}</p>
+2 -1
View File
@@ -2,6 +2,7 @@
import { t } from '../../../i18n/index.js';
import { ASSISTANT_NAME } from '../../../voice/control.js';
import UiChip from '../../kit/UiChip.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// Captions, plan and result, as VoiceCardControls (src/voice/voiceCard.js)
// presents them. Captions update silently; the polite live region carries
@@ -15,7 +16,7 @@ const emit = defineEmits(['dismiss']);
<div class="gev-voice-card-header">
<span class="gev-voice-card-kicker">{{ t('VOICE') }}</span>
<span id="gev-voice-card-phase" class="gev-voice-card-phase">{{ card.phase }}</span>
<button id="gev-voice-card-dismiss" class="gev-voice-card-dismiss" type="button" :aria-label="t('Dismiss voice card')" @click="emit('dismiss')">×</button>
<UiCloseButton id="gev-voice-card-dismiss" class="gev-voice-card-dismiss" :label="t('Dismiss voice card')" @click="emit('dismiss')" />
</div>
<p id="gev-voice-card-user" class="gev-voice-card-caption" data-role="user" :hidden="!card.user.visible"><span id="gev-voice-card-user-who" class="gev-voice-card-who">{{ card.user.label }}</span><span id="gev-voice-card-user-text" class="gev-voice-card-text">{{ card.user.text }}</span></p>
<p id="gev-voice-card-pointer" class="gev-voice-card-pointer" :hidden="!card.pointer.visible"><span id="gev-voice-card-pointer-kind" class="gev-voice-card-who">{{ card.pointer.kind }}</span><span class="gev-voice-card-sr">: </span><span id="gev-voice-card-pointer-text" class="gev-voice-card-pointer-label">{{ card.pointer.text }}</span></p>
+8 -13
View File
@@ -9,6 +9,8 @@ import VoiceVisualizer from './VoiceVisualizer.vue';
import ChatPanel from './ChatPanel.vue';
import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
import UiSelect from '../../kit/UiSelect.js';
// The voice control in the command dock, as its presenter
@@ -18,16 +20,9 @@ defineProps({ view: { type: Object, required: true } });
const { controls } = storeToRefs(useVoiceStore());
const emit = (name, ...args) => controls.value?.emit(name, ...args);
// A value the owner may restore after a refused change; written on every
// render, as the owner's own writes were.
const vChecked = {
mounted(el, { value }) {
el.checked = value;
},
updated(el, { value }) {
if (el.checked !== value) el.checked = value;
},
};
// The Voice Preview box's note, as one object, so the panel's other renders
// do not render the box again.
const previewBoxAttrs = { 'aria-describedby': 'gev-voice-preview-note' };
// The minutes field holds a draft until it changes: write it only when its
// owner does, not on every render (the waveform renders each frame).
const vOwnedValue = {
@@ -107,7 +102,7 @@ const frameStyle = (panel) => ({
<button id="gev-voice-settings-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Settings')" :title="t('Settings')" :aria-selected="String(view.voicePanel.selected === 'settings')" :tabindex="view.voicePanel.selected === 'settings' ? 0 : -1" aria-controls="gev-voice-settings-panel" @click="emit('tab', 1)" @keydown="emit('tab-keydown', 1, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">settings</span></button>
</div>
<PanelLayoutButtons :docked="view.layout.docked" :minimized="view.voicePanel.minimized" @dock="emit('layout-dock')" @minimize="emit('voice-minimize')" />
<button id="gev-voice-settings-close" type="button" :aria-label="t('Close voice panel')" @click="emit('settings-close')">×</button>
<UiCloseButton id="gev-voice-settings-close" :label="t('Close voice panel')" @click="emit('settings-close')" />
</div>
<div class="gev-voice-mini" role="group" :aria-label="t('Latest voice exchange')">
<p :hidden="!view.mini.user"><span class="gev-voice-mini-who">{{ t('YOU') }}</span><span id="gev-voice-mini-user">{{ view.mini.user }}</span></p>
@@ -126,11 +121,11 @@ const frameStyle = (panel) => ({
</label>
<p class="gev-voice-settings-note">{{ t('The selected AI provider is shared by voice and chat.') }}</p>
<div id="gev-settings-chat">
<label class="gev-voice-preference gev-voice-preference-toggle"><input id="gev-chat-quick" type="checkbox" v-checked="view.chat.quickChecked" @change="emit('chat-quick-change', $event.target.checked)" /><span>{{ t('Show quick commands') }}</span></label>
<UiCheckbox class="gev-voice-preference gev-voice-preference-toggle" input-id="gev-chat-quick" restore :model-value="view.chat.quickChecked" @update:model-value="emit('chat-quick-change', $event)"><span>{{ t('Show quick commands') }}</span></UiCheckbox>
<p>{{ t('Chat replies are silent. No microphone access is needed.') }}</p>
</div>
<div id="gev-settings-voice">
<label class="gev-voice-preference gev-voice-preference-toggle"><input id="gev-voice-preview-enabled" type="checkbox" aria-describedby="gev-voice-preview-note" v-checked="view.preferences.previewChecked" @change="emit('preview-change', $event.target.checked)" /><span>{{ t('Show Voice Preview') }}</span></label>
<UiCheckbox class="gev-voice-preference gev-voice-preference-toggle" input-id="gev-voice-preview-enabled" :input-attrs="previewBoxAttrs" restore :model-value="view.preferences.previewChecked" @update:model-value="emit('preview-change', $event)"><span>{{ t('Show Voice Preview') }}</span></UiCheckbox>
<p id="gev-voice-preview-note" class="gev-voice-settings-note">{{ view.preferences.previewNote }}</p>
<div class="gev-voice-timeout-group">
<label class="gev-voice-preference gev-voice-setting-title" for="gev-voice-timeout-select">{{ t('Voice inactivity timeout') }}</label>
+65 -1
View File
@@ -1,11 +1,12 @@
<script setup>
import { computed, onBeforeUnmount, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { VOICE_VISUALIZER_BARS } from '../../../voice/control.js';
import { useVoiceStore } from '../../stores/voice.js';
// The dock waveform. Its bars change every animation frame while voice is
// live, so they render here alone, not with the rest of the control.
const { bars } = storeToRefs(useVoiceStore());
const { bars, view } = storeToRefs(useVoiceStore());
const barStyle = (index) => ({
'--bar': index,
...(bars.value?.[index] && {
@@ -13,10 +14,73 @@ const barStyle = (index) => ({
'--audio-opacity': bars.value[index].opacity,
}),
});
// The same levels drawn as a wave: a smooth line through the bars, swinging
// above and below the middle by each bar's height, with two fainter traces
// at different amplitudes. Layouts that want bars hide it; the command bar
// shows the wave instead. While it is hidden (it then has no size) no path
// is computed, though the bars still change every frame.
const voiceMode = computed(() => view.value?.root?.assistantMode === 'voice');
const waveEl = ref(null);
const waveShown = ref(false);
let sizeObserver = null;
watch(waveEl, (element) => {
sizeObserver?.disconnect();
sizeObserver = null;
waveShown.value = false;
if (!element || typeof ResizeObserver !== 'function') return;
sizeObserver = new ResizeObserver(([entry]) => {
waveShown.value = entry.contentRect.width > 0 && entry.contentRect.height > 0;
});
sizeObserver.observe(element);
});
onBeforeUnmount(() => sizeObserver?.disconnect());
const W = 300;
const H = 40;
const MID = H / 2;
const levelPx = (index) => {
const raw = Number.parseFloat(bars.value?.[index]?.level);
return Number.isFinite(raw) ? raw : 5;
};
function wavePath(phase, amplitude = 1) {
const n = VOICE_VISUALIZER_BARS;
const step = W / (n + 1);
const points = [{ x: 0, y: MID }];
for (let i = 0; i < n; i++) {
// A 5px standby bar is a flat line; louder bars swing further.
const swing = Math.min(MID - 2, Math.max(0, levelPx(i) - 5) * 0.6 + 1.2);
const sign = (i + phase) % 2 === 0 ? -1 : 1;
points.push({ x: step * (i + 1), y: MID + sign * swing * amplitude });
}
points.push({ x: W, y: MID });
// Smooth through the points with quadratic curves via their midpoints.
let d = `M ${points[0].x} ${points[0].y}`;
for (let i = 1; i < points.length - 1; i++) {
const mx = (points[i].x + points[i + 1].x) / 2;
const my = (points[i].y + points[i + 1].y) / 2;
d += ` Q ${points[i].x.toFixed(1)} ${points[i].y.toFixed(1)} ${mx.toFixed(1)} ${my.toFixed(1)}`;
}
return `${d} L ${W} ${MID}`;
}
const FLAT = `M 0 ${MID} L ${W} ${MID}`;
const wave = computed(() =>
waveShown.value
? { main: wavePath(0), echo: wavePath(1), soft: wavePath(0, 0.45) }
: { main: FLAT, echo: FLAT, soft: FLAT },
);
</script>
<template>
<div class="gev-voice-visualizer" aria-hidden="true">
<span v-for="index in VOICE_VISUALIZER_BARS" :key="index" :style="barStyle(index - 1)"></span>
<svg v-if="voiceMode" ref="waveEl" class="gev-voice-wave" :viewBox="`0 0 ${W} ${H}`" preserveAspectRatio="none">
<path class="gev-voice-wave__soft" :d="wave.soft" />
<path class="gev-voice-wave__echo" :d="wave.echo" />
<path class="gev-voice-wave__main" :d="wave.main" />
</svg>
</div>
</template>
<style scoped>
.gev-voice-wave { display: none; }
</style>
+3 -2
View File
@@ -3,6 +3,7 @@ import { computed, shallowRef, useTemplateRef, watch } from 'vue';
import { formatDate, t, translateKnown } from '../../../i18n/index.js';
import { photoCreator, formatAge } from '../../../layers/wildlifeSightings/photoText.js';
import { ACARTIA_SITE, inatLicenceLabel, inatPhotoUrl, isOpenPhoto } from '../../../layers/wildlifeSightings/records.js';
import UiCloseButton from '../../kit/UiCloseButton.vue';
const props = defineProps({
sighting: { type: Object, required: true },
@@ -71,7 +72,7 @@ watch([() => props.sighting.stableId, () => photo.value?.src], () => { loaded.va
<template>
<section class="wildlife-sighting-card" data-wildlife-sighting-card tabindex="-1" :aria-label="name" @keydown.stop @keyup.stop>
<button type="button" class="wildlife-sighting-card-close" :aria-label="t('Close sighting')" @click="emit('close')">×</button>
<UiCloseButton class="wildlife-sighting-card-close" :label="t('Close sighting')" @click="emit('close')" />
<component :is="link ? 'a' : 'div'" class="wildlife-sighting-card-content" :href="link || undefined" :target="link ? '_blank' : undefined" :rel="link ? 'noopener noreferrer' : undefined" :aria-label="link ? actionLabel : undefined">
<div v-if="photo" class="wildlife-sighting-card-photo" :aria-busy="!loaded && !failed">
<p v-if="!loaded && !failed" role="status">{{ t('Loading photo...') }}</p>
@@ -115,7 +116,7 @@ watch([() => props.sighting.stableId, () => photo.value?.src], () => { loaded.va
.wildlife-sighting-card-content:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; }
/* Script focus starts inside the card; tab focus still outlines its controls. */
.wildlife-sighting-card:focus-visible { outline: none !important; }
.wildlife-sighting-card-close { position: absolute; z-index: 1; inset-block-start: 4px; inset-inline-end: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--btn-radius); background: transparent; color: inherit; font: 20px/1 var(--font-sans); cursor: pointer; }
.wildlife-sighting-card-close { position: absolute; z-index: 1; inset-block-start: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: var(--btn-radius); color: inherit; font: 20px/1 var(--font-sans); }
.wildlife-sighting-card-close:hover { background: var(--menu-bg); }
.wildlife-sighting-card-close:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.wildlife-sighting-card-photo { position: relative; width: 100%; height: 180px; }
+42 -52
View File
@@ -21,6 +21,8 @@ import {
windowText,
} from '../../../stories/storyMeta.js';
import StoriesHeader from './StoriesHeader.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
/**
* Explore (prototype `.scr-explore`): the feed beside GEV's Cesium globe,
@@ -129,12 +131,13 @@ function resetAll() {
filterOpen.value = false;
}
const filterEl = ref(null);
// The Filter button is a UiButton; its root is the button.
const filterBtn = ref(null);
function onDocDown(e) {
if (
filterOpen.value &&
!filterEl.value?.contains(e.target) &&
!filterBtn.value?.contains(e.target)
!filterBtn.value?.$el?.contains(e.target)
)
filterOpen.value = false;
}
@@ -420,13 +423,12 @@ defineExpose({
@pointerup="onHeadUp"
@pointercancel="onHeadUp"
>
<button
<UiButton
id="feedGrip"
class="feed-grip"
type="button"
:aria-label="t('Story list size. Drag, or press to change')"
@keydown="onGripKey"
></button>
></UiButton>
<h1>{{ t('GEV Stories') }}</h1>
<span
id="exCount"
@@ -449,10 +451,9 @@ defineExpose({
<option value="long">{{ t('Longest') }}</option>
<option value="az">{{ t('A–Z') }}</option>
</select>
<button
<UiButton
id="exFilterBtn"
ref="filterBtn"
type="button"
class="fh-filter"
:class="{ on: filterCount }"
:aria-expanded="filterOpen"
@@ -476,7 +477,7 @@ defineExpose({
<path d="M4 6h16M7 12h10M10 18h4" />
</svg>
<b v-if="filterCount" id="exFilterN">{{ filterCount }}</b>
</button>
</UiButton>
</div>
</div>
<div id="exTools" class="ex-tools" @pointerdown.stop @wheel.stop>
@@ -503,9 +504,8 @@ defineExpose({
autocomplete="off"
@keydown="onSearchKey"
/>
<button
<UiButton
v-if="query"
type="button"
class="ex-qx"
:aria-label="t('Clear search')"
@click="
@@ -523,7 +523,7 @@ defineExpose({
>
<path d="M6 6l12 12M18 6 6 18" />
</svg>
</button>
</UiButton>
<kbd class="hide-m">/</kbd>
</div>
<div class="fh-row">
@@ -533,21 +533,19 @@ defineExpose({
role="group"
:aria-label="t('Topics')"
>
<button
type="button"
<UiButton
class="chip"
:aria-pressed="!chips.length"
:pressed="!chips.length"
@click="toggleChip('')"
>{{ t('All') }}</button
>{{ t('All') }}</UiButton
>
<button
<UiButton
v-for="c in topics"
:key="c"
type="button"
class="chip"
:aria-pressed="chips.includes(c)"
:pressed="chips.includes(c)"
@click="toggleChip(c)"
>{{ t(c) }}</button
>{{ t(c) }}</UiButton
>
</div>
</div>
@@ -561,25 +559,25 @@ defineExpose({
>
<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)"
/>
<UiCheckbox
v-for="[value, text] in opts"
:key="value"
class="fopt"
:model-value="Boolean(filters[key]?.includes(value))"
@change="toggleFilter(key, value, $event.target.checked)"
>
<span>{{ t(text) }}</span>
</label>
</UiCheckbox>
</fieldset>
<div class="fact">
<button type="button" class="tbtn" @click="clearFilters">{{
<UiButton class="tbtn" @click="clearFilters">{{
t('Clear')
}}</button>
<button
type="button"
}}</UiButton>
<UiButton
class="tbtn solid"
@click="
filterOpen = false;
filterBtn?.focus();
filterBtn?.$el?.focus();
"
>
{{
@@ -589,7 +587,7 @@ defineExpose({
'Show {count} stories',
)
}}
</button>
</UiButton>
</div>
</div>
</div>
@@ -598,9 +596,9 @@ defineExpose({
<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">{{
<UiButton class="tbtn" @click="resetAll">{{
t('Clear all')
}}</button>
}}</UiButton>
</li>
<li v-for="s in shown" :key="s.id">
<div
@@ -623,16 +621,15 @@ defineExpose({
s.draft ? t('DRAFT') : t('STORY')
}}</span>
<span class="dur">{{ fmtDur(s.durationMs) }}</span>
<button
<UiButton
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>
</UiButton>
</span>
<span class="c-title">{{ titleOf(s) }}</span>
<span class="c-meta">{{ s.creator }} · {{ windowText(s) }}</span>
@@ -640,9 +637,8 @@ defineExpose({
><span v-for="l in layerNames(s)" :key="l">{{ l }}</span></span
>
<span class="c-play">
<button
<UiButton
class="tbtn solid"
type="button"
@click.stop="
play(
s.id,
@@ -655,7 +651,7 @@ defineExpose({
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M7 4.5v15l12.5-7.5z" /></svg
>{{ t('Play story') }}
</button>
</UiButton>
</span>
</div>
</li>
@@ -664,14 +660,13 @@ defineExpose({
<div class="ex-map">
<div class="map-slot"></div>
<div id="pins" class="pins">
<button
<UiButton
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"
:pressed="picked === p.id"
:aria-label="t('Preview {title}', { title: titleOf(p.story) })"
:style="p.style"
@click="onPin($event, p.id)"
@@ -686,7 +681,7 @@ defineExpose({
/></span>
<span class="pin-lbl">{{ titleOf(p.story).split(':')[0] }}</span>
<span class="pin-dot"></span>
</button>
</UiButton>
</div>
<div class="ex-msearch glass" role="search">
<label class="sr" for="exQ">{{ t('Search stories') }}</label>
@@ -710,9 +705,8 @@ defineExpose({
autocomplete="off"
@keydown="onSearchKey"
/>
<button
<UiButton
v-if="query"
type="button"
class="ex-qx"
:aria-label="t('Clear search')"
@click="query = ''"
@@ -727,7 +721,7 @@ defineExpose({
>
<path d="M6 6l12 12M18 6 6 18" />
</svg>
</button>
</UiButton>
<kbd>/</kbd>
</div>
<div
@@ -746,15 +740,11 @@ defineExpose({
l
}}</span></span
>
<button
class="tbtn solid"
type="button"
@click="play(pickedStory.id, null)"
>
<UiButton class="tbtn solid" @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>
</UiButton>
</div>
<div v-else class="ex-hint glass">{{
t('Pick a story or a pin to preview it here')
+19 -24
View File
@@ -9,6 +9,7 @@ import {
} from 'vue';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import UiButton from '../../kit/UiButton.vue';
/**
* The Stories top bar (prototype `.h-top.s-head`): back, GEV logo and
@@ -39,6 +40,7 @@ async function share() {
}
// Long titles scroll gently so the whole name can be read.
const mtitle = ref(null);
// Back is a UiButton; its root is the button.
const back = ref(null);
const trail = ref(null);
let observer = null;
@@ -52,8 +54,9 @@ function fitTitle() {
el.style.setProperty('--mq-dur', `${Math.max(5, (over + 22) / 22)}s`);
}
onMounted(() => {
const target = back.value?.getClientRects().length
? back.value
const backEl = back.value?.$el;
const target = backEl?.getClientRects().length
? backEl
: trail.value?.querySelector('button');
target?.focus({ preventScroll: true });
if (globalThis.ResizeObserver && mtitle.value) {
@@ -71,10 +74,9 @@ onBeforeUnmount(() => observer?.disconnect());
<template>
<header class="h-top s-head">
<button
<UiButton
ref="back"
class="s-back glass"
type="button"
:aria-label="
screen === 'story' ? t('Back to stories') : t('Back to the globe')
"
@@ -90,31 +92,28 @@ onBeforeUnmount(() => observer?.disconnect());
>
<path d="M15 6l-6 6 6 6" />
</svg>
</button>
</UiButton>
<div class="h-brand">
<div class="h-brand-row">
<button
<UiButton
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>
</UiButton>
<span class="h-word" translate="no">GOD'S EYE <b>VIEW</b></span>
</div>
<nav ref="trail" class="h-tag s-trail" :aria-label="t('Breadcrumb')">
<template v-if="screen === 'explore'">
<button type="button" @click="emit('home')">{{ t('Globe') }}</button>
<UiButton @click="emit('home')">{{ t('Globe') }}</UiButton>
<span aria-hidden="true">/</span>
<b>{{ t('Stories') }}</b>
</template>
<template v-else>
<button type="button" @click="emit('crumb')">{{
t('Stories')
}}</button>
<UiButton @click="emit('crumb')">{{ t('Stories') }}</UiButton>
<span aria-hidden="true">/</span>
<b>{{ title }}</b>
</template>
@@ -124,10 +123,9 @@ onBeforeUnmount(() => observer?.disconnect());
><span>{{ screen === 'explore' ? t('Stories') : title }}</span></span
>
<div class="h-right">
<button
<UiButton
v-if="screen === 'explore'"
class="s-msearch ibtn"
type="button"
:aria-label="t('Search')"
@click="emit('search')"
>
@@ -140,21 +138,19 @@ onBeforeUnmount(() => observer?.disconnect());
<circle cx="11" cy="11" r="6.5" />
<path d="m16 16 4.5 4.5" />
</svg>
</button>
<button
</UiButton>
<UiButton
v-if="!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
</UiButton>
<UiButton
v-if="screen === 'explore'"
class="tbtn accent hide-m"
type="button"
@click="emit('home')"
>
<svg
@@ -168,11 +164,10 @@ onBeforeUnmount(() => observer?.disconnect());
<path d="M19 12H5M11 6l-6 6 6 6" />
</svg>
<span>{{ t('Back to GEV') }}</span>
</button>
<button
</UiButton>
<UiButton
v-else
class="tbtn accent hide-m gs-back-stories"
type="button"
@click="emit('crumb')"
>
<svg
@@ -186,7 +181,7 @@ onBeforeUnmount(() => observer?.disconnect());
<path d="M19 12H5M11 6l-6 6 6 6" />
</svg>
<span>{{ t('GEV Stories') }}</span>
</button>
</UiButton>
</div>
</header>
</template>
+13 -18
View File
@@ -3,6 +3,7 @@ import { computed, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { t, tn } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import UiButton from '../../kit/UiButton.vue';
import { chapterAt } from '../../../stories/format.js';
import {
anchorStamp,
@@ -206,10 +207,9 @@ defineExpose({ dragging });
:aria-label="t('Context')"
:style="dragH != null ? { height: `${dragH}px` } : null"
>
<button
<UiButton
id="sheetHandle"
class="sheet-handle"
type="button"
:aria-expanded="sheet !== 'peek'"
:aria-label="
sheet === 'peek'
@@ -243,7 +243,7 @@ defineExpose({ dragging });
>{{ t(f[1]) }}</span
>
</span>
</button>
</UiButton>
<div class="cx-search-wrap">
<div class="cx-search">
<svg
@@ -270,9 +270,8 @@ defineExpose({ dragging });
@input="onQuery"
@keydown="onSearchKey"
/>
<button
<UiButton
class="cx-ic"
type="button"
disabled
:aria-label="t('Voice search (not in this build)')"
:title="t('Voice search (not in this build)')"
@@ -287,7 +286,7 @@ defineExpose({ dragging });
<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>
</UiButton>
</div>
<ul
v-if="results"
@@ -297,8 +296,7 @@ defineExpose({ dragging });
:aria-label="t('Search results')"
>
<li v-for="(x, i) in results" :key="`${x.type}:${x.k ?? x.title}`">
<button
type="button"
<UiButton
role="option"
:aria-selected="i === active"
@click="choose(x)"
@@ -308,7 +306,7 @@ defineExpose({ dragging });
><b>{{ x.title }}</b
><span class="sub">{{ x.sub }}</span></span
>
</button>
</UiButton>
</li>
<li v-if="!results.length" class="empty">{{
t('Nothing in this story matches.')
@@ -334,12 +332,11 @@ defineExpose({ dragging });
<div class="cx-sec">
<div class="cx-h">
{{ t('About') }}
<button
<UiButton
class="tbtn cx-close"
type="button"
style="height: 28px; padding: 0 8px"
@click="emit('hide')"
>{{ t('Close') }}</button
>{{ t('Close') }}</UiButton
>
</div>
<p class="cx-p">
@@ -356,8 +353,7 @@ defineExpose({ dragging });
<div class="cx-h">{{ t('Key moments') }}</div>
<ul class="cx-anchors">
<li v-for="(ev, i) in events" :key="i">
<button
type="button"
<UiButton
:class="{ past: playback.wallMs >= ev.wallMs }"
@click="emit('anchor', ev)"
>
@@ -366,7 +362,7 @@ defineExpose({ dragging });
><i :style="{ background: ev.color }"></i
>{{ storyText(ev.label) }}</span
>
</button>
</UiButton>
</li>
</ul>
</div>
@@ -391,10 +387,9 @@ defineExpose({ dragging });
<div class="cx-sec">
<div class="cx-h">{{ t('Related stories') }}</div>
<div class="cx-related">
<button
<UiButton
v-for="x in related"
:key="x.id"
type="button"
@click="emit('open', x.id)"
>
<span class="thumb"
@@ -404,7 +399,7 @@ defineExpose({ dragging });
><b>{{ titleOf(x) }}</b
><span class="c-meta">{{ windowText(x) }}</span></span
>
</button>
</UiButton>
</div>
</div>
</div>
+5 -6
View File
@@ -2,6 +2,7 @@
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import UiButton from '../../kit/UiButton.vue';
/**
* The right rail over the story map (prototype `.ov-rail`): Open in GEV (it
@@ -25,10 +26,9 @@ async function share() {
<template>
<div id="ovRail" class="ov ov-rail">
<!-- The scene opens in GEV's Scenes panel. -->
<button
<UiButton
id="railGev"
class="rail-btn rail-gev"
type="button"
:aria-label="t('Open this moment in GEV')"
@click="store.controller.openInGev()"
>
@@ -36,18 +36,17 @@ async function share() {
><svg class="eye" viewBox="0 0 775 520" aria-hidden="true">
<use href="#gevLogo" /></svg></span
>{{ t('Open') }}
</button>
<button
</UiButton>
<UiButton
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>
</UiButton>
</div>
</template>
+17 -21
View File
@@ -23,6 +23,7 @@ import StoriesHeader from './StoriesHeader.vue';
import StoryTimeline from './StoryTimeline.vue';
import StoryContext from './StoryContext.vue';
import StoryRail from './StoryRail.vue';
import UiButton from '../../kit/UiButton.vue';
/**
* One story (prototype `.scr-story`): a GEV scene playing on GEV's Cesium
@@ -155,6 +156,7 @@ function onCardKey(e) {
if (e.key === 'ArrowRight') setPage(page.value + 1);
else if (e.key === 'ArrowLeft') setPage(page.value - 1);
}
// Minimise and Expand are UiButtons; each root is the button.
const minBtn = ref(null);
const miniBtn = ref(null);
function setCardMin(on) {
@@ -352,10 +354,9 @@ watch([k, page], () => nextTick(sizeCard));
</div>
<ol class="ch-list">
<li v-for="(c, i) in story.chapters" :key="c.id">
<button
<UiButton
class="ch-item"
:class="{ done: i < k }"
type="button"
:aria-current="i === k ? 'step' : undefined"
@click="goChapter(i)"
>
@@ -363,7 +364,7 @@ watch([k, page], () => nextTick(sizeCard));
><span
><b>{{ chTitle(c) }}</b></span
>
</button>
</UiButton>
</li>
</ol>
</aside>
@@ -445,16 +446,15 @@ watch([k, page], () => nextTick(sizeCard));
</div>
</section>
</div>
<button
<UiButton
id="pgMin"
ref="minBtn"
class="pg-min"
type="button"
:aria-label="t('Minimise card')"
:aria-expanded="!cardMin"
@click.stop="
setCardMin(true);
nextTick(() => miniBtn?.focus());
nextTick(() => miniBtn?.$el?.focus());
"
>
<svg
@@ -467,17 +467,16 @@ watch([k, page], () => nextTick(sizeCard));
>
<path d="M6 15l6-6 6 6" />
</svg>
</button>
<button
</UiButton>
<UiButton
id="pgMini"
ref="miniBtn"
class="pg-mini"
type="button"
:aria-label="t('Expand card')"
@click.stop="
setCardMin(false);
cardPeek();
nextTick(() => minBtn?.focus());
nextTick(() => minBtn?.$el?.focus());
"
>
<b>{{ k + 1 }}/{{ story.chapters.length }}</b
@@ -492,25 +491,24 @@ watch([k, page], () => nextTick(sizeCard));
>
<path d="M6 9l6 6 6-6" />
</svg>
</button>
</UiButton>
<div
id="pgDots"
class="pg-dots"
role="group"
:aria-label="t('Card pages')"
>
<button
<UiButton
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>
></UiButton>
</div>
</div>
@@ -532,9 +530,8 @@ watch([k, page], () => nextTick(sizeCard));
id="ovPlay"
class="ov ov-play"
>
<button
<UiButton
id="btnBigPlay"
type="button"
:aria-label="t('Play story')"
@click="bigPlayClick"
>
@@ -543,13 +540,12 @@ watch([k, page], () => nextTick(sizeCard));
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>
</UiButton>
</div>
<button
<UiButton
id="btnCtx"
class="ov ov-ctxbtn tbtn"
type="button"
:aria-pressed="ctxOpen"
:pressed="ctxOpen"
@click="ctxOpen = !ctxOpen"
>
<svg
@@ -562,7 +558,7 @@ watch([k, page], () => nextTick(sizeCard));
<path d="M14 4v16" />
</svg>
<span>{{ t('Context') }}</span>
</button>
</UiButton>
<div v-if="hint" id="ovHint" class="ov ov-hint glass">{{ hint }}</div>
<StoryRail />
</div>
+8 -10
View File
@@ -3,6 +3,7 @@ import { computed, onMounted, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { useStoriesStore } from '../../stores/stories.js';
import UiButton from '../../kit/UiButton.vue';
import { chapterAt } from '../../../stories/format.js';
import {
chapterTitle,
@@ -318,10 +319,9 @@ defineExpose({ goChapter });
<template>
<div id="timeline" class="timeline">
<button
<UiButton
id="tlPlay"
class="tl-play"
type="button"
:aria-label="playMode === 'pause' ? t('Pause') : t('Play')"
@click="togglePlay"
>
@@ -331,7 +331,7 @@ defineExpose({ goChapter });
fill="currentColor"
v-html="ICON[playMode]"
></svg>
</button>
</UiButton>
<div
id="tlTrack"
ref="track"
@@ -377,10 +377,9 @@ defineExpose({ goChapter });
<span id="tlHeadTime">{{ headTime }}</span>
</div>
<div id="tlPips" role="group" :aria-label="t('Key moments')">
<button
<UiButton
v-for="(ev, i) in events"
:key="i"
type="button"
class="tl-pip"
:class="{ snap: snap === -2 - i }"
:data-e="i"
@@ -396,7 +395,7 @@ defineExpose({ goChapter });
@keydown.enter.stop
>
<i :style="{ background: ev.color }"></i>
</button>
</UiButton>
</div>
<div
v-if="tip"
@@ -439,12 +438,11 @@ defineExpose({ goChapter });
<span id="tlTime" class="tl-time" aria-hidden="true">
<span class="tt-c">{{ headTime }}</span>
</span>
<button
<UiButton
id="stExpand"
class="tl-vol"
type="button"
:aria-label="expanded ? t('Exit expanded map') : t('Expand map')"
:aria-pressed="expanded"
:pressed="expanded"
@click="toggleExpand"
>
<svg
@@ -457,6 +455,6 @@ defineExpose({ goChapter });
>
<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
</svg>
</button>
</UiButton>
</div>
</template>