diff --git a/web/src/App.svelte b/web/src/App.svelte index 2bd383f..9f0e9c6 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -2,6 +2,7 @@ import { onMount, onDestroy } from 'svelte'; import { wsService, connected, systemStatus } from './lib/websocket.js'; import { api } from './lib/api.js'; + import StatusBanner from './components/StatusBanner.svelte'; import WebSwitch from './components/WebSwitch.svelte'; import PowerGenius from './components/PowerGenius.svelte'; import TunerGenius from './components/TunerGenius.svelte'; @@ -13,6 +14,8 @@ let isConnected = false; let currentTime = new Date(); let callsign = 'F4BPO'; // Default + let latitude = null; + let longitude = null; const unsubscribeStatus = systemStatus.subscribe(value => { status = value; @@ -40,6 +43,10 @@ if (config.callsign) { callsign = config.callsign; } + if (config.location) { + latitude = config.location.latitude; + longitude = config.location.longitude; + } } catch (err) { console.error('Failed to fetch config:', err); } @@ -107,6 +114,16 @@ + + +
@@ -132,12 +149,13 @@ } header { - background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); - padding: 16px 24px; + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); + padding: 8px 24px; display: flex; justify-content: space-between; align-items: center; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); + border-bottom: 1px solid rgba(79, 195, 247, 0.2); flex-wrap: wrap; gap: 16px; } @@ -243,6 +261,7 @@ .date { font-size: 12px; color: rgba(255, 255, 255, 0.7); + padding-top: 0px; } main { @@ -292,4 +311,4 @@ flex-wrap: wrap; } } - + \ No newline at end of file diff --git a/web/src/components/StatusBanner.svelte b/web/src/components/StatusBanner.svelte new file mode 100644 index 0000000..065d082 --- /dev/null +++ b/web/src/components/StatusBanner.svelte @@ -0,0 +1,625 @@ + + +
+ +
+
+ 📻 +
+ + {#if connected && frequency > 0} +
+ + {formatFrequency(frequency)} + + MHz +
+ + {#if currentBand} + + {currentBand} + + {/if} + + {#if mode} + + {mode} + + {/if} + + {#if txEnabled} + + TX + + {/if} + {:else} + FlexRadio non connecté + {/if} +
+ + +
+ + +
+ {#if latitude && longitude} +
+ + + + + + + + + + + + {formatTime(sunrise)} + + + + + + + + + + + + + {formatTime(sunset)} + +
+ + {#if isGrayline} + + ✨ GRAYLINE + + {:else if timeToNextEvent} + + {timeToNextEvent} + + {/if} + {:else} + 📍 Position non configurée + {/if} +
+ + +
+ + +
+ {#if hasWindWarning} +
+ ⚠️ + + Vent: {windSpeed.toFixed(0)} km/h + +
+ {/if} + + {#if hasGustWarning} +
+ 🌪️ + + Rafales: {windGust.toFixed(0)} km/h + +
+ {/if} + + {#if !hasAnyWarning} +
+ + Météo OK +
+ {/if} +
+
+ + \ No newline at end of file