Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions site/account.css
Original file line number Diff line number Diff line change
Expand Up @@ -963,3 +963,10 @@ body.globe:has(.g-shelf:not([hidden])) #ai-live.low { bottom: 238px; }
.pub-top { display: flex; align-items: center; gap: 6px; margin: -4px -6px 2px; }
.pub-top h2 { flex: 1; margin: 0; }
.pub-top .ibtn { width: 30px; height: 30px; flex: none; }
/* Full screen on a phone: the search and the menu button have gone, so the title of the view and the period move
up into the room they leave, under the notch (asked for, Nov 2026). They step back down while the top peeks in. */
@media (max-width: 699px) {
#road-views, #road-head { transition: top .3s; }
body.fullscreen:not(.peek) #road-views { top: calc(14px + env(safe-area-inset-top)); }
body.fullscreen:not(.peek):not(.multi) #road-head { top: calc(10px + env(safe-area-inset-top)); }
}
17 changes: 15 additions & 2 deletions site/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2530,7 +2530,8 @@ import { NEAR, GONE, FAR, FINE, calMarks, dayText, sizeAt, warp, focalYears, tra
try {
const AC = window.AudioContext || window.webkitAudioContext;
if (!sound.ctx && AC) sound.ctx = new AC();
if (sound.ctx && sound.ctx.state === 'suspended') sound.ctx.resume();
// A phone puts the sound to sleep when the page is left ('suspended', or Safari's 'interrupted'); wake it.
if (sound.ctx && sound.ctx.state !== 'running' && sound.ctx.state !== 'closed') sound.ctx.resume().catch(() => {});
} catch { sound.ctx = null; }
}
// One breath of air: noise through a filter that closes as the sound settles, so it starts soft, sinks and
Expand Down Expand Up @@ -2725,7 +2726,19 @@ import { NEAR, GONE, FAR, FINE, calMarks, dayText, sizeAt, warp, focalYears, tra
drawSubs(); tune();
}
// The road rests while the tab is hidden, so the music does too.
// Leaving the page pauses play (reported on a phone, Nov 2026: back on the page, play did not move at all). A phone
// stops the sound while the page is away, so a line being said never ends and play would wait on it for good;
// paused, the line is held where it was and play goes on from there when it is pressed again.
document.addEventListener('visibilitychange', () => {
if (document.hidden && play.on) pausePlay();
// Back on the page: a frame asked for while it was away may never come (the picture then stood frozen while the
// sound went on), so the road and the globes start their frames again.
if (!document.hidden) {
if (road.raf) { cancelAnimationFrame(road.raf); road.raf = 0; road.live = false; }
if (globe) globe.wake();
for (const pn of panes.values()) pn.g.wake();
roadKick();
}
if (!music.el) return;
if (document.hidden) music.el.pause(); else if (music.want) { const p = music.el.play(); if (p && p.catch) p.catch(() => {}); }
});
Expand Down Expand Up @@ -3324,7 +3337,7 @@ import { NEAR, GONE, FAR, FINE, calMarks, dayText, sizeAt, warp, focalYears, tra
about: (e) => { const c = catById.get(e.category), w = places[e.id]; return { kind: c?.name || e.category || '', type: c?.domain || e.domain || '', where: !e.where && w ? [w[0], w[1]] : null }; },
first: () => { const p = (road.gorder || [])[0]; return p ? stepOf(p) : null; },
voiceLoad: () => (told.load != null && told.load < 1 ? { part: told.load, mb: Math.round((told.bytes || 0) / 1e6) || MODEL_MB } : null),
audio: () => { try { const AC = window.AudioContext || window.webkitAudioContext; if (!sound.ctx && AC) sound.ctx = new AC(); if (sound.ctx?.state === 'suspended') sound.ctx.resume(); } catch { sound.ctx = null; } return sound.ctx; },
audio: () => { try { const AC = window.AudioContext || window.webkitAudioContext; if (!sound.ctx && AC) sound.ctx = new AC(); if (sound.ctx && sound.ctx.state !== 'running' && sound.ctx.state !== 'closed') sound.ctx.resume().catch(() => {}); } catch { sound.ctx = null; } return sound.ctx; },
told: () => { const seen = new Set(); return { entries: (road.gorder || []).filter((p) => !seen.has(p.t.id) && seen.add(p.t.id)).map((p) => ({ id: p.t.id, name: p.t.name, when: spanOf(p.t), mark: stepOf(p).mark || '', summary: p.t.summary || '' })) }; },
redraw: () => { if (state.views.length) changed(); }, detailChars: () => boot.detail.chars,
});
Expand Down
22 changes: 22 additions & 0 deletions site/globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ export function createGlobe(host, { open, goTo, seek, credit, esc, calm, pane, c
map.touchZoomRotate.disableRotation();
// The credits the map's licences ask for are folded behind their small button (asked for, Nov 2026: no line of text on the map).
map.on('idle', () => { host.dataset.idle = '1'; }); map.on('dataloading', () => { host.dataset.idle = '0'; });
// A phone can take the map's drawing away while the page is left (reported, Nov 2026: back on the page, the sound
// played and the picture stood frozen). If it does not come back by itself, the map is made again.
let lost = 0;
map.on('webglcontextlost', () => { lost = setTimeout(() => { if (S.map === map && !document.hidden) remake(); }, 1500); });
map.on('webglcontextrestored', () => { clearTimeout(lost); lost = 0; });
map.on('load', () => {
map.addSource('arc', { type: 'geojson', data: { type: 'FeatureCollection', features: [] } });
const kind = (k) => ['==', ['get', 'k'], k];
Expand Down Expand Up @@ -662,6 +667,16 @@ export function createGlobe(host, { open, goTo, seek, credit, esc, calm, pane, c
// A drag turns the globe; it must not also carry the reader through time, which the stage under it does.
for (const ev of ['pointerdown', 'pointermove', 'pointerup']) box.addEventListener(ev, (e) => e.stopPropagation());

function remake() {
const m = S.map; S.map = null; S.asked = false; S.said = null;
try { m.remove(); } catch (e) { /* gone already */ }
needMap(); run();
}
function lostGl() {
const c = S.map && S.map.getCanvas();
const gl = c && (c.getContext('webgl2') || c.getContext('webgl'));
return !!gl && gl.isContextLost();
}
function needMap() {
if (S.bare || S.map || S.asked || !S.steps.some((s) => s.place)) return;
S.asked = true; note.hidden = true;
Expand Down Expand Up @@ -723,6 +738,13 @@ export function createGlobe(host, { open, goTo, seek, credit, esc, calm, pane, c
if (!shelf.hidden) measure();
cams(); place(); run();
},
// Back on the page: a frame asked for while it was away may never come, and the map may have lost its drawing.
wake() {
if (S.gone) return;
if (S.raf > 0) { K.caf(S.raf); S.raf = 0; }
if (lostGl()) remake(); else if (S.map) S.map.triggerRepaint();
this.resize();
},
stage: () => S.stage,
// 'globe' (the map where entries have places) or 'full' (the stars for every entry). Kept in this browser.
mode(v) {
Expand Down
10 changes: 8 additions & 2 deletions site/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ small > .ctag, small .ctag { margin-left: 0; }
#road.short .rc.full .rs, #road.short .rc.full img { display: none; }
@media (max-width: 699px) {
#road-head { right: 14px; top: 104px; gap: 4px; max-width: 50%; }
#road-year { font-size: 34px; }
#road-year { font-size: 21px; }
#road-views { top: 58px; max-width: calc(100% - 28px); gap: 4px 16px; }
.rv b, #road-views[data-n="2"] .rv b { font-size: 18px; }
.rv b, #road-views[data-n="2"] .rv b { font-size: 15px; }
#road-views:not([data-n="1"]):not([data-n="2"]) .rv b { font-size: 14px; }
#road-views.bare .rch { display: none; }
.rch { font-size: 10.5px; line-height: 1.25; }
Expand Down Expand Up @@ -984,3 +984,9 @@ body.exploring #subs, body.creating #subs, body.editing #subs { display: none; }
}
@media (max-width: 699px) { [data-theme="light"] #globe .g-card.bare { background: rgba(255, 255, 255, .25); } }
[data-theme="light"] #globe .g-pane .g-card, [data-theme="light"] #globe[data-card] .g-pane .g-card { text-shadow: 0 0 2px #fff, 0 0 14px rgba(255, 255, 255, .9); }
/* On a phone the card is the same glass as on a wide screen (asked for, Nov 2026): see-through, blurred, with a pale
lit edge, not a dark box ringed in the view's colour. */
@media (max-width: 699px) {
#globe .g-card, #globe .g-card.bare { background: rgba(10, 14, 22, .25); border-color: rgba(200, 215, 255, .16); box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06); border-radius: 6px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
[data-theme="light"] #globe .g-card, [data-theme="light"] #globe .g-card.bare { background: rgba(255, 255, 255, .25); border-color: rgba(255, 255, 255, .6); box-shadow: 0 18px 50px rgba(40, 50, 80, .16), inset 0 1px 0 rgba(255, 255, 255, .7); text-shadow: none; }
}
Loading