From 7a0b649bf51c001f6930111e318347953f5b29fc Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Mon, 16 Nov 2026 13:35:05 -0800 Subject: [PATCH] Stories: remove unreachable prototype paths GEV stories never explore, carry no world time and are never live: drop the resume play state, Jump to live, the exploring branches and world-time arguments, the overridden play button rules, and the hidden rail and fill. The legend reads a plain field instead of a mock one. --- src/i18n/locales/ar.json | 2 - src/i18n/locales/de.json | 2 - src/i18n/locales/es.json | 2 - src/i18n/locales/fr.json | 2 - src/i18n/locales/he.json | 2 - src/i18n/locales/it.json | 2 - src/i18n/locales/ja.json | 2 - src/i18n/locales/pt.json | 2 - src/i18n/locales/ru.json | 2 - src/i18n/locales/sv.json | 2 - src/i18n/locales/uk.json | 2 - src/i18n/locales/zh-CN.json | 2 - src/i18n/locales/zh-Hant.json | 2 - src/stories/catalog.js | 2 +- src/stories/controller.js | 7 +- src/stories/gevPlayer.js | 5 -- src/stories/storyMeta.js | 8 +- src/ui/stores/stories.js | 2 - src/ui/styles/stories.css | 102 +------------------------ src/ui/views/stories/StoryContext.vue | 10 +-- src/ui/views/stories/StoryScreen.vue | 25 +----- src/ui/views/stories/StoryTimeline.vue | 71 +++-------------- 22 files changed, 26 insertions(+), 232 deletions(-) diff --git a/src/i18n/locales/ar.json b/src/i18n/locales/ar.json index 058dc91f5..bcef38284 100644 --- a/src/i18n/locales/ar.json +++ b/src/i18n/locales/ar.json @@ -4092,11 +4092,9 @@ "Resize context panel": "تغيير حجم لوحة السياق", "Swipe up for context": "اسحب لأعلى لعرض السياق", "Chapter start": "بداية الفصل", - "Resume story": "استئناف القصة", "Story time": "وقت القصة", "chapter": "الفصل", "Key moment: {label}": "لحظة رئيسية: {label}", - "Jump to live": "الانتقال إلى المباشر", "Exit expanded map": "الخروج من الخريطة الموسّعة", "Expand map": "توسيع الخريطة", "Exit cockpit to open Stories": "اخرج من القمرة لفتح القصص", diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 01b409198..7fa9a3fcb 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -3732,11 +3732,9 @@ "Resize context panel": "Größe des Kontextbereichs ändern", "Swipe up for context": "Nach oben wischen für Kontext", "Chapter start": "Kapitelanfang", - "Resume story": "Story fortsetzen", "Story time": "Story-Zeit", "chapter": "Kapitel", "Key moment: {label}": "Schlüsselmoment: {label}", - "Jump to live": "Zu live springen", "Exit expanded map": "Vergrößerte Karte verlassen", "Expand map": "Karte vergrößern", "Exit cockpit to open Stories": "Cockpit verlassen, um Storys zu öffnen", diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 03b5f57eb..aa039bf4f 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -3822,11 +3822,9 @@ "Resize context panel": "Cambiar el tamaño del panel de contexto", "Swipe up for context": "Desliza hacia arriba para ver el contexto", "Chapter start": "Inicio del capítulo", - "Resume story": "Reanudar historia", "Story time": "Hora de la historia", "chapter": "capítulo", "Key moment: {label}": "Momento clave: {label}", - "Jump to live": "Ir al directo", "Exit expanded map": "Salir del mapa ampliado", "Expand map": "Ampliar mapa", "Exit cockpit to open Stories": "Sal de la cabina para abrir Historias", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index a7d69f96e..c1d4a80e6 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -3822,11 +3822,9 @@ "Resize context panel": "Redimensionner le panneau de contexte", "Swipe up for context": "Balayez vers le haut pour le contexte", "Chapter start": "Début du chapitre", - "Resume story": "Reprendre le récit", "Story time": "Heure du récit", "chapter": "chapitre", "Key moment: {label}": "Moment clé : {label}", - "Jump to live": "Revenir au direct", "Exit expanded map": "Quitter la carte agrandie", "Expand map": "Agrandir la carte", "Exit cockpit to open Stories": "Quittez le cockpit pour ouvrir les Récits", diff --git a/src/i18n/locales/he.json b/src/i18n/locales/he.json index b5fa4e050..83b663f9b 100644 --- a/src/i18n/locales/he.json +++ b/src/i18n/locales/he.json @@ -3822,11 +3822,9 @@ "Resize context panel": "שינוי גודל לוח ההקשר", "Swipe up for context": "החלק למעלה להקשר", "Chapter start": "תחילת הפרק", - "Resume story": "המשך הסיפור", "Story time": "זמן הסיפור", "chapter": "פרק", "Key moment: {label}": "רגע מפתח: {label}", - "Jump to live": "מעבר לזמן אמת", "Exit expanded map": "יציאה מהמפה המורחבת", "Expand map": "הרחבת המפה", "Exit cockpit to open Stories": "צא מתא הטייס כדי לפתוח את הסיפורים", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 198faae54..81215df10 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -3822,11 +3822,9 @@ "Resize context panel": "Ridimensiona il pannello contesto", "Swipe up for context": "Scorri verso l'alto per il contesto", "Chapter start": "Inizio del capitolo", - "Resume story": "Riprendi la storia", "Story time": "Ora della storia", "chapter": "capitolo", "Key moment: {label}": "Momento chiave: {label}", - "Jump to live": "Vai alla diretta", "Exit expanded map": "Esci dalla mappa espansa", "Expand map": "Espandi la mappa", "Exit cockpit to open Stories": "Esci dal cockpit per aprire le Storie", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index f5827f641..66cbf58cb 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -3642,11 +3642,9 @@ "Resize context panel": "コンテキストパネルのサイズを変更", "Swipe up for context": "上にスワイプしてコンテキストを表示", "Chapter start": "章の始まり", - "Resume story": "ストーリーを再開", "Story time": "ストーリー時刻", "chapter": "章", "Key moment: {label}": "重要な場面: {label}", - "Jump to live": "ライブに移動", "Exit expanded map": "拡大地図を終了", "Expand map": "地図を拡大", "Exit cockpit to open Stories": "ストーリーを開くにはコックピットを終了してください", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index a4994b4f9..9d3453ce8 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -3822,11 +3822,9 @@ "Resize context panel": "Redimensionar o painel de contexto", "Swipe up for context": "Deslize para cima para ver o contexto", "Chapter start": "Início do capítulo", - "Resume story": "Retomar história", "Story time": "Horário da história", "chapter": "capítulo", "Key moment: {label}": "Momento-chave: {label}", - "Jump to live": "Ir para o ao vivo", "Exit expanded map": "Sair do mapa ampliado", "Expand map": "Ampliar mapa", "Exit cockpit to open Stories": "Saia da cabine para abrir Histórias", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 10d63228a..77bf690fc 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -3912,11 +3912,9 @@ "Resize context panel": "Изменить размер панели контекста", "Swipe up for context": "Проведите вверх, чтобы увидеть контекст", "Chapter start": "Начало главы", - "Resume story": "Продолжить историю", "Story time": "Время истории", "chapter": "глава", "Key moment: {label}": "Ключевой момент: {label}", - "Jump to live": "К реальному времени", "Exit expanded map": "Выйти из развёрнутой карты", "Expand map": "Развернуть карту", "Exit cockpit to open Stories": "Выйдите из кабины, чтобы открыть Истории", diff --git a/src/i18n/locales/sv.json b/src/i18n/locales/sv.json index e4c292179..6c1ff22d4 100644 --- a/src/i18n/locales/sv.json +++ b/src/i18n/locales/sv.json @@ -3732,11 +3732,9 @@ "Resize context panel": "Ändra storlek på kontextpanelen", "Swipe up for context": "Svep uppåt för kontext", "Chapter start": "Kapitlets början", - "Resume story": "Fortsätt berättelsen", "Story time": "Berättelsens tid", "chapter": "kapitel", "Key moment: {label}": "Nyckelögonblick: {label}", - "Jump to live": "Hoppa till live", "Exit expanded map": "Lämna den förstorade kartan", "Expand map": "Förstora kartan", "Exit cockpit to open Stories": "Lämna cockpiten för att öppna Berättelser", diff --git a/src/i18n/locales/uk.json b/src/i18n/locales/uk.json index 5e53a3a72..15a81781b 100644 --- a/src/i18n/locales/uk.json +++ b/src/i18n/locales/uk.json @@ -3912,11 +3912,9 @@ "Resize context panel": "Змінити розмір панелі контексту", "Swipe up for context": "Проведіть угору, щоб побачити контекст", "Chapter start": "Початок розділу", - "Resume story": "Продовжити історію", "Story time": "Час історії", "chapter": "розділ", "Key moment: {label}": "Ключовий момент: {label}", - "Jump to live": "До реального часу", "Exit expanded map": "Вийти з розгорнутої карти", "Expand map": "Розгорнути карту", "Exit cockpit to open Stories": "Вийдіть із кабіни, щоб відкрити Історії", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index cd06be695..5178c1f06 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -3642,11 +3642,9 @@ "Resize context panel": "调整背景信息面板大小", "Swipe up for context": "上滑查看背景信息", "Chapter start": "章节开始", - "Resume story": "继续故事", "Story time": "故事时间", "chapter": "章节", "Key moment: {label}": "关键时刻:{label}", - "Jump to live": "跳转到实时", "Exit expanded map": "退出放大地图", "Expand map": "放大地图", "Exit cockpit to open Stories": "请先退出座舱,再打开故事", diff --git a/src/i18n/locales/zh-Hant.json b/src/i18n/locales/zh-Hant.json index 30bc89c0a..a8c217b0a 100644 --- a/src/i18n/locales/zh-Hant.json +++ b/src/i18n/locales/zh-Hant.json @@ -3642,11 +3642,9 @@ "Resize context panel": "調整背景資訊面板大小", "Swipe up for context": "上滑查看背景資訊", "Chapter start": "章節開始", - "Resume story": "繼續故事", "Story time": "故事時間", "chapter": "章節", "Key moment: {label}": "關鍵時刻:{label}", - "Jump to live": "跳轉到即時", "Exit expanded map": "退出放大地圖", "Expand map": "放大地圖", "Exit cockpit to open Stories": "請先退出座艙,再開啟故事", diff --git a/src/stories/catalog.js b/src/stories/catalog.js index 53a7ee129..bc7fc5b06 100644 --- a/src/stories/catalog.js +++ b/src/stories/catalog.js @@ -184,7 +184,7 @@ function sceneContext(recipe) { places: own.places ?? [], moments: own.moments ?? [], // The layers' own names on the legend. - mock: { legend: layers.map((l) => ['dot', '#6be8ff', l.label]) }, + legend: layers.map((l) => ['dot', '#6be8ff', l.label]), sources: [...(own.sources ?? []), ...layers.flatMap((l) => l.sources)], // Each part is translated on its own, as shown. background: own.background ?? layers.map((l) => l.about), diff --git a/src/stories/controller.js b/src/stories/controller.js index 900a3bf76..8147792eb 100644 --- a/src/stories/controller.js +++ b/src/stories/controller.js @@ -710,10 +710,8 @@ export function createStoriesController({ function onTick(state) { store.playback = { wallMs: state.wallMs, - worldMs: state.worldMs, durationMs: state.durationMs, playing: state.playing, - exploring: state.exploring, chapterIndex: state.chapterIndex, }; if (state.playing) store.bigPlay = false; @@ -919,7 +917,7 @@ export function createStoriesController({ id: story.id, title: story.title, atMs, - when: anchorStamp(story, atMs, null), + when: anchorStamp(story, atMs), }; } @@ -1051,10 +1049,8 @@ export function createStoriesController({ : 0; store.playback = { wallMs: atMs, - worldMs: null, durationMs: story.durationMs, playing: false, - exploring: false, chapterIndex: 0, }; const start = () => { @@ -1143,7 +1139,6 @@ export function createStoriesController({ play: () => player?.play(), pause: () => player?.pause(), seek: (ms) => player?.seek(ms), - resume: () => player?.resume(), focusEvent: (event) => player?.focus(event), get kind() { return player ? 'gev' : null; diff --git a/src/stories/gevPlayer.js b/src/stories/gevPlayer.js index aed8bc3f0..7f9662822 100644 --- a/src/stories/gevPlayer.js +++ b/src/stories/gevPlayer.js @@ -57,10 +57,8 @@ export function createGevPlayer(director, story, hooks = {}) { const state = () => ({ wallMs, - worldMs: null, durationMs, playing, - exploring: false, chapterIndex: Math.min(shotIndex, story.chapters.length - 1), }); const tick = () => { @@ -158,9 +156,6 @@ export function createGevPlayer(director, story, hooks = {}) { shotIndex = chapterAt(story, wallMs); seekToCurrentTime(options); }, - resume() { - return this.play(); - }, /** A key moment: go to that point of the scene. */ focus(event) { if (event?.wallMs != null) this.seek(event.wallMs); diff --git a/src/stories/storyMeta.js b/src/stories/storyMeta.js index a46f30478..21f894868 100644 --- a/src/stories/storyMeta.js +++ b/src/stories/storyMeta.js @@ -96,7 +96,7 @@ export function topicsOf(stories) { } /** The clock overlay: big line and small line. */ -export function clockText(s, wallMs, worldMs, chapterIndex) { +export function clockText(s, chapterIndex) { return { big: t('Shot {n} of {total}', { n: chapterIndex + 1, @@ -133,12 +133,12 @@ export function anchorStamp(s, wallMs) { /** Legend entries [shape, colour, label]. */ export function layersFor(s) { - if (s.mock?.legend?.length) return s.mock.legend; + if (s.legend?.length) return s.legend; return (s.tags ?? []).map((tag) => ['dot', '#e8eaed', tag]); } -/** "Right now" facts per story (prototype nowFacts): [value, label, warn]. */ -export function nowFacts(s, worldMs, wallMs = 0) { +/** "Right now" facts per story: [value, label]. */ +export function nowFacts(s) { const out = [[String(s.chapters.length), msg('Shots')]]; if (s.tags?.length) out.push([String(s.tags.length), msg('Layers on')]); return out; diff --git a/src/ui/stores/stories.js b/src/ui/stores/stories.js index 52444b36e..2d9186046 100644 --- a/src/ui/stores/stories.js +++ b/src/ui/stores/stories.js @@ -24,10 +24,8 @@ export const useStoriesStore = defineStore('stories', { thumbs: {}, playback: { wallMs: 0, - worldMs: null, durationMs: 0, playing: false, - exploring: false, chapterIndex: 0, }, /** The big Play button over a story that opened paused. */ diff --git a/src/ui/styles/stories.css b/src/ui/styles/stories.css index a2415c1e8..e9566a011 100644 --- a/src/ui/styles/stories.css +++ b/src/ui/styles/stories.css @@ -1565,21 +1565,6 @@ background: rgba(10, 10, 16, 0.94); border-top: 1px solid var(--glass-border); } -#gev-stories .tl-play { - width: 42px; - height: 42px; - flex: none; - border-radius: 13px; - display: grid; - place-items: center; - background: var(--accent); - color: #001820; - box-shadow: 0 0 20px -6px var(--accent-glow); -} -#gev-stories .tl-play svg { - width: 18px; - height: 18px; -} #gev-stories .tl-track { position: relative; flex: 1; @@ -1589,22 +1574,6 @@ cursor: pointer; border-radius: 6px; } -#gev-stories .tl-rail { - position: absolute; - left: 0; - right: 0; - top: 50%; - height: 6px; - margin-top: -3px; - border-radius: 6px; - background: rgba(255, 255, 255, 0.12); -} -#gev-stories .tl-fill { - position: absolute; - inset: 0 auto 0 0; - border-radius: inherit; - background: linear-gradient(90deg, rgba(0, 212, 255, 0.5), var(--accent)); -} #gev-stories .tl-pip { position: absolute; top: 50%; @@ -1702,11 +1671,6 @@ width: 18px; height: 18px; } -#gev-stories .tl-play.resume { - background: var(--warn); - color: #241400; - box-shadow: 0 0 20px -6px rgba(255, 180, 90, 0.6); -} #gev-stories .tl-track:focus-visible { outline: 2px solid var(--text-primary); } @@ -1731,6 +1695,9 @@ #gev-stories .tl-play { width: 40px; height: 40px; + flex: none; + display: grid; + place-items: center; border-radius: 12px; background: rgba(0, 212, 255, 0.14); color: var(--accent); @@ -1752,20 +1719,10 @@ width: 16px; height: 16px; } -#gev-stories .tl-play.resume { - background: rgba(255, 180, 90, 0.16); - color: var(--warn); - border-color: rgba(255, 180, 90, 0.55); - box-shadow: 0 0 18px -8px rgba(255, 180, 90, 0.6); -} #gev-stories .tl-track { height: 36px; margin: 0 4px; } -#gev-stories .tl-rail, -#gev-stories .tl-fill { - display: none; -} #gev-stories #tlTicks { position: absolute; left: 0; @@ -2066,50 +2023,6 @@ min-width: 0; color: var(--text-secondary); } -#gev-stories .tl-live { - flex: none; - display: inline-flex; - align-items: center; - gap: 6px; - height: 26px; - padding: 0 9px; - border-radius: 8px; - border: 1px solid var(--glass-border-hover); - font: 600 10px var(--font-mono); - letter-spacing: 0.14em; - color: var(--text-dim); - background: transparent; -} -#gev-stories .tl-live[hidden] { - display: none; -} -#gev-stories .tl-live i { - width: 6px; - height: 6px; - border-radius: 50%; - background: currentColor; -} -#gev-stories .tl-live:hover { - color: var(--text-primary); -} -#gev-stories .tl-live.edge { - color: var(--live); - border-color: rgba(255, 77, 77, 0.5); -} -#gev-stories .tl-live.edge i { - animation: gsx-pulse 1.6s ease-out infinite; -} -#gev-stories .timeline[data-kind='live'] #tlTicks::after { - content: ''; - position: absolute; - right: -1px; - top: -5px; - bottom: -5px; - width: 2px; - border-radius: 2px; - background: var(--live); - box-shadow: 0 0 8px var(--live); -} @container app (max-width: 1100px) { #gev-stories .tl-time .tt-c { display: none; @@ -2129,9 +2042,6 @@ #gev-stories #tlHeadTime { display: inline; } - #gev-stories .tl-live { - display: none; - } #gev-stories .tl-pip { width: 26px; height: 18px; @@ -2148,9 +2058,6 @@ #gev-stories #tlTicks { transition: none !important; } - #gev-stories .tl-live.edge i { - animation: none; - } } #gev-stories .cx-sec { padding: 14px 16px; @@ -2730,9 +2637,6 @@ #gev-stories .ov-legend { display: none; } - #gev-stories .scr-story.exploring .ov-clock { - display: none; - } #gev-stories .ov-hint { bottom: 54px; font-size: 11px; diff --git a/src/ui/views/stories/StoryContext.vue b/src/ui/views/stories/StoryContext.vue index 2bf1230b2..256d883a7 100644 --- a/src/ui/views/stories/StoryContext.vue +++ b/src/ui/views/stories/StoryContext.vue @@ -39,10 +39,8 @@ const background = computed(() => .map((part) => storyText(part)) .join(' '), ); -const stamp = (ms, world) => anchorStamp(props.story, ms, world); -const facts = computed(() => - nowFacts(props.story, playback.value.worldMs, playback.value.wallMs), -); +const stamp = (ms) => anchorStamp(props.story, ms); +const facts = computed(() => nowFacts(props.story)); const peekFacts = computed(() => facts.value.slice(0, 3)); const sheetSum = computed( () => @@ -77,7 +75,7 @@ const results = computed(() => { k: i, ev, title: storyText(ev.label), - sub: `${t('Key moments')} · ${stamp(ev.wallMs, ev.tMs)}`, + sub: `${t('Key moments')} · ${stamp(ev.wallMs)}`, })) .filter(hit); const srcs = props.story.sources @@ -363,7 +361,7 @@ defineExpose({ dragging }); :class="{ past: playback.wallMs >= ev.wallMs }" @click="emit('anchor', ev)" > - {{ stamp(ev.wallMs, ev.tMs) }} + {{ stamp(ev.wallMs) }} {{ storyText(ev.label) }} titleOf(props.story)); const k = computed(() => chapterAt(props.story, playback.value.wallMs)); const chapter = computed(() => props.story.chapters[k.value]); const chTitle = (c) => chapterTitle(props.story, c); -const clock = computed(() => - clockText( - props.story, - playback.value.wallMs, - playback.value.worldMs, - k.value, - ), -); +const clock = computed(() => clockText(props.story, k.value)); const layers = computed(() => layersFor(props.story)); -const facts = computed(() => - nowFacts(props.story, playback.value.worldMs, playback.value.wallMs), -); +const facts = computed(() => nowFacts(props.story)); const posText = computed(() => { const { lat, lon, altKm } = camera.value; return { @@ -80,7 +71,6 @@ const legendClass = (l) => (l[0] === 'dot' ? 'dot' : l[0] === 'sq' ? 'sq' : ''); const timelineRef = ref(null); function goChapter(i) { store.controller.seek(props.story.chapters[i].wallMs + 1); - if (playback.value.exploring) store.controller.resume(); } function goAnchor(ev) { store.controller.focusEvent(ev); @@ -88,8 +78,7 @@ function goAnchor(ev) { } function bigPlayClick() { bigPlay.value = false; - if (playback.value.exploring) store.controller.resume(); - else store.controller.play(); + store.controller.play(); } // ── Story card: Chapter · On the map · Right now ── @@ -201,12 +190,7 @@ let pokeTimer = 0; function pokeControls() { controlsHidden.value = false; clearTimeout(pokeTimer); - if ( - expanded.value && - playback.value.playing && - !playback.value.exploring && - innerWidth <= 720 - ) + if (expanded.value && playback.value.playing && innerWidth <= 720) pokeTimer = setTimeout(() => (controlsHidden.value = true), 3000); } watch([expanded, () => playback.value.playing], pokeControls); @@ -331,7 +315,6 @@ watch([k, page], () => nextTick(sizeCard)); id="scrStory" class="scr scr-story" :class="{ - exploring: playback.exploring, expanded, 'ctx-open': ctxOpen, 'ctx-sized': !!contextWidth, diff --git a/src/ui/views/stories/StoryTimeline.vue b/src/ui/views/stories/StoryTimeline.vue index 72180a398..070a6af83 100644 --- a/src/ui/views/stories/StoryTimeline.vue +++ b/src/ui/views/stories/StoryTimeline.vue @@ -14,7 +14,7 @@ import { /** * The story timeline (prototype `.timeline`): chapter segments with - * magnetic ticks, key-moment pips, a scrub bubble, sound and expand. + * magnetic ticks, key-moment pips, a scrub bubble and expand. * Positions are wall milliseconds on the GEV scene's own clock. */ const props = defineProps({ story: { type: Object, required: true } }); @@ -34,24 +34,15 @@ const chTitle = (c) => chapterTitle(props.story, c); const events = computed(() => props.story.events ?? []); const seek = (ms) => store.controller.seek(clamp(ms, 0, dur.value - 10)); -// ── Play button: pause while playing, resume while exploring, otherwise play ── +// ── Play button: pause while playing, otherwise play ── const ICON = { pause: '', play: '', - resume: - '', }; -const playMode = computed(() => - playback.value.exploring && !playback.value.playing - ? 'resume' - : playback.value.playing - ? 'pause' - : 'play', -); +const playMode = computed(() => (playback.value.playing ? 'pause' : 'play')); function togglePlay() { - if (playMode.value === 'resume') store.controller.resume(); - else if (playback.value.playing) store.controller.pause(); + if (playback.value.playing) store.controller.pause(); else store.controller.play(); } @@ -76,19 +67,9 @@ const segs = computed(() => ); // ── Readout ── -const clock = computed(() => - clockText( - props.story, - tNow.value, - previewMs.value == null ? playback.value.worldMs : null, - k.value, - ), -); +const clock = computed(() => clockText(props.story, k.value)); const stampAt = (ms) => fmtDur(ms); const headTime = computed(() => `${fmtDur(tNow.value)} / ${fmtDur(dur.value)}`); -const atEdge = computed( - () => props.story.live && tNow.value >= dur.value - 600, -); // ── Scrubbing: preview locally, seek the globe once on release ── const track = ref(null); @@ -216,14 +197,7 @@ function onLeave() { // The bubble follows the knob while playing and the pointer while hovering. const bubbleT = computed(() => bubbleAt.value ?? tNow.value); const bubbleK = computed(() => chapterAt(props.story, bubbleT.value)); -const bubbleClock = computed(() => - clockText( - props.story, - bubbleT.value, - bubbleAt.value == null ? playback.value.worldMs : null, - bubbleK.value, - ), -); +const bubbleClock = computed(() => clockText(props.story, bubbleK.value)); const bubbleEm = computed(() => { if (snap.value >= 0) return { text: t('Chapter start'), color: null }; if (snap.value <= -2) { @@ -278,7 +252,6 @@ function pipClick(i) { // ── Keyboard on the track ── function goChapter(i) { seek(chapters.value[i].wallMs + 1); - if (playback.value.exploring) store.controller.resume(); } // Previous goes to the start of this chapter first, like a video player. function stepChapter(d) { @@ -339,28 +312,17 @@ function toggleExpand() { store.ctxOpen = false; setTimeout(() => store.controller.reframe(), 320); } -function jumpLive() { - seek(dur.value); - if (playback.value.exploring) store.controller.resume(); -} defineExpose({ goChapter });