diff --git a/public/index.html b/public/index.html
index 72ca4ee..d4f29b9 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1455,9 +1455,25 @@
// ============================================
// SOLAR IMAGE COMPONENT
// ============================================
- const SolarImage = () => {
+ // Combined Solar Panel - toggleable between image and indices
+ const SolarPanel = ({ solarIndices }) => {
+ const [showIndices, setShowIndices] = useState(() => {
+ try {
+ const saved = localStorage.getItem('openhamclock_solarPanelMode');
+ return saved === 'indices';
+ } catch (e) { return false; }
+ });
const [imageType, setImageType] = useState('0193'); // AIA 193 (corona)
+ // Save preference
+ const toggleMode = () => {
+ const newMode = !showIndices;
+ setShowIndices(newMode);
+ try {
+ localStorage.setItem('openhamclock_solarPanelMode', newMode ? 'indices' : 'image');
+ } catch (e) {}
+ };
+
// SDO/AIA image types
const imageTypes = {
'0193': { name: 'AIA 193Å', desc: 'Corona' },
@@ -1468,70 +1484,231 @@
};
// SDO images update every ~15 minutes
- const timestamp = Math.floor(Date.now() / 900000) * 900000; // Round to 15 min
+ const timestamp = Math.floor(Date.now() / 900000) * 900000;
const imageUrl = `https://sdo.gsfc.nasa.gov/assets/img/latest/latest_256_${imageType}.jpg?t=${timestamp}`;
+ // Kp color helper
+ const getKpColor = (value) => {
+ if (value >= 7) return '#ff0000';
+ if (value >= 5) return '#ff6600';
+ if (value >= 4) return '#ffcc00';
+ if (value >= 3) return '#88cc00';
+ return '#00ff88';
+ };
+
+ const getKpLabel = (value) => {
+ if (value >= 7) return 'SEVERE';
+ if (value >= 5) return 'STORM';
+ if (value >= 4) return 'ACTIVE';
+ if (value >= 3) return 'UNSETTLED';
+ return 'QUIET';
+ };
+
return (
+ {/* Header with toggle */}
-
☀ SOLAR
-
+
+ ☀ {showIndices ? 'SOLAR INDICES' : 'SOLAR'}
+
+
+ {!showIndices && (
+
+ )}
+
+
-
-

+ {solarIndices?.data ? (
+
+ {/* SFI Row */}
+
+
+
SFI
+
+ {solarIndices.data.sfi?.current || '--'}
+
+
+
+ {solarIndices.data.sfi?.history?.length > 0 && (
+
+ )}
+
30 day history
+
+
+
+ {/* SSN Row */}
+
+
+
Sunspots
+
+ {solarIndices.data.ssn?.current || '--'}
+
+
+
+ {solarIndices.data.ssn?.history?.length > 0 && (
+
+ )}
+
12 month history
+
+
+
+ {/* Kp Row */}
+
+
+
Kp Index
+
+ {solarIndices.data.kp?.current?.toFixed(1) || '--'}
+
+
+ {solarIndices.data.kp?.current !== null ? getKpLabel(solarIndices.data.kp?.current) : ''}
+
+
+
+ {solarIndices.data.kp?.history?.length > 0 && (
+
+ )}
+
3 day history + forecast
+
+
+
+ ) : (
+
+ Loading solar data...
+
+ )}
+
+ NOAA/SWPC
+
+
+ ) : (
+ /* Solar Image View */
+
+
{
- e.target.style.display = 'none';
- }}
- />
-
-
- SDO/AIA • Live from NASA
-
+ paddingBottom: '100%',
+ background: '#000',
+ borderRadius: '50%',
+ overflow: 'hidden'
+ }}>
+

{
+ e.target.style.display = 'none';
+ }}
+ />
+
+
+ SDO/AIA • Live from NASA
+
+
+ )}
);
};
@@ -2425,198 +2602,6 @@
);
};
- // ============================================
- // SOLAR INDICES PANEL
- // ============================================
- const SolarIndicesPanel = ({ data, loading }) => {
- if (loading || !data) {
- return (
-