feat(hud): Blue Marble default basemap + constant-speed readable news ticker

- initMap preferred chain: BlueMarble_ShadedRelief_Bathymetry first (static,
  gap-free); VIIRS/MODIS satellite remain selectable. No basemap persistence
  exists (osint.mapDefaults stores overlay prefs only), so first-load default
  is the whole change. has_time=false hides time controls via mapLayerChanged.
- News ticker: animation-duration computed from rendered group width for a
  constant 28 px/s regardless of headline count, recomputed on every 3-min
  rebuild; CSS fallback raised 90s -> 240s. Seamless two-copy -50% loop kept;
  market ticker untouched (60s CSS, no inline override).

Verified in real browser vs mock API + live GIBS tiles: fresh load selects
Blue Marble (8/8 tiles), Terra satellite round-trip renders with time controls,
measured ticker speed 28.01 px/s (was ~88), critical-news/blips toggles clean
(1 shared canvas -> 0, no reload), zero console errors.
This commit is contained in:
Sirius DevOps 2026-11-19 23:45:22 -05:00
commit a72ddc30f8

View file

@ -720,7 +720,7 @@
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.tick-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.ticker.news .tick-track { animation-duration: 90s; }
.ticker.news .tick-track { animation-duration: 240s; } /* fallback; JS sets constant px/s */
.tick-wrap:hover .tick-track, .tick-wrap:focus-within .tick-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick-group { display: flex; align-items: center; }
@ -1874,6 +1874,7 @@ function initMarketTicker() {
/* ═══════════════ NEWS FEED + TICKER ═══════════════ */
let newsInterval = null;
const NEWS_REFRESH_MS = 180000; // 3-min ticker/brief poll
const NEWS_TICKER_PX_PER_S = 28; // constant readable scroll speed for the news ticker
let newsTickerBuilt = false;
function newsEsc(s) {
@ -2016,6 +2017,13 @@ function renderNewsTicker(articles, summaries, tickerItems) {
items = `<span class="tick-item standby">No headlines yet — scraper idle</span>`;
}
track.innerHTML = `<span class="tick-group">${items}</span><span class="tick-group">${items}</span>`;
// Constant pixel speed regardless of headline count: the marquee travels
// one group width (track = two identical copies, keyframe goes to -50%).
// Recomputed on every rebuild; market ticker keeps its own CSS duration.
const groupWidth = track.scrollWidth / 2;
track.style.animationDuration = groupWidth > 0
? `${(groupWidth / NEWS_TICKER_PX_PER_S).toFixed(2)}s`
: '';
newsTickerBuilt = true;
}
@ -2539,10 +2547,12 @@ async function initMap() {
const sel = document.getElementById('map-layer');
sel.innerHTML = mapLayers.map(l =>
`<option value="${l.id}">${l.title}</option>`).join('');
// Blue Marble first: static, gap-free basemap. Satellite true-color
// (VIIRS/MODIS) has cloud/coverage gaps — still selectable below.
const preferred =
mapLayers.find(l => l.id === 'VIIRS_SNPP_CorrectedReflectance_TrueColor')
mapLayers.find(l => l.id === 'BlueMarble_ShadedRelief_Bathymetry')
|| mapLayers.find(l => l.id === 'VIIRS_SNPP_CorrectedReflectance_TrueColor')
|| mapLayers.find(l => l.id === 'MODIS_Terra_CorrectedReflectance_TrueColor')
|| mapLayers.find(l => l.id === 'BlueMarble_ShadedRelief_Bathymetry')
|| mapLayers.find(l => !l.has_time)
|| mapLayers[0];
if (preferred) sel.value = preferred.id;