mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Events ▸ News draws the last 24 hours of reports from curated hotspots (Ukraine–Russia, Israel–Gaza–Lebanon, Iran–Hormuz, Yemen–Red Sea, Sudan, Sahel) and developing situations elsewhere, from any server that answers the `/api/news` read routes. - Globe: one marker per merged event, clamped to the ground and culled at the horizon; one beacon per hotspot when zoomed out and a pulsing beacon for a developing situation; hotspot outlines with disputed areas dotted and labelled by who administers and who claims them; picture cards for at most ten major or fast-growing events with two or more sources, never overlapping, switchable off. - Panel: hotspot chips, a severity filter (significant and above by default), categories, minor news off by default, and a scrolling list of event cards with picture, headline, place, sources, age and the sides that reported it. "In view" lists what is near the map below 3,000 km once the camera settles. A card flies the globe to its event and opens it with a link to the publisher. Reduced motion stops the pulse and the flights. - Core serves no news itself: the local server proxies GEV_NEWS_ORIGIN when it is set, and answers 503 unavailable otherwise, so the layer reads "not configured" once instead of retrying. - Share token 9 (enabled-only); voice stays off for this layer.
44 lines
1.6 KiB
JavaScript
44 lines
1.6 KiB
JavaScript
import { msg } from '../i18n/index.js';
|
|
|
|
/** Class of the element each side stack hosts its rail in. */
|
|
export const PANEL_RAIL_HOST_CLASS = 'gev-panel-rail';
|
|
|
|
/** Glyph for a panel without a catalog entry, such as one a host adds. */
|
|
export const PANEL_RAIL_FALLBACK_ICON = 'more_horiz';
|
|
|
|
/**
|
|
* How each side panel appears on its rail. Labels are the panels' own titles.
|
|
* `shownBy` names a class the panel needs to be shown at all (`f` toggles
|
|
* Data Layers' `active`).
|
|
*/
|
|
export const PANEL_RAIL_ITEMS = Object.freeze({
|
|
'data-panel': {
|
|
icon: 'layers',
|
|
label: msg('DATA LAYERS'),
|
|
shownBy: 'active',
|
|
},
|
|
'utilities-panel': { icon: 'handyman', label: msg('UTILITIES') },
|
|
'scene-panel': { icon: 'movie', label: msg('AUTHORING') },
|
|
'pp-toggles': { icon: 'tune', label: msg('DISPLAY') },
|
|
'cctv-panel': { icon: 'videocam', label: msg('CCTV') },
|
|
'weather-panel': { icon: 'partly_cloudy_day', label: msg('WEATHER') },
|
|
'news-panel': { icon: 'public', label: msg('NEWS') },
|
|
'recent-imagery-panel': {
|
|
icon: 'satellite_alt',
|
|
label: msg('RECENT IMAGERY'),
|
|
},
|
|
'street-level-panel': { icon: 'streetview', label: msg('STREET LEVEL') },
|
|
'global-context-panel': { icon: 'radar', label: msg('CONTEXT') },
|
|
});
|
|
|
|
/**
|
|
* Whether a mutation happened inside a panel rail, which no stack layout or
|
|
* panel state depends on.
|
|
* @param {MutationRecord} record Observed mutation.
|
|
*/
|
|
export function isPanelRailMutation(record) {
|
|
const target =
|
|
record.target.nodeType === 1 ? record.target : record.target.parentElement;
|
|
return Boolean(target?.closest?.(`.${PANEL_RAIL_HOST_CLASS}`));
|
|
}
|