mirror of
https://github.com/smittix/intercept.git
synced 2026-07-07 17:18:11 -07:00
fix: replace remaining hardcoded cyan in map utilities and mode JS files
- map-utils.js: range rings and reticle crosshair SVG use --accent-cyan - drone.js: trail polyline color reads --accent-cyan for non-threat contacts - weather-satellite.js: NOAA APT pass track reads --accent-cyan - space-weather.js: solar wind chart border/bg/axis ticks read --accent-cyan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -231,7 +231,7 @@ const MapUtils = {
|
|||||||
const meters = dist * metersPerUnit;
|
const meters = dist * metersPerUnit;
|
||||||
L.circle(center, {
|
L.circle(center, {
|
||||||
radius: meters,
|
radius: meters,
|
||||||
color: '#4aa3ff',
|
color: getComputedStyle(document.documentElement).getPropertyValue('--accent-cyan').trim() || '#4aa3ff',
|
||||||
fillColor: 'transparent',
|
fillColor: 'transparent',
|
||||||
fillOpacity: 0,
|
fillOpacity: 0,
|
||||||
weight: 1,
|
weight: 1,
|
||||||
@@ -265,11 +265,11 @@ const MapUtils = {
|
|||||||
const icon = L.divIcon({
|
const icon = L.divIcon({
|
||||||
className: 'map-reticle',
|
className: 'map-reticle',
|
||||||
html: `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
html: `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<circle cx="14" cy="14" r="4" stroke="#4aa3ff" stroke-width="1.5"/>
|
<circle cx="14" cy="14" r="4" style="stroke:var(--accent-cyan)" stroke-width="1.5"/>
|
||||||
<line x1="14" y1="2" x2="14" y2="9" stroke="#4aa3ff" stroke-width="1.5"/>
|
<line x1="14" y1="2" x2="14" y2="9" style="stroke:var(--accent-cyan)" stroke-width="1.5"/>
|
||||||
<line x1="14" y1="19" x2="14" y2="26" stroke="#4aa3ff" stroke-width="1.5"/>
|
<line x1="14" y1="19" x2="14" y2="26" style="stroke:var(--accent-cyan)" stroke-width="1.5"/>
|
||||||
<line x1="2" y1="14" x2="9" y2="14" stroke="#4aa3ff" stroke-width="1.5"/>
|
<line x1="2" y1="14" x2="9" y2="14" style="stroke:var(--accent-cyan)" stroke-width="1.5"/>
|
||||||
<line x1="19" y1="14" x2="26" y2="14" stroke="#4aa3ff" stroke-width="1.5"/>
|
<line x1="19" y1="14" x2="26" y2="14" style="stroke:var(--accent-cyan)" stroke-width="1.5"/>
|
||||||
</svg>`,
|
</svg>`,
|
||||||
iconSize: [28, 28],
|
iconSize: [28, 28],
|
||||||
iconAnchor: [14, 14],
|
iconAnchor: [14, 14],
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ var DroneMode = (function () {
|
|||||||
_trails[contact.id].setLatLngs(trailPoints);
|
_trails[contact.id].setLatLngs(trailPoints);
|
||||||
} else if (trailPoints.length > 1) {
|
} else if (trailPoints.length > 1) {
|
||||||
_trails[contact.id] = L.polyline(trailPoints, {
|
_trails[contact.id] = L.polyline(trailPoints, {
|
||||||
color: contact.risk_level === 'high' ? '#ff4444' : '#00ccff',
|
color: contact.risk_level === 'high' ? '#ff4444' : (getComputedStyle(document.documentElement).getPropertyValue('--accent-cyan').trim() || '#00ccff'),
|
||||||
weight: 1.5,
|
weight: 1.5,
|
||||||
opacity: 0.6,
|
opacity: 0.6,
|
||||||
}).addTo(_map);
|
}).addTo(_map);
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ const SpaceWeather = (function () {
|
|||||||
let _xrayChart = null;
|
let _xrayChart = null;
|
||||||
|
|
||||||
// Current image selections
|
// Current image selections
|
||||||
let _solarImageKey = 'sdo_193';
|
let _solarImageKey = 'sdo_193';
|
||||||
let _drapFreq = 'drap_global';
|
let _drapFreq = 'drap_global';
|
||||||
const SOLAR_IMAGE_FALLBACKS = {
|
const SOLAR_IMAGE_FALLBACKS = {
|
||||||
sdo_193: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_0193.jpg',
|
sdo_193: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_0193.jpg',
|
||||||
sdo_304: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_0304.jpg',
|
sdo_304: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_0304.jpg',
|
||||||
sdo_magnetogram: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_HMIBC.jpg',
|
sdo_magnetogram: 'https://sdo.gsfc.nasa.gov/assets/img/latest/latest_512_HMIBC.jpg',
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Stable cache-bust key that rotates every 5 minutes (matches backend max-age). */
|
/** Stable cache-bust key that rotates every 5 minutes (matches backend max-age). */
|
||||||
function _cacheBust() {
|
function _cacheBust() {
|
||||||
@@ -53,35 +53,35 @@ const SpaceWeather = (function () {
|
|||||||
_fetchData();
|
_fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectSolarImage(key) {
|
function selectSolarImage(key) {
|
||||||
_solarImageKey = key;
|
_solarImageKey = key;
|
||||||
_updateSolarImageTabs();
|
_updateSolarImageTabs();
|
||||||
const frame = document.getElementById('swSolarImageFrame');
|
const frame = document.getElementById('swSolarImageFrame');
|
||||||
if (frame) {
|
if (frame) {
|
||||||
frame.innerHTML = '<div class="sw-loading">Loading</div>';
|
frame.innerHTML = '<div class="sw-loading">Loading</div>';
|
||||||
_loadImageWithFallback(
|
_loadImageWithFallback(
|
||||||
frame,
|
frame,
|
||||||
['/space-weather/image/' + key + '?' + _cacheBust(), _directImageUrlForKey(key)],
|
['/space-weather/image/' + key + '?' + _cacheBust(), _directImageUrlForKey(key)],
|
||||||
key,
|
key,
|
||||||
'<div class="sw-empty">NASA SDO image is temporarily unavailable</div>'
|
'<div class="sw-empty">NASA SDO image is temporarily unavailable</div>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectDrapFreq(key) {
|
function selectDrapFreq(key) {
|
||||||
_drapFreq = key;
|
_drapFreq = key;
|
||||||
_updateDrapTabs();
|
_updateDrapTabs();
|
||||||
const frame = document.getElementById('swDrapImageFrame');
|
const frame = document.getElementById('swDrapImageFrame');
|
||||||
if (frame) {
|
if (frame) {
|
||||||
frame.innerHTML = '<div class="sw-loading">Loading</div>';
|
frame.innerHTML = '<div class="sw-loading">Loading</div>';
|
||||||
_loadImageWithFallback(
|
_loadImageWithFallback(
|
||||||
frame,
|
frame,
|
||||||
['/space-weather/image/' + key + '?' + _cacheBust()],
|
['/space-weather/image/' + key + '?' + _cacheBust()],
|
||||||
key,
|
key,
|
||||||
'<div class="sw-empty">Failed to load image</div>'
|
'<div class="sw-empty">Failed to load image</div>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAutoRefresh() {
|
function toggleAutoRefresh() {
|
||||||
const cb = document.getElementById('swAutoRefresh');
|
const cb = document.getElementById('swAutoRefresh');
|
||||||
@@ -101,41 +101,41 @@ const SpaceWeather = (function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _stopAutoRefresh() {
|
function _stopAutoRefresh() {
|
||||||
if (_pollTimer) { clearInterval(_pollTimer); _pollTimer = null; }
|
if (_pollTimer) { clearInterval(_pollTimer); _pollTimer = null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function _directImageUrlForKey(key) {
|
function _directImageUrlForKey(key) {
|
||||||
const base = SOLAR_IMAGE_FALLBACKS[key];
|
const base = SOLAR_IMAGE_FALLBACKS[key];
|
||||||
if (!base) return null;
|
if (!base) return null;
|
||||||
return base + '?' + _cacheBust();
|
return base + '?' + _cacheBust();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _loadImageWithFallback(frame, urls, alt, failureHtml) {
|
function _loadImageWithFallback(frame, urls, alt, failureHtml) {
|
||||||
const candidates = (urls || []).filter(Boolean);
|
const candidates = (urls || []).filter(Boolean);
|
||||||
if (!frame || candidates.length === 0) {
|
if (!frame || candidates.length === 0) {
|
||||||
if (frame) frame.innerHTML = failureHtml;
|
if (frame) frame.innerHTML = failureHtml;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let index = 0;
|
let index = 0;
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
img.alt = alt;
|
img.alt = alt;
|
||||||
img.referrerPolicy = 'no-referrer';
|
img.referrerPolicy = 'no-referrer';
|
||||||
img.onload = function () {
|
img.onload = function () {
|
||||||
frame.innerHTML = '';
|
frame.innerHTML = '';
|
||||||
frame.appendChild(img);
|
frame.appendChild(img);
|
||||||
};
|
};
|
||||||
img.onerror = function () {
|
img.onerror = function () {
|
||||||
index += 1;
|
index += 1;
|
||||||
if (index < candidates.length) {
|
if (index < candidates.length) {
|
||||||
img.src = candidates[index];
|
img.src = candidates[index];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
frame.innerHTML = failureHtml;
|
frame.innerHTML = failureHtml;
|
||||||
};
|
};
|
||||||
img.src = candidates[index];
|
img.src = candidates[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
function _fetchData() {
|
function _fetchData() {
|
||||||
fetch('/space-weather/data')
|
fetch('/space-weather/data')
|
||||||
@@ -387,6 +387,7 @@ const SpaceWeather = (function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_windChart) { _windChart.destroy(); _windChart = null; }
|
if (_windChart) { _windChart.destroy(); _windChart = null; }
|
||||||
|
const _accentCyan = getComputedStyle(document.documentElement).getPropertyValue('--accent-cyan').trim() || '#00ccff';
|
||||||
_windChart = new Chart(canvas, {
|
_windChart = new Chart(canvas, {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
@@ -395,8 +396,8 @@ const SpaceWeather = (function () {
|
|||||||
{
|
{
|
||||||
label: 'Speed (km/s)',
|
label: 'Speed (km/s)',
|
||||||
data: speedData,
|
data: speedData,
|
||||||
borderColor: '#00ccff',
|
borderColor: _accentCyan,
|
||||||
backgroundColor: '#00ccff22',
|
backgroundColor: _accentCyan + '22',
|
||||||
borderWidth: 1.5,
|
borderWidth: 1.5,
|
||||||
pointRadius: 0,
|
pointRadius: 0,
|
||||||
fill: true,
|
fill: true,
|
||||||
@@ -423,7 +424,7 @@ const SpaceWeather = (function () {
|
|||||||
},
|
},
|
||||||
scales: {
|
scales: {
|
||||||
x: { display: true, ticks: { color: '#555', font: { size: 9 }, maxTicksLimit: 8 }, grid: { color: '#ffffff08' } },
|
x: { display: true, ticks: { color: '#555', font: { size: 9 }, maxTicksLimit: 8 }, grid: { color: '#ffffff08' } },
|
||||||
y: { display: true, position: 'left', ticks: { color: '#00ccff', font: { size: 9 } }, grid: { color: '#ffffff08' }, title: { display: false } },
|
y: { display: true, position: 'left', ticks: { color: _accentCyan, font: { size: 9 } }, grid: { color: '#ffffff08' }, title: { display: false } },
|
||||||
y1: { display: true, position: 'right', ticks: { color: '#ff8800', font: { size: 9 } }, grid: { drawOnChartArea: false } }
|
y1: { display: true, position: 'right', ticks: { color: '#ff8800', font: { size: 9 } }, grid: { drawOnChartArea: false } }
|
||||||
},
|
},
|
||||||
interaction: { mode: 'index', intersect: false }
|
interaction: { mode: 'index', intersect: false }
|
||||||
|
|||||||
@@ -982,7 +982,7 @@ const WeatherSat = (function() {
|
|||||||
const trajectory = pass?.trajectory;
|
const trajectory = pass?.trajectory;
|
||||||
if (!trajectory || trajectory.length === 0) return;
|
if (!trajectory || trajectory.length === 0) return;
|
||||||
|
|
||||||
const color = pass.mode === 'LRPT' ? '#00ff88' : '#00d4ff';
|
const color = pass.mode === 'LRPT' ? '#00ff88' : (getComputedStyle(document.documentElement).getPropertyValue('--accent-cyan').trim() || '#00d4ff');
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.strokeStyle = color;
|
ctx.strokeStyle = color;
|
||||||
|
|||||||
Reference in New Issue
Block a user