rot finished
This commit is contained in:
310
web/src/components/AntennaGenius.svelte
Normal file
310
web/src/components/AntennaGenius.svelte
Normal file
@@ -0,0 +1,310 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: connected = status?.connected || false;
|
||||
$: portA = status?.port_a || {};
|
||||
$: portB = status?.port_b || {};
|
||||
$: antennas = status?.antennas || [];
|
||||
|
||||
// Band names
|
||||
const bandNames = {
|
||||
0: '160M', 1: '80M', 2: '60M', 3: '40M', 4: '30M',
|
||||
5: '20M', 6: '17M', 7: '15M', 8: '12M', 9: '10M',
|
||||
10: '6M', 11: '4M', 12: '2M', 13: '1.25M', 14: '70CM', 15: 'GEN'
|
||||
};
|
||||
|
||||
$: bandAName = bandNames[portA.band] || 'None';
|
||||
$: bandBName = bandNames[portB.band] || 'None';
|
||||
|
||||
async function selectAntenna(port, antennaNum) {
|
||||
try {
|
||||
await api.antenna.selectAntenna(port, antennaNum, antennaNum);
|
||||
} catch (err) {
|
||||
console.error('Failed to select antenna:', err);
|
||||
alert('Failed to select antenna');
|
||||
}
|
||||
}
|
||||
|
||||
async function reboot() {
|
||||
if (!confirm('Are you sure you want to reboot the Antenna Genius?')) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await api.antenna.reboot();
|
||||
} catch (err) {
|
||||
console.error('Failed to reboot:', err);
|
||||
alert('Failed to reboot');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Antenna Genius</h2>
|
||||
<span class="status-dot" class:disconnected={!connected}></span>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<!-- Radio Sources -->
|
||||
<div class="sources">
|
||||
<div class="source-item">
|
||||
<div class="source-label">{portA.source || 'FLEX'}</div>
|
||||
</div>
|
||||
<div class="source-item">
|
||||
<div class="source-label">{portB.source || 'FLEX'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bands -->
|
||||
<div class="bands">
|
||||
<div class="band-item">
|
||||
<div class="band-value">{bandAName}</div>
|
||||
</div>
|
||||
<div class="band-item">
|
||||
<div class="band-value">{bandBName}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Antennas -->
|
||||
<div class="antennas">
|
||||
{#each antennas as antenna}
|
||||
{@const isPortATx = portA.tx && portA.tx_ant === antenna.number}
|
||||
{@const isPortBTx = portB.tx && portB.tx_ant === antenna.number}
|
||||
{@const isPortARx = !portA.tx && (portA.rx_ant === antenna.number || portA.tx_ant === antenna.number)}
|
||||
{@const isPortBRx = !portB.tx && (portB.rx_ant === antenna.number || portB.tx_ant === antenna.number)}
|
||||
{@const isTx = isPortATx || isPortBTx}
|
||||
{@const isActive = isPortARx || isPortBRx}
|
||||
|
||||
<div
|
||||
class="antenna-card"
|
||||
class:tx={isTx}
|
||||
class:active-a={isPortARx}
|
||||
class:active-b={isPortBRx}
|
||||
>
|
||||
<div class="antenna-name">{antenna.name}</div>
|
||||
<div class="antenna-ports">
|
||||
<button
|
||||
class="port-btn"
|
||||
class:active={portA.tx_ant === antenna.number || portA.rx_ant === antenna.number}
|
||||
on:click={() => selectAntenna(1, antenna.number)}
|
||||
>
|
||||
A
|
||||
</button>
|
||||
<button
|
||||
class="port-btn"
|
||||
class:active={portB.tx_ant === antenna.number || portB.rx_ant === antenna.number}
|
||||
on:click={() => selectAntenna(2, antenna.number)}
|
||||
>
|
||||
B
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<!-- Reboot Button -->
|
||||
<button class="reboot-btn" on:click={reboot}>
|
||||
<span class="reboot-icon">🔄</span>
|
||||
REBOOT
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-bottom: 1px solid #2d3748;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
margin: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
box-shadow: 0 0 8px #4caf50;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #f44336;
|
||||
box-shadow: 0 0 8px #f44336;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Sources */
|
||||
.sources {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.source-item {
|
||||
padding: 8px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.source-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Bands */
|
||||
.bands {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.band-item {
|
||||
padding: 10px;
|
||||
background: rgba(79, 195, 247, 0.1);
|
||||
border: 1px solid rgba(79, 195, 247, 0.3);
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.band-value {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
}
|
||||
|
||||
/* Antennas */
|
||||
.antennas {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.antenna-card {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
background: var(--bg-tertiary);
|
||||
border: 2px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.antenna-card.tx {
|
||||
background: rgba(244, 67, 54, 0.2);
|
||||
border-color: #f44336;
|
||||
box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
|
||||
}
|
||||
|
||||
.antenna-card.active-a {
|
||||
background: rgba(76, 175, 80, 0.2);
|
||||
border-color: #4caf50;
|
||||
box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
|
||||
}
|
||||
|
||||
.antenna-card.active-b {
|
||||
background: rgba(33, 150, 243, 0.2);
|
||||
border-color: #2196f3;
|
||||
box-shadow: 0 0 20px rgba(33, 150, 243, 0.3);
|
||||
}
|
||||
|
||||
.antenna-name {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.antenna-ports {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.port-btn {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--border-color);
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-secondary);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.port-btn:hover {
|
||||
border-color: var(--accent-cyan);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.port-btn.active {
|
||||
background: var(--accent-cyan);
|
||||
border-color: var(--accent-cyan);
|
||||
color: #000;
|
||||
box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
/* Reboot Button */
|
||||
.reboot-btn {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: linear-gradient(135deg, #ff9800, #f57c00);
|
||||
color: white;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.reboot-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
|
||||
}
|
||||
|
||||
.reboot-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.reboot-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
492
web/src/components/PowerGenius.svelte
Normal file
492
web/src/components/PowerGenius.svelte
Normal file
@@ -0,0 +1,492 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: powerForward = status?.power_forward || 0;
|
||||
$: powerReflected = status?.power_reflected || 0;
|
||||
$: swr = status?.swr || 1.0;
|
||||
$: voltage = status?.voltage || 0;
|
||||
$: vdd = status?.vdd || 0;
|
||||
$: current = status?.current || 0;
|
||||
$: peakCurrent = status?.peak_current || 0;
|
||||
$: temperature = status?.temperature || 0;
|
||||
$: harmonicLoadTemp = status?.harmonic_load_temp || 0;
|
||||
$: fanMode = status?.fan_mode || 'CONTEST';
|
||||
$: state = status?.state || 'IDLE';
|
||||
$: bandA = status?.band_a || '0';
|
||||
$: bandB = status?.band_b || '0';
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
$: displayState = state.replace('TRANSMIT_A', 'TRANSMIT').replace('TRANSMIT_B', 'TRANSMIT');
|
||||
|
||||
// Color functions
|
||||
$: tempColor = temperature < 40 ? '#4caf50' : temperature < 60 ? '#ffc107' : temperature < 75 ? '#ff9800' : '#f44336';
|
||||
$: swrColor = swr < 1.5 ? '#4caf50' : swr < 2.0 ? '#ffc107' : swr < 3.0 ? '#ff9800' : '#f44336';
|
||||
$: powerPercent = Math.min((powerForward / 2000) * 100, 100);
|
||||
|
||||
async function setFanMode(mode) {
|
||||
try {
|
||||
await api.power.setFanMode(mode);
|
||||
} catch (err) {
|
||||
console.error('Failed to set fan mode:', err);
|
||||
alert('Failed to set fan mode');
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleOperate() {
|
||||
try {
|
||||
const operateValue = state === 'IDLE' ? 0 : 1;
|
||||
await api.power.setOperate(operateValue);
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle operate:', err);
|
||||
alert('Failed to toggle operate mode');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Power Genius XL</h2>
|
||||
<div class="header-right">
|
||||
<button
|
||||
class="state-badge"
|
||||
class:idle={state === 'IDLE'}
|
||||
class:transmit={state.includes('TRANSMIT')}
|
||||
on:click={toggleOperate}
|
||||
>
|
||||
{displayState}
|
||||
</button>
|
||||
<span class="status-dot" class:disconnected={!connected}></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<!-- Power Display - Big and Bold -->
|
||||
<div class="power-display">
|
||||
<div class="power-main">
|
||||
<div class="power-value">{powerForward.toFixed(0)}<span class="unit">W</span></div>
|
||||
<div class="power-label">Forward Power</div>
|
||||
</div>
|
||||
<div class="power-bar">
|
||||
<div class="power-bar-fill" style="width: {powerPercent}%">
|
||||
<div class="power-bar-glow"></div>
|
||||
</div>
|
||||
<div class="power-scale">
|
||||
<span>0</span>
|
||||
<span>1000</span>
|
||||
<span>2000</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SWR Circle Indicator -->
|
||||
<div class="swr-container">
|
||||
<div class="swr-circle" style="--swr-color: {swrColor}">
|
||||
<div class="swr-value">{swr.toFixed(2)}</div>
|
||||
<div class="swr-label">SWR</div>
|
||||
</div>
|
||||
<div class="swr-status">
|
||||
{#if swr < 1.5}
|
||||
<span class="status-text good">Excellent</span>
|
||||
{:else if swr < 2.0}
|
||||
<span class="status-text ok">Good</span>
|
||||
{:else if swr < 3.0}
|
||||
<span class="status-text warning">Caution</span>
|
||||
{:else}
|
||||
<span class="status-text danger">High!</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Temperature Gauges -->
|
||||
<div class="temp-group">
|
||||
<div class="temp-item">
|
||||
<div class="temp-value" style="color: {tempColor}">{temperature.toFixed(0)}°</div>
|
||||
<div class="temp-label">PA Temp</div>
|
||||
<div class="temp-mini-bar">
|
||||
<div class="temp-mini-fill" style="width: {(temperature / 80) * 100}%; background: {tempColor}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="temp-item">
|
||||
<div class="temp-value" style="color: {tempColor}">{harmonicLoadTemp.toFixed(0)}°</div>
|
||||
<div class="temp-label">HL Temp</div>
|
||||
<div class="temp-mini-bar">
|
||||
<div class="temp-mini-fill" style="width: {(harmonicLoadTemp / 80) * 100}%; background: {tempColor}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Electrical Parameters -->
|
||||
<div class="params-grid">
|
||||
<div class="param-box">
|
||||
<div class="param-label">VAC</div>
|
||||
<div class="param-value">{voltage.toFixed(0)}</div>
|
||||
</div>
|
||||
<div class="param-box">
|
||||
<div class="param-label">VDD</div>
|
||||
<div class="param-value">{vdd.toFixed(1)}</div>
|
||||
</div>
|
||||
<div class="param-box">
|
||||
<div class="param-label">ID Peak</div>
|
||||
<div class="param-value">{peakCurrent.toFixed(1)}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Band Display -->
|
||||
<div class="band-display">
|
||||
<div class="band-item">
|
||||
<span class="band-label">Band A</span>
|
||||
<span class="band-value">{bandA}</span>
|
||||
</div>
|
||||
<div class="band-item">
|
||||
<span class="band-label">Band B</span>
|
||||
<span class="band-value">{bandB}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Fan Control -->
|
||||
<div class="fan-control">
|
||||
<label class="control-label">Fan Mode</label>
|
||||
<select value={fanMode} on:change={(e) => setFanMode(e.target.value)}>
|
||||
<option value="STANDARD">Standard</option>
|
||||
<option value="CONTEST">Contest</option>
|
||||
<option value="BROADCAST">Broadcast</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-bottom: 1px solid #2d3748;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
margin: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.state-badge {
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.state-badge.idle {
|
||||
background: rgba(76, 175, 80, 0.2);
|
||||
color: #4caf50;
|
||||
}
|
||||
|
||||
.state-badge.transmit {
|
||||
background: rgba(255, 152, 0, 0.2);
|
||||
color: #ff9800;
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
box-shadow: 0 0 8px #4caf50;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #f44336;
|
||||
box-shadow: 0 0 8px #f44336;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* Power Display */
|
||||
.power-display {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.power-main {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.power-value {
|
||||
font-size: 48px;
|
||||
font-weight: 200;
|
||||
color: var(--accent-cyan);
|
||||
line-height: 1;
|
||||
text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
.power-value .unit {
|
||||
font-size: 24px;
|
||||
color: var(--text-secondary);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.power-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.power-bar {
|
||||
position: relative;
|
||||
height: 8px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.power-bar-fill {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #4caf50, #ffc107, #ff9800, #f44336);
|
||||
border-radius: 4px;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.power-bar-glow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 20px;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
|
||||
animation: shimmer 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { transform: translateX(-100%); }
|
||||
100% { transform: translateX(100%); }
|
||||
}
|
||||
|
||||
.power-scale {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* SWR Circle */
|
||||
.swr-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.swr-circle {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle, rgba(79, 195, 247, 0.1), transparent);
|
||||
border: 3px solid var(--swr-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 20px var(--swr-color);
|
||||
}
|
||||
|
||||
.swr-value {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
color: var(--swr-color);
|
||||
}
|
||||
|
||||
.swr-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.swr-status {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.status-text.good { color: #4caf50; }
|
||||
.status-text.ok { color: #ffc107; }
|
||||
.status-text.warning { color: #ff9800; }
|
||||
.status-text.danger { color: #f44336; }
|
||||
|
||||
/* Temperature */
|
||||
.temp-group {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.temp-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 12px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.temp-value {
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.temp-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.temp-mini-bar {
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.temp-mini-fill {
|
||||
height: 100%;
|
||||
border-radius: 2px;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
/* Parameters Grid */
|
||||
.params-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.param-box {
|
||||
padding: 8px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.param-label {
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.param-value {
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
color: var(--text-primary);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* Band Display */
|
||||
.band-display {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
padding: 8px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.band-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.band-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.band-value {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
}
|
||||
|
||||
/* Fan Control */
|
||||
.fan-control {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.control-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
select {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
padding: 8px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
select:hover {
|
||||
border-color: var(--accent-cyan);
|
||||
}
|
||||
|
||||
select:focus {
|
||||
border-color: var(--accent-cyan);
|
||||
box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
|
||||
}
|
||||
</style>
|
||||
427
web/src/components/RotatorGenius.svelte
Normal file
427
web/src/components/RotatorGenius.svelte
Normal file
@@ -0,0 +1,427 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: heading = status?.heading || 0;
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
let targetHeading = 0;
|
||||
|
||||
async function goToHeading() {
|
||||
if (targetHeading < 0 || targetHeading > 359) {
|
||||
alert('Heading must be between 0 and 359');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// Subtract 10 degrees to compensate for rotator momentum
|
||||
const adjustedHeading = (targetHeading - 10 + 360) % 360;
|
||||
await api.rotator.setHeading(adjustedHeading);
|
||||
} catch (err) {
|
||||
console.error('Failed to set heading:', err);
|
||||
alert('Failed to rotate');
|
||||
}
|
||||
}
|
||||
|
||||
async function rotateCW() {
|
||||
try {
|
||||
await api.rotator.rotateCW();
|
||||
} catch (err) {
|
||||
console.error('Failed to rotate CW:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function rotateCCW() {
|
||||
try {
|
||||
await api.rotator.rotateCCW();
|
||||
} catch (err) {
|
||||
console.error('Failed to rotate CCW:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function stop() {
|
||||
try {
|
||||
await api.rotator.stop();
|
||||
} catch (err) {
|
||||
console.error('Failed to stop:', err);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Rotator Genius</h2>
|
||||
<span class="status-dot" class:disconnected={!connected}></span>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<!-- Current Heading Display -->
|
||||
<div class="heading-display">
|
||||
<div class="heading-label">CURRENT HEADING</div>
|
||||
<div class="heading-value">{heading}°</div>
|
||||
</div>
|
||||
|
||||
<!-- Map with Beam -->
|
||||
<div class="map-container">
|
||||
<svg viewBox="0 0 500 500" class="map-svg">
|
||||
<defs>
|
||||
<!-- Gradient for beam -->
|
||||
<radialGradient id="beamGradient">
|
||||
<stop offset="0%" style="stop-color:rgba(79, 195, 247, 0.7);stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:rgba(79, 195, 247, 0);stop-opacity:0" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
|
||||
<!-- Ocean background -->
|
||||
<circle cx="250" cy="250" r="240" fill="rgba(30, 64, 175, 0.2)" stroke="rgba(79, 195, 247, 0.4)" stroke-width="3"/>
|
||||
|
||||
<!-- Simplified world map (Azimuthal centered on France ~46°N 6°E) -->
|
||||
<g transform="translate(250, 250)" opacity="0.5">
|
||||
|
||||
<!-- Europe (enlarged and centered) -->
|
||||
<!-- France -->
|
||||
<path d="M -20,-15 L -15,-25 L -5,-28 L 5,-25 L 10,-18 L 8,-8 L 0,-5 L -10,-8 L -18,-12 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Spain/Portugal -->
|
||||
<path d="M -30,-8 L -22,-12 L -18,-8 L -20,0 L -25,5 L -32,3 L -35,-2 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Italy -->
|
||||
<path d="M 5,-10 L 10,-12 L 15,-8 L 18,5 L 15,15 L 10,12 L 8,0 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Germany/Central Europe -->
|
||||
<path d="M -5,-28 L 5,-32 L 15,-30 L 20,-22 L 15,-18 L 5,-20 L 0,-25 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- UK/Ireland -->
|
||||
<path d="M -45,-25 L -40,-32 L -32,-35 L -28,-28 L -32,-20 L -40,-22 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Scandinavia -->
|
||||
<path d="M 0,-40 L 10,-50 L 20,-48 L 25,-38 L 20,-32 L 10,-35 L 5,-38 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Eastern Europe/Russia West -->
|
||||
<path d="M 20,-35 L 35,-40 L 50,-35 L 55,-20 L 50,-10 L 35,-8 L 25,-15 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- North Africa -->
|
||||
<path d="M -35,10 L -20,8 L 0,12 L 15,18 L 10,35 L -5,40 L -25,35 L -35,25 Z"
|
||||
fill="#FFA726" stroke="#FFB74D" stroke-width="1.5"/>
|
||||
|
||||
<!-- Sub-Saharan Africa -->
|
||||
<path d="M -20,42 L 0,45 L 15,50 L 20,70 L 10,95 L -10,100 L -30,90 L -35,70 L -30,50 Z"
|
||||
fill="#FF9800" stroke="#FFB74D" stroke-width="1.5"/>
|
||||
|
||||
<!-- Middle East -->
|
||||
<path d="M 25,0 L 40,5 L 55,10 L 60,25 L 55,38 L 42,42 L 30,35 L 22,20 Z"
|
||||
fill="#FFEB3B" stroke="#FFF176" stroke-width="1.5"/>
|
||||
|
||||
<!-- Russia East/Central Asia -->
|
||||
<path d="M 60,-30 L 90,-35 L 120,-25 L 135,-10 L 140,15 L 130,30 L 105,35 L 80,28 L 65,10 L 62,-10 Z"
|
||||
fill="#AB47BC" stroke="#BA68C8" stroke-width="1.5"/>
|
||||
|
||||
<!-- India/South Asia -->
|
||||
<path d="M 70,40 L 85,38 L 95,45 L 98,60 L 92,75 L 78,80 L 68,72 L 65,55 Z"
|
||||
fill="#EC407A" stroke="#F06292" stroke-width="1.5"/>
|
||||
|
||||
<!-- China/East Asia -->
|
||||
<path d="M 110,0 L 135,5 L 150,18 L 155,35 L 145,52 L 125,58 L 105,50 L 95,32 L 100,15 Z"
|
||||
fill="#7E57C2" stroke="#9575CD" stroke-width="1.5"/>
|
||||
|
||||
<!-- Japan -->
|
||||
<path d="M 165,25 L 172,22 L 178,28 L 175,40 L 168,45 L 162,42 L 160,32 Z"
|
||||
fill="#E91E63" stroke="#F06292" stroke-width="1.5"/>
|
||||
|
||||
<!-- North America -->
|
||||
<path d="M -140,-40 L -110,-50 L -80,-48 L -60,-35 L -55,-15 L -65,5 L -85,15 L -110,12 L -135,-5 L -145,-25 Z"
|
||||
fill="#42A5F5" stroke="#64B5F6" stroke-width="1.5"/>
|
||||
|
||||
<!-- Central America -->
|
||||
<path d="M -75,20 L -65,18 L -55,25 L -58,35 L -68,38 L -78,32 Z"
|
||||
fill="#29B6F6" stroke="#4FC3F7" stroke-width="1.5"/>
|
||||
|
||||
<!-- South America -->
|
||||
<path d="M -70,45 L -60,42 L -48,50 L -45,70 L -50,100 L -60,120 L -75,125 L -88,115 L -92,90 L -85,65 L -78,52 Z"
|
||||
fill="#26C6DA" stroke="#4DD0E1" stroke-width="1.5"/>
|
||||
|
||||
<!-- Australia -->
|
||||
<path d="M 130,95 L 155,92 L 175,100 L 180,120 L 170,135 L 145,138 L 125,128 L 122,110 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
</g>
|
||||
|
||||
<!-- Distance circles -->
|
||||
<circle cx="250" cy="250" r="180" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
<circle cx="250" cy="250" r="120" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
<circle cx="250" cy="250" r="60" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
|
||||
<!-- Rotated group for beam -->
|
||||
<g transform="translate(250, 250)">
|
||||
<!-- Beam (rotates with heading) -->
|
||||
<g transform="rotate({heading})">
|
||||
<!-- Beam sector (±15° = 30° total beamwidth) -->
|
||||
<path d="M 0,0 L {-Math.sin(15 * Math.PI/180) * 220},{-Math.cos(15 * Math.PI/180) * 220}
|
||||
A 220,220 0 0,1 {Math.sin(15 * Math.PI/180) * 220},{-Math.cos(15 * Math.PI/180) * 220} Z"
|
||||
fill="url(#beamGradient)"
|
||||
opacity="0.85"/>
|
||||
|
||||
<!-- Beam outline -->
|
||||
<line x1="0" y1="0" x2={-Math.sin(15 * Math.PI/180) * 220} y2={-Math.cos(15 * Math.PI/180) * 220}
|
||||
stroke="#4fc3f7" stroke-width="3" opacity="0.9"/>
|
||||
<line x1="0" y1="0" x2={Math.sin(15 * Math.PI/180) * 220} y2={-Math.cos(15 * Math.PI/180) * 220}
|
||||
stroke="#4fc3f7" stroke-width="3" opacity="0.9"/>
|
||||
|
||||
<!-- Direction arrow -->
|
||||
<g transform="translate(0, -190)">
|
||||
<polygon points="0,-30 -12,8 0,0 12,8"
|
||||
fill="#4fc3f7"
|
||||
stroke="#0288d1"
|
||||
stroke-width="3"
|
||||
style="filter: drop-shadow(0 0 15px rgba(79, 195, 247, 1))"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Center dot (your QTH - JN36dg) -->
|
||||
<circle cx="0" cy="0" r="6" fill="#f44336" stroke="#fff" stroke-width="3">
|
||||
<animate attributeName="r" values="6;9;6" dur="2s" repeatCount="indefinite"/>
|
||||
</circle>
|
||||
<circle cx="0" cy="0" r="12" fill="none" stroke="#f44336" stroke-width="2" opacity="0.5">
|
||||
<animate attributeName="r" values="12;20;12" dur="2s" repeatCount="indefinite"/>
|
||||
<animate attributeName="opacity" values="0.5;0;0.5" dur="2s" repeatCount="indefinite"/>
|
||||
</circle>
|
||||
</g>
|
||||
|
||||
<!-- Cardinal points -->
|
||||
<text x="250" y="30" text-anchor="middle" class="cardinal">N</text>
|
||||
<text x="470" y="255" text-anchor="middle" class="cardinal">E</text>
|
||||
<text x="250" y="480" text-anchor="middle" class="cardinal">S</text>
|
||||
<text x="30" y="255" text-anchor="middle" class="cardinal">W</text>
|
||||
|
||||
<!-- Degree markers every 30° -->
|
||||
{#each [30, 60, 120, 150, 210, 240, 300, 330] as angle}
|
||||
{@const x = 250 + 215 * Math.sin(angle * Math.PI / 180)}
|
||||
{@const y = 250 - 215 * Math.cos(angle * Math.PI / 180)}
|
||||
<text x={x} y={y} text-anchor="middle" dominant-baseline="middle" class="degree-label">{angle}°</text>
|
||||
{/each}
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- Go To Heading -->
|
||||
<div class="goto-container">
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
max="359"
|
||||
bind:value={targetHeading}
|
||||
placeholder="Enter heading"
|
||||
class="heading-input"
|
||||
/>
|
||||
<button class="go-btn" on:click={goToHeading}>GO</button>
|
||||
</div>
|
||||
|
||||
<!-- Control Buttons -->
|
||||
<div class="controls">
|
||||
<button class="control-btn ccw" on:click={rotateCCW}>
|
||||
<span class="arrow">↺</span>
|
||||
CCW
|
||||
</button>
|
||||
<button class="control-btn stop" on:click={stop}>
|
||||
STOP
|
||||
</button>
|
||||
<button class="control-btn cw" on:click={rotateCW}>
|
||||
<span class="arrow">↻</span>
|
||||
CW
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-bottom: 1px solid #2d3748;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
margin: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
box-shadow: 0 0 8px #4caf50;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #f44336;
|
||||
box-shadow: 0 0 8px #f44336;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* Heading Display */
|
||||
.heading-display {
|
||||
text-align: center;
|
||||
padding: 12px;
|
||||
background: rgba(79, 195, 247, 0.1);
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(79, 195, 247, 0.3);
|
||||
}
|
||||
|
||||
.heading-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.heading-value {
|
||||
font-size: 42px;
|
||||
font-weight: 200;
|
||||
color: var(--accent-cyan);
|
||||
text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
/* Map */
|
||||
.map-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
background: rgba(10, 22, 40, 0.6);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.map-svg {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.cardinal {
|
||||
fill: var(--accent-cyan);
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
|
||||
}
|
||||
|
||||
.degree-label {
|
||||
fill: rgba(79, 195, 247, 0.7);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Go To Heading */
|
||||
.goto-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.heading-input {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
padding: 10px 12px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.heading-input:focus {
|
||||
border-color: var(--accent-cyan);
|
||||
box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
|
||||
}
|
||||
|
||||
.go-btn {
|
||||
padding: 10px 24px;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: linear-gradient(135deg, var(--accent-cyan), #0288d1);
|
||||
color: #000;
|
||||
transition: all 0.2s;
|
||||
box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
|
||||
}
|
||||
|
||||
.go-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
/* Controls */
|
||||
.controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.control-btn {
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--border-color);
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.control-btn:hover {
|
||||
border-color: var(--accent-cyan);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.control-btn.stop {
|
||||
background: linear-gradient(135deg, #f44336, #d32f2f);
|
||||
border-color: #f44336;
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
|
||||
}
|
||||
|
||||
.control-btn.stop:hover {
|
||||
box-shadow: 0 6px 16px rgba(244, 67, 54, 0.5);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
477
web/src/components/TunerGenius.svelte
Normal file
477
web/src/components/TunerGenius.svelte
Normal file
@@ -0,0 +1,477 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: powerForward = status?.power_forward || 0;
|
||||
$: swr = status?.swr || 1.0;
|
||||
$: tuningStatus = status?.tuning_status || 'READY';
|
||||
$: frequencyA = status?.frequency_a || 0;
|
||||
$: frequencyB = status?.frequency_b || 0;
|
||||
$: bypass = status?.bypass || false;
|
||||
$: state = status?.state || 0;
|
||||
$: relayC1 = status?.c1 || 0;
|
||||
$: relayL = status?.l || 0;
|
||||
$: relayC2 = status?.c2 || 0;
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
// Color functions
|
||||
$: swrColor = swr < 1.5 ? '#4caf50' : swr < 2.0 ? '#ffc107' : swr < 3.0 ? '#ff9800' : '#f44336';
|
||||
$: powerPercent = Math.min((powerForward / 2000) * 100, 100);
|
||||
|
||||
async function autoTune() {
|
||||
try {
|
||||
await api.tuner.autoTune();
|
||||
} catch (err) {
|
||||
console.error('Failed to tune:', err);
|
||||
alert('Failed to start tuning');
|
||||
}
|
||||
}
|
||||
|
||||
async function setBypass(value) {
|
||||
try {
|
||||
await api.tuner.setBypass(value);
|
||||
} catch (err) {
|
||||
console.error('Failed to set bypass:', err);
|
||||
alert('Failed to set bypass');
|
||||
}
|
||||
}
|
||||
|
||||
async function setOperate(value) {
|
||||
try {
|
||||
await api.tuner.setOperate(value);
|
||||
} catch (err) {
|
||||
console.error('Failed to set operate:', err);
|
||||
alert('Failed to set operate');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Tuner Genius XL</h2>
|
||||
<div class="header-right">
|
||||
<span class="tuning-badge" class:tuning={tuningStatus === 'TUNING'}>{tuningStatus}</span>
|
||||
<span class="status-dot" class:disconnected={!connected}></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<!-- Power Display -->
|
||||
<div class="power-display">
|
||||
<div class="power-main">
|
||||
<div class="power-value">{powerForward.toFixed(0)}<span class="unit">W</span></div>
|
||||
<div class="power-label">Forward Power</div>
|
||||
</div>
|
||||
<div class="power-bar">
|
||||
<div class="power-bar-fill" style="width: {powerPercent}%">
|
||||
<div class="power-bar-glow"></div>
|
||||
</div>
|
||||
<div class="power-scale">
|
||||
<span>0</span>
|
||||
<span>1000</span>
|
||||
<span>2000</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SWR Circle -->
|
||||
<div class="swr-container">
|
||||
<div class="swr-circle" style="--swr-color: {swrColor}">
|
||||
<div class="swr-value">{swr.toFixed(2)}</div>
|
||||
<div class="swr-label">SWR</div>
|
||||
</div>
|
||||
<div class="swr-status">
|
||||
{#if swr < 1.5}
|
||||
<span class="status-text good">Excellent</span>
|
||||
{:else if swr < 2.0}
|
||||
<span class="status-text ok">Good</span>
|
||||
{:else if swr < 3.0}
|
||||
<span class="status-text warning">Caution</span>
|
||||
{:else}
|
||||
<span class="status-text danger">High!</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tuning Capacitors -->
|
||||
<div class="capacitors">
|
||||
<div class="cap-item">
|
||||
<div class="cap-value">{relayC1}</div>
|
||||
<div class="cap-label">C1</div>
|
||||
</div>
|
||||
<div class="cap-item">
|
||||
<div class="cap-value">{relayL}</div>
|
||||
<div class="cap-label">L</div>
|
||||
</div>
|
||||
<div class="cap-item">
|
||||
<div class="cap-value">{relayC2}</div>
|
||||
<div class="cap-label">C2</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Frequencies -->
|
||||
<div class="freq-display">
|
||||
<div class="freq-item">
|
||||
<div class="freq-label">Freq A</div>
|
||||
<div class="freq-value">{(frequencyA / 1000).toFixed(3)}<span class="freq-unit">MHz</span></div>
|
||||
</div>
|
||||
<div class="freq-item">
|
||||
<div class="freq-label">Freq B</div>
|
||||
<div class="freq-value">{(frequencyB / 1000).toFixed(3)}<span class="freq-unit">MHz</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Control Buttons -->
|
||||
<div class="controls">
|
||||
<button
|
||||
class="control-btn operate"
|
||||
class:active={state === 1}
|
||||
on:click={() => setOperate(state === 1 ? 0 : 1)}
|
||||
>
|
||||
{state === 1 ? 'OPERATE' : 'STANDBY'}
|
||||
</button>
|
||||
<button
|
||||
class="control-btn bypass"
|
||||
class:active={bypass}
|
||||
on:click={() => setBypass(bypass ? 0 : 1)}
|
||||
>
|
||||
BYPASS
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="tune-btn" on:click={autoTune}>
|
||||
<span class="tune-icon">⚡</span>
|
||||
AUTO TUNE
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-bottom: 1px solid #2d3748;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
margin: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tuning-badge {
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
background: rgba(76, 175, 80, 0.2);
|
||||
color: #4caf50;
|
||||
}
|
||||
|
||||
.tuning-badge.tuning {
|
||||
background: rgba(255, 152, 0, 0.2);
|
||||
color: #ff9800;
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
box-shadow: 0 0 8px #4caf50;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #f44336;
|
||||
box-shadow: 0 0 8px #f44336;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
/* Power Display */
|
||||
.power-display {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.power-main {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.power-value {
|
||||
font-size: 48px;
|
||||
font-weight: 200;
|
||||
color: var(--accent-cyan);
|
||||
line-height: 1;
|
||||
text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
.power-value .unit {
|
||||
font-size: 24px;
|
||||
color: var(--text-secondary);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.power-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.power-bar {
|
||||
position: relative;
|
||||
height: 8px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.power-bar-fill {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #4caf50, #ffc107, #ff9800, #f44336);
|
||||
border-radius: 4px;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.power-bar-glow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 20px;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
|
||||
animation: shimmer 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { transform: translateX(-100%); }
|
||||
100% { transform: translateX(100%); }
|
||||
}
|
||||
|
||||
.power-scale {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* SWR Circle */
|
||||
.swr-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.swr-circle {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle, rgba(79, 195, 247, 0.1), transparent);
|
||||
border: 3px solid var(--swr-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 20px var(--swr-color);
|
||||
}
|
||||
|
||||
.swr-value {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
color: var(--swr-color);
|
||||
}
|
||||
|
||||
.swr-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.swr-status {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.status-text.good { color: #4caf50; }
|
||||
.status-text.ok { color: #ffc107; }
|
||||
.status-text.warning { color: #ff9800; }
|
||||
.status-text.danger { color: #f44336; }
|
||||
|
||||
/* Capacitors */
|
||||
.capacitors {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(79, 195, 247, 0.2);
|
||||
}
|
||||
|
||||
.cap-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.cap-value {
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: var(--accent-cyan);
|
||||
text-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
.cap-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* Frequencies */
|
||||
.freq-display {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.freq-item {
|
||||
padding: 10px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.freq-label {
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.freq-value {
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.freq-unit {
|
||||
font-size: 11px;
|
||||
color: var(--text-secondary);
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* Controls */
|
||||
.controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.control-btn {
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--border-color);
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.control-btn:hover {
|
||||
border-color: var(--accent-cyan);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.control-btn.active {
|
||||
background: var(--accent-cyan);
|
||||
border-color: var(--accent-cyan);
|
||||
color: #000;
|
||||
box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
|
||||
}
|
||||
|
||||
.tune-btn {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: linear-gradient(135deg, #f44336, #d32f2f);
|
||||
color: white;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
|
||||
}
|
||||
|
||||
.tune-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(244, 67, 54, 0.5);
|
||||
}
|
||||
|
||||
.tune-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.tune-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
305
web/src/components/WebSwitch.svelte
Normal file
305
web/src/components/WebSwitch.svelte
Normal file
@@ -0,0 +1,305 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: relays = status?.relays || [];
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
const relayNames = {
|
||||
1: 'Power Supply',
|
||||
2: 'PGXL',
|
||||
3: 'TGXL',
|
||||
4: 'Flex Radio Start',
|
||||
5: 'Reserve'
|
||||
};
|
||||
|
||||
let loading = {};
|
||||
|
||||
async function toggleRelay(relayNum) {
|
||||
const relay = relays.find(r => r.number === relayNum);
|
||||
const currentState = relay?.state || false;
|
||||
|
||||
loading[relayNum] = true;
|
||||
try {
|
||||
if (currentState) {
|
||||
await api.webswitch.relayOff(relayNum);
|
||||
} else {
|
||||
await api.webswitch.relayOn(relayNum);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle relay:', err);
|
||||
alert('Failed to control relay');
|
||||
} finally {
|
||||
loading[relayNum] = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function allOn() {
|
||||
try {
|
||||
await api.webswitch.allOn();
|
||||
} catch (err) {
|
||||
console.error('Failed to turn all on:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function allOff() {
|
||||
try {
|
||||
await api.webswitch.allOff();
|
||||
} catch (err) {
|
||||
console.error('Failed to turn all off:', err);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>WebSwitch</h2>
|
||||
<span class="status-dot" class:disconnected={!connected}></span>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<div class="relays">
|
||||
{#each [1, 2, 3, 4, 5] as relayNum}
|
||||
{@const relay = relays.find(r => r.number === relayNum)}
|
||||
{@const isOn = relay?.state || false}
|
||||
<div class="relay-card" class:relay-on={isOn}>
|
||||
<div class="relay-info">
|
||||
<div class="relay-details">
|
||||
<div class="relay-name">{relayNames[relayNum]}</div>
|
||||
<div class="relay-status">{isOn ? 'ON' : 'OFF'}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="relay-toggle"
|
||||
class:active={isOn}
|
||||
class:loading={loading[relayNum]}
|
||||
disabled={loading[relayNum]}
|
||||
on:click={() => toggleRelay(relayNum)}
|
||||
>
|
||||
<div class="toggle-track">
|
||||
<div class="toggle-thumb"></div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<button class="control-btn all-on" on:click={allOn}>
|
||||
<span class="btn-icon">⚡</span>
|
||||
ALL ON
|
||||
</button>
|
||||
<button class="control-btn all-off" on:click={allOff}>
|
||||
<span class="btn-icon">⏻</span>
|
||||
ALL OFF
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: rgba(79, 195, 247, 0.05);
|
||||
border-bottom: 1px solid #2d3748;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-cyan);
|
||||
margin: 0;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
box-shadow: 0 0 8px #4caf50;
|
||||
}
|
||||
|
||||
.status-dot.disconnected {
|
||||
background: #f44336;
|
||||
box-shadow: 0 0 8px #f44336;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Relays */
|
||||
.relays {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.relay-card {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border-color);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.relay-card.relay-on {
|
||||
background: rgba(76, 175, 80, 0.1);
|
||||
border-color: rgba(76, 175, 80, 0.3);
|
||||
box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
|
||||
}
|
||||
|
||||
.relay-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.relay-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.relay-name {
|
||||
font-size: 12px;
|
||||
color: var(--text-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.relay-status {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.relay-card.relay-on .relay-status {
|
||||
color: #4caf50;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Toggle Switch */
|
||||
.relay-toggle {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toggle-track {
|
||||
width: 52px;
|
||||
height: 28px;
|
||||
background: var(--bg-primary);
|
||||
border: 2px solid var(--border-color);
|
||||
border-radius: 14px;
|
||||
position: relative;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.relay-toggle:hover .toggle-track {
|
||||
border-color: var(--accent-cyan);
|
||||
}
|
||||
|
||||
.relay-toggle.active .toggle-track {
|
||||
background: linear-gradient(135deg, #4caf50, #66bb6a);
|
||||
border-color: #4caf50;
|
||||
box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
|
||||
}
|
||||
|
||||
.toggle-thumb {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
transition: all 0.3s;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.relay-toggle.active .toggle-thumb {
|
||||
transform: translateX(24px);
|
||||
}
|
||||
|
||||
.relay-toggle:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Controls */
|
||||
.controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.control-btn {
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.control-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.control-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.all-on {
|
||||
background: linear-gradient(135deg, #4caf50, #66bb6a);
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
|
||||
}
|
||||
|
||||
.all-on:hover {
|
||||
box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
|
||||
}
|
||||
|
||||
.all-off {
|
||||
background: linear-gradient(135deg, #f44336, #d32f2f);
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
|
||||
}
|
||||
|
||||
.all-off:hover {
|
||||
box-shadow: 0 6px 16px rgba(244, 67, 54, 0.5);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user