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.
This commit is contained in:
Sameh Khamis committed 2026-11-16 13:35:05 -08:00
1 parent f4b535d89e
commit 7a0b649bf5
22 files changed
+26 -232

No files matched your search

-2
View File
@@ -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. */
+3 -99
View File
@@ -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;
+4 -6
View File
@@ -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)"
>
<span class="tchip">{{ stamp(ev.wallMs, ev.tMs) }}</span>
<span class="tchip">{{ stamp(ev.wallMs) }}</span>
<span class="al"
><i :style="{ background: ev.color }"></i
>{{ storyText(ev.label) }}</span
+4 -21
View File
@@ -47,18 +47,9 @@ const title = computed(() => titleOf(props.story));
const k = computed(() => chapterAt(props.story, playback.value.wallMs));
const chapter = computed(() => props.story.chapters[k.value]);
const chTitle = (c) => chapterTitle(props.story, c);
const clock = computed(() =>
clockText(
props.story,
playback.value.wallMs,
playback.value.worldMs,
k.value,
),
);
const 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,
+9 -62
View File
@@ -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:
'<rect x="6.5" y="5" width="4" height="14" rx="1.4"/><rect x="13.5" y="5" width="4" height="14" rx="1.4"/>',
play: '<path d="M8 5.7v12.6c0 .9 1 1.4 1.7.9l9.7-6.3a1.1 1.1 0 0 0 0-1.8L9.7 4.8C9 4.3 8 4.8 8 5.7Z"/>',
resume:
'<path d="M4.5 12a7.5 7.5 0 1 0 2.2-5.3" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/><path d="M3.5 3.8v4.6h4.6" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>',
};
const playMode = computed(() =>
playback.value.exploring && !playback.value.playing
? 'resume'
: playback.value.playing
? 'pause'
: 'play',
);
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 });
</script>
<template>
<div id="timeline" class="timeline" :data-kind="story.live ? 'live' : ''">
<div id="timeline" class="timeline">
<button
id="tlPlay"
class="tl-play"
:class="{ resume: playMode === 'resume' }"
type="button"
:aria-label="
playMode === 'resume'
? t('Resume story')
: playMode === 'pause'
? t('Pause')
: t('Play')
"
:aria-label="playMode === 'pause' ? t('Pause') : t('Play')"
@click="togglePlay"
>
<svg
@@ -390,9 +352,6 @@ defineExpose({ goChapter });
@pointerleave="onLeave"
@keydown="onKey"
>
<div class="tl-rail">
<div id="tlFill" class="tl-fill" :style="{ width: `${pct}%` }"></div>
</div>
<div id="tlTicks">
<span
v-for="s in segs"
@@ -478,20 +437,8 @@ defineExpose({ goChapter });
</div>
</div>
<span id="tlTime" class="tl-time" aria-hidden="true">
<b v-if="story.live">{{ clock.big }}</b>
<span v-else class="tt-c">{{ headTime }}</span>
<span class="tt-c">{{ headTime }}</span>
</span>
<button
v-if="story.live"
id="tlLive"
class="tl-live"
:class="{ edge: atEdge }"
type="button"
:aria-label="t('Jump to live')"
@click="jumpLive"
>
<i></i>{{ t('LIVE') }}
</button>
<button
id="stExpand"
class="tl-vol"