From 7a9ab0e553cb5eed6229154d7766eb53e25ccb5e Mon Sep 17 00:00:00 2001 From: PitresAli Date: Wed, 26 Aug 2026 19:12:51 +0200 Subject: [PATCH] Restore complete control layout and window interaction --- SUB Control/web/app.js | 2 +- SUB Control/web/index.html | 182 ++++-- SUB Control/web/styles.css | 1194 +++++++++++++++++------------------- 3 files changed, 686 insertions(+), 692 deletions(-) diff --git a/SUB Control/web/app.js b/SUB Control/web/app.js index f9a8bd7..f6525fe 100644 --- a/SUB Control/web/app.js +++ b/SUB Control/web/app.js @@ -96,7 +96,7 @@ $$('dialog').forEach(d=>{ if(e.clientXr.right||e.clientYr.bottom)closeModal(d); }); }); -$('#window-min').onclick=()=>api('minimize_window');$('#window-max').onclick=async()=>{const max=await api('toggle_maximize_window');document.body.classList.toggle('maximized',!!max)};$('#window-close').onclick=()=>{if(document.body.classList.contains('window-exiting'))return;document.body.classList.add('window-exiting');setTimeout(()=>api('close_window'),360)};$('.topbar').ondblclick=async e=>{if(!e.target.closest('button,select,input')){const max=await api('toggle_maximize_window');document.body.classList.toggle('maximized',!!max)}}; +$('#window-min').onclick=()=>api('minimize_window');$('#window-max').onclick=async()=>{const max=await api('toggle_maximize_window');document.body.classList.toggle('maximized',!!max)};$('#window-close').onclick=()=>{if(document.body.classList.contains('window-exiting'))return;document.body.classList.add('window-exiting');setTimeout(()=>api('close_window'),360)};const windowBar=$('.workspace-topbar');if(windowBar)windowBar.ondblclick=async e=>{if(!e.target.closest('button,select,input')){const max=await api('toggle_maximize_window');document.body.classList.toggle('maximized',!!max)}}; const modelInput=$('#model-input'), modelButton=$('#load-model'), rovStage=$('.rov-stage'); async function handleStlFile(file){ diff --git a/SUB Control/web/index.html b/SUB Control/web/index.html index 3245025..089c8fb 100644 --- a/SUB Control/web/index.html +++ b/SUB Control/web/index.html @@ -4,92 +4,160 @@ Sub Control - +
- - -
-
-
+ + + + + +
+ +
+
-
+ -
+
+ +
+ vehicle control + +
+ + +
+
-
steer + throttledifferential drive
w a s d
-
- +
+
steer + throttledifferential drive
+ w a s d +
+
+
+ +
-
surge 00 turn
+
+ surge — + — turn +
+
-
verticalcenter thruster
r / f
-
- rise -
- dive +
+
verticalcenter thruster
+ r / f +
+
+
+ rise +
+
+
+
+
+ dive +
-
0 vertical
+
+ — vertical +
+
- -
-
-
- -
- - -
-
-

Disconnected — select a port and connect

logs
+ connection

Link Settings

20 Hz is recommended for smooth intermediate commands on this link.

Power

Battery Settings

configuration

Motor Outputs

Function and direction are read one parameter at a time to protect the low-bandwidth link.

OutputFunctionDirection
- - - + + + diff --git a/SUB Control/web/styles.css b/SUB Control/web/styles.css index 4caac4a..8334752 100644 --- a/SUB Control/web/styles.css +++ b/SUB Control/web/styles.css @@ -1,4 +1,4 @@ -/* SUB Control UI – Clean, minimal interface with native sizing */ +/* SUB Control UI – Desktop Layout */ :root { color-scheme: dark; @@ -13,7 +13,7 @@ --cyan: #72d8e8; --amber: #f2c675; --red: #f0958b; - --shadow: 0 16px 50px rgba(0, 0, 0, 0.05); + --shadow: 0 10px 30px rgba(0, 0, 0, 0.05); font-family: Inter, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 300; } @@ -34,105 +34,255 @@ body { font-size: 13px; color: var(--ink); -webkit-font-smoothing: antialiased; - zoom: 1.5625; } button, select, input { font: inherit; } -/* ── App Shell ── */ +/* ── App Shell (Root Desktop Split Grid) ── */ .app-shell { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; display: grid; - grid-template-columns: 236px 1fr; + grid-template-columns: 240px minmax(0, 1fr); overflow: hidden; background: var(--panel); - border-radius: calc(8px / 1.5625); + border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05); } body.maximized .app-shell { border-radius: 0; } -/* ── Left Rail (Windows Acrylic Frosted Glass with Blue Subsea Glow) ── */ -.vehicle-rail { - position: relative; +/* ══════════════════════════════════════════════════════════════════ + SIDEBAR DECK: Connection, 3D Model, Battery, Deck Controls, Status + ══════════════════════════════════════════════════════════════════ */ +.sidebar-deck { display: flex; flex-direction: column; - padding: 20px 18px 16px; + gap: 10px; + padding: 14px 14px 10px; background: - radial-gradient(ellipse 110% 45% at 50% 28%, rgba(30, 144, 255, 0.18) 0%, rgba(0, 200, 255, 0.08) 45%, transparent 75%), - radial-gradient(ellipse 130% 60% at 50% 0%, rgba(68, 120, 160, 0.22) 0%, transparent 75%), + radial-gradient(ellipse 110% 45% at 50% 28%, rgba(30, 144, 255, 0.12) 0%, rgba(0, 200, 255, 0.04) 45%, transparent 75%), linear-gradient(175deg, #1b2328 0%, #12171a 50%, #0c1012 100%); border-right: 1px solid rgba(255, 255, 255, 0.08); - box-shadow: - inset -1px 0 0 rgba(255, 255, 255, 0.02), - inset 0 1px 0 rgba(255, 255, 255, 0.06), - inset 0 40px 80px -20px rgba(0, 170, 255, 0.12); color: #f1f4f2; - overflow: hidden; + overflow-y: auto; + overflow-x: hidden; } -.vehicle-rail::before { - content: ""; - position: absolute; - inset: 0; - pointer-events: none; - background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 35%, transparent 70%); - z-index: 1; + +/* ── Connection Controls in Deck ── */ +.deck-connection { + display: flex; + flex-direction: column; + gap: 6px; + padding-bottom: 10px; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); } -.vehicle-rail > * { - position: relative; - z-index: 2; -} -.brand { +.port-row { display: flex; align-items: center; - font-size: 14px; - font-weight: 300; - letter-spacing: -0.01em; + gap: 4px; +} +.port-row select { + flex: 1; + min-width: 0; + height: 28px; + padding: 0 8px; + font-size: 10.5px; + font-weight: 500; + cursor: pointer; + background: #20272b; + color: #f1f4f2; + border: 1px solid rgba(255, 255, 255, 0.12); + border-radius: 999px; + outline: none; + text-overflow: ellipsis; +} +.port-row select option { + background: #171b19; color: #f1f4f2; } + +.button, .icon-button { + height: 28px; + border: 1px solid transparent; + border-radius: 999px; + padding: 0 12px; + color: #f1f4f2; + background: #20272b; + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 10.5px; + font-weight: 400; + transition: transform 0.15s, background 0.15s, border-color 0.15s; +} +.button:hover, .icon-button:hover { + transform: translateY(-1px); + border-color: rgba(255, 255, 255, 0.18); + background: #293237; +} +.icon-button { + width: 28px; + padding: 0; + flex-shrink: 0; + border: 1px solid rgba(255, 255, 255, 0.1); +} +.icon-button svg { + width: 12px; + height: 12px; + fill: none; + stroke: currentColor; + stroke-width: 1.5; + stroke-linecap: round; + stroke-linejoin: round; +} +.icon-button .dots-icon { + fill: currentColor; + stroke: none; +} + +.connect-button { + position: relative; + overflow: hidden; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + width: 100%; + height: 29px; + padding: 0 14px; + background: #253036; + border: 1px solid rgba(255, 255, 255, 0.14); + border-radius: 999px; + color: #ffffff; + font-family: inherit; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.03em; + cursor: pointer; + transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); + user-select: none; +} +.connect-button:hover { + background: #313e46; + border-color: rgba(255, 255, 255, 0.25); +} +.connect-button:active { + transform: scale(0.97); +} + +.connect-button .btn-spinner { + display: none; + width: 11px; + height: 11px; + border: 2px solid rgba(114, 216, 232, 0.25); + border-top-color: #72d8e8; + border-radius: 50%; + animation: connect-spin 0.65s linear infinite; + flex-shrink: 0; +} +.connect-button .btn-label { + display: inline-block; + white-space: nowrap; +} + +@keyframes connect-spin { to { transform: rotate(360deg); } } +@keyframes connect-pulse { + 0%, 100% { opacity: 1; transform: scale(1); } + 50% { opacity: 0.65; transform: scale(0.98); } +} + +body[data-app-state="connecting"] .connect-button, +.connect-button.is-connecting { + background: rgba(18, 36, 42, 0.95) !important; + border-color: rgba(114, 216, 232, 0.6) !important; + color: #72d8e8 !important; + box-shadow: 0 0 12px rgba(114, 216, 232, 0.25) !important; + cursor: progress !important; + pointer-events: auto !important; + opacity: 1 !important; +} +body[data-app-state="connecting"] .connect-button .btn-spinner, +.connect-button.is-connecting .btn-spinner { + display: inline-block !important; +} +body[data-app-state="connecting"] .connect-button .btn-label, +.connect-button.is-connecting .btn-label { + animation: connect-pulse 1.3s ease-in-out infinite; +} + +body[data-app-state="connected_disarmed"] .connect-button, +body[data-app-state="armed"] .connect-button, +body[data-app-state="link_degraded"] .connect-button, +.connect-button.is-connected { + background: rgba(50, 18, 18, 0.85) !important; + border-color: rgba(255, 107, 107, 0.4) !important; + color: #ffb4b4 !important; +} +body[data-app-state="connected_disarmed"] .connect-button:hover, +body[data-app-state="armed"] .connect-button:hover, +body[data-app-state="link_degraded"] .connect-button:hover, +.connect-button.is-connected:hover { + background: rgba(70, 22, 22, 0.95) !important; + border-color: rgba(255, 107, 107, 0.75) !important; + color: #ffffff !important; +} + +/* ── 3D Model Stage in Deck ── */ +.deck-card { + display: flex; + flex-direction: column; +} +.sidebar-deck button, +.sidebar-deck select, +.sidebar-deck input, +.sidebar-deck a, +.sidebar-deck canvas { + -webkit-app-region: no-drag; +} +.telemetry-zone { + display: flex; + flex: 1; + min-height: 0; + flex-direction: column; + gap: 10px; +} +.telemetry-zone .model-card { flex: 1; min-height: 0; } .eyebrow { - font-size: 9px; + font-size: 8.5px; font-weight: 400; color: #727c80; letter-spacing: 0.03em; } -.vehicle-rail > .eyebrow { - margin-top: 18px; -} .rov-stage { position: relative; - height: min(32vh, 195px); - min-height: 155px; + height: min(24vh, 160px); + min-height: 120px; display: grid; place-items: center; - border-radius: 12px; + border-radius: 10px; transition: background 0.2s ease, border-color 0.2s ease; } .rov-stage::before { content: ""; position: absolute; - width: 140px; - height: 140px; + width: 110px; + height: 110px; border-radius: 50%; - background: radial-gradient(circle, rgba(0, 180, 255, 0.22) 0%, rgba(0, 120, 220, 0.08) 50%, transparent 75%); - filter: blur(16px); + background: radial-gradient(circle, rgba(0, 180, 255, 0.2) 0%, rgba(0, 120, 220, 0.06) 50%, transparent 75%); + filter: blur(14px); pointer-events: none; z-index: 1; } -.rov-stage.drag-over { - border: 1px dashed rgba(79, 195, 247, 0.6); - background: rgba(79, 195, 247, 0.06); -} .water-ring { position: absolute; - border: 1px solid rgba(0, 200, 255, 0.22); - box-shadow: 0 0 14px rgba(0, 180, 255, 0.12); + border: 1px solid rgba(0, 200, 255, 0.2); border-radius: 50%; transform: scaleY(0.55); } -.water-ring.r1 { width: 175px; height: 175px; } -.water-ring.r2 { width: 125px; height: 125px; border-color: rgba(114, 216, 232, 0.32); } +.water-ring.r1 { width: 140px; height: 140px; } +.water-ring.r2 { width: 95px; height: 95px; border-color: rgba(114, 216, 232, 0.28); } .rov-stage #model-canvas { display: block; @@ -146,14 +296,14 @@ body.maximized .app-shell { } .model-status { position: absolute; - top: 8px; + top: 6px; left: 50%; transform: translateX(-50%); - padding: 3px 8px; + padding: 2px 7px; background: rgba(18, 24, 27, 0.85); border: 1px solid rgba(79, 195, 247, 0.25); - border-radius: 6px; - font-size: 8.5px; + border-radius: 5px; + font-size: 8px; letter-spacing: 0.04em; color: #8edcf8; z-index: 5; @@ -167,44 +317,40 @@ body.maximized .app-shell { color: #ff8a80; background: rgba(40, 15, 15, 0.9); } -.model-status.fade-out { - opacity: 0; -} -.model-tools { - display: none !important; -} +.model-status.fade-out { opacity: 0; } +.model-tools { display: none !important; } .vehicle-name { display: flex; flex-direction: column; - gap: 2px; + gap: 1px; + margin-top: 2px; } .vehicle-name small, .battery-card small { - font-size: 8.5px; + font-size: 8px; color: #687276; font-weight: 400; } .vehicle-name strong { - font-size: 14.5px; + font-size: 13.5px; font-weight: 400; letter-spacing: -0.01em; } .vehicle-name span { - font-size: 9.5px; + font-size: 9px; color: #727c80; } -.rail-bottom { - margin-top: auto; -} +/* ── Battery Card ── */ .battery-card { display: grid; grid-template-columns: 1fr auto; width: 100%; - padding: 0 0 12px; + padding: 6px 0 8px; text-align: left; color: inherit; border: 0; + border-top: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: transparent; cursor: pointer; @@ -214,22 +360,22 @@ body.maximized .app-shell { .battery-card > span { display: flex; flex-direction: column; - gap: 2px; + gap: 1px; } .battery-card strong { - font-size: 16px; + font-size: 14.5px; font-weight: 400; } .battery-card i { align-self: end; color: #859094; - font-size: 10px; + font-size: 9.5px; font-style: normal; } .battery-card b { grid-column: 1 / -1; - height: 3.5px; - margin-top: 6px; + height: 3px; + margin-top: 5px; background: #31383c; border-radius: 999px; overflow: hidden; @@ -243,126 +389,182 @@ body.maximized .app-shell { transition: width 0.35s; } -/* ── Single Solid LED Dot ── */ -.link-state { - display: flex; - align-items: center; - gap: 7px; - margin-top: 10px; - font-size: 9.5px; - color: #929a9c; -} -.link-state span { - width: 6.5px; - height: 6.5px; - border-radius: 50%; - background: var(--red); - box-shadow: none !important; -} -.link-state.online span { - background: var(--acid); - box-shadow: none !important; -} -.link-state strong { - font-weight: 400; -} - -/* ── Right Workspace (Seamless) ── */ -.workspace { +/* ── Output Limit & Motor Setup ── */ +.controls-deck { display: flex; flex-direction: column; - padding: 18px 20px 14px; - color: var(--ink); - background: linear-gradient(155deg, #f7f8f6, #ebefec); - min-width: 0; + gap: 8px; + padding: 2px 0; } - -/* ── Topbar with Large Circular Window Buttons ── */ -.topbar { +.output-limit { + display: flex; + flex-direction: column; + gap: 3px; + font-size: 9px; + color: #8a9497; + font-weight: 300; + width: 100%; +} +.output-limit span { display: flex; - align-items: center; justify-content: space-between; - padding-bottom: 12px; - border-bottom: 1px solid var(--line); - user-select: none; + white-space: nowrap; } -.connection { - display: flex; +.output-limit b { + font-weight: 500; + color: #f1f4f2; +} +.range-pill { + display: grid; + grid-template-columns: 20px 1fr 20px; align-items: center; - gap: 5px; - -webkit-app-region: no-drag; -} -.topbar-spacer { - flex: 1; - height: 32px; - min-width: 20px; -} -select, input { - border: 1px solid #d4d8d3; - background: #fff; - color: #212527; + width: 100%; + height: 22px; border-radius: 999px; - outline: 0; + background: #20272b; + border: 1px solid rgba(255, 255, 255, 0.08); + overflow: hidden; +} +.range-pill button { + width: 20px; + height: 22px; + border: 0; + background: transparent; + color: #8a9497; cursor: pointer; -} -.connection select { - width: 135px; - height: 32px; - padding: 0 12px; - font-size: 10.5px; - cursor: pointer; - position: relative; - z-index: 5; - -webkit-app-region: no-drag; -} -.button, .icon-button { - height: 32px; - border: 1px solid transparent; - border-radius: 999px; - padding: 0 14px; - color: #28302c; - background: #e8ebe6; - cursor: pointer; - display: inline-flex; - align-items: center; - justify-content: center; - font-size: 10.5px; - font-weight: 400; - transition: transform 0.15s, background 0.15s, box-shadow 0.15s; -} -.button:hover, .icon-button:hover { - transform: translateY(-1px); - box-shadow: 0 3px 10px rgba(30, 40, 35, 0.08); -} -.icon-button { - width: 32px; + display: grid; + place-items: center; padding: 0; } -.icon-button svg { - width: 13px; - height: 13px; - fill: none; - stroke: currentColor; - stroke-width: 1.5; - stroke-linecap: round; - stroke-linejoin: round; +.range-pill button:hover { color: #f1f4f2; } +.range-pill button::after { display: none !important; } +.range-pill input[type="range"] { + width: 100%; + height: 4px; + margin: 0; + padding: 0; + border: 0; + background: #394247; + border-radius: 999px; + outline: none; + cursor: pointer; + -webkit-appearance: none; } -.icon-button .dots-icon { - fill: currentColor; - stroke: none; +.range-pill input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + width: 11px; + height: 11px; + border-radius: 50%; + background: #c9f277; + cursor: pointer; } -.connect-button { - background: #171b19; - color: #fff; - padding: 0 15px; -} -.connect-button:hover { background: #282f2c; } -/* ── Window Actions (Frameless Minimal Icons) ── */ -.window-actions { +.config-btn { + width: 100%; + height: 26px; + font-size: 10px; + background: #20272b; + color: #d1d8d6; + border: 1px solid rgba(255, 255, 255, 0.08); +} +.config-btn:hover { + background: #2b353b; + color: #ffffff; +} + +/* ── Status Bar in Deck ── */ +.deck-status-bar { + margin-top: auto; + padding-top: 6px; + border-top: 1px solid rgba(255, 255, 255, 0.08); +} +.status-line { display: flex; align-items: center; gap: 6px; + font-size: 9px; + color: #8a9497; +} +.status-line .status-dot { + width: 5px; + height: 5px; + border-radius: 50%; + flex-shrink: 0; + background: var(--muted); + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); + transition: background 0.25s ease, box-shadow 0.25s ease; +} +body[data-app-state="disconnected"] .status-line .status-dot, +body[data-app-state="connecting"] .status-line .status-dot { + background: var(--muted); +} +body[data-app-state="connected_disarmed"] .status-line .status-dot { + background: var(--cyan); + box-shadow: 0 0 6px rgba(114, 216, 232, 0.6); +} +body[data-app-state="armed"] .status-line .status-dot { + background: var(--acid); + box-shadow: 0 0 6px rgba(201, 242, 119, 0.65); +} +body[data-app-state="link_degraded"] .status-line .status-dot { + background: var(--red); + box-shadow: 0 0 6px rgba(240, 149, 139, 0.65); +} +.status-line p { + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.logs-link { + all: unset; + cursor: pointer; + color: #9aa29f; + font-size: 9px; + letter-spacing: 0.02em; + margin-left: auto; +} +.logs-link:hover { color: #f1f4f2; } + +/* ══════════════════════════════════════════════════════════════════ + PRIMARY CONTROL ZONE (Workspace) + Engage/Disarm banner directly above Joysticks + Controls Grid + ══════════════════════════════════════════════════════════════════ */ +.controls-workspace { + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; + padding: 10px 16px 14px; + background: linear-gradient(155deg, #f7f8f6, #ebefec); + min-width: 0; + position: relative; +} +.primary-control-zone { + display: grid; + grid-template-rows: auto minmax(0, 1fr); + flex: 1; + min-height: 0; +} + +/* ── Minimal Window Bar ── */ +.workspace-topbar { + display: flex; + align-items: center; + justify-content: space-between; + height: 24px; + min-height: 24px; + margin-bottom: 6px; + user-select: none; +} +.workspace-drag-area { + flex: 1; + height: 100%; +} +.window-actions { + display: flex; + align-items: center; + gap: 4px; -webkit-app-region: no-drag; } .window-actions button { @@ -379,12 +581,10 @@ select, input { box-shadow: none; transition: color 0.2s ease, opacity 0.2s ease; } -.window-actions button::after { - display: none !important; -} +.window-actions button::after { display: none !important; } .window-actions button svg { - width: 13px; - height: 13px; + width: 12px; + height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; @@ -394,37 +594,104 @@ select, input { .window-actions button:hover { background: transparent; color: #1a1e1d; - box-shadow: none; -} -.window-actions button:active { - opacity: 0.65; } +.window-actions button:active { opacity: 0.65; } .window-actions .window-close:hover { background: transparent; color: #e04438; } -.window-actions .window-close:active { - opacity: 0.65; - color: #b52f25; + +/* ── Engage / Disarm Slot Above Joysticks ── */ +.engage-header-zone { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 42px; + margin-bottom: 10px; +} +.zone-label { + font-size: 9px; + color: #727a7c; + text-transform: uppercase; + letter-spacing: .08em; +} +.engage-button { + min-width: 140px; + height: 32px; + padding: 0 20px; + font-size: 11px; + font-weight: 500; + border-radius: 999px; + position: relative; + overflow: hidden; + user-select: none; +} +.subtle { background: #e2e6e1; color: #28302c; border: 1px solid rgba(0, 0, 0, 0.08); } +.subtle:hover { background: #d7dcd5; } + +.arm { + background: #eef3e5; + color: #24351a; + border: 1px solid rgba(157, 232, 72, 0.4); + cursor: pointer; +} +.arm::before { + content: ""; + position: absolute; + z-index: 1; + inset: 0 auto 0 0; + width: var(--arm-progress, 0%); + border-radius: inherit; + background: linear-gradient(90deg, #c9f277, #9de848); + pointer-events: none; + transition: width 0.04s linear; +} +.arm-copy { + display: grid; + place-items: center; + width: 100%; + position: relative; + z-index: 2; +} +.arm-copy > span { + grid-area: 1 / 1; + transition: opacity 0.15s, transform 0.15s; +} +.arm-holding-label { opacity: 0; transform: translateY(3px); } +.arm.charging .arm-label { opacity: 0; transform: translateY(-3px); } +.arm.charging .arm-holding-label { opacity: 1; transform: translateY(0); } +.arm.charged { + background: #c9f277 !important; + color: #14200d !important; + transform: scale(1.04); +} +.danger { + background: #f8deda; + color: #7a2822; + border: 1px solid rgba(240, 149, 139, 0.4); +} +.danger:hover { + background: #f4cac4; + border-color: rgba(240, 149, 139, 0.7); } -/* ── Drive Grid ── */ -.drive-grid { - --joy-size: min(30vh, 215px); +/* ── Main Controls Grid ── */ +.controls-grid { + --joy-size: min(34vh, 230px); --joy-circle-d: calc(var(--joy-size) * 0.90); display: grid; - grid-template-columns: minmax(290px, 1fr) 175px; - gap: 11px; + grid-template-columns: minmax(300px, 1fr) 175px; + gap: 12px; flex: 1; min-height: 0; - padding: 10px 0; } + .control-card { display: flex; flex-direction: column; - padding: 13px 15px 10px; + padding: 12px 14px 10px; border: 1px solid #e1e4e0; - border-radius: 22px; + border-radius: 18px; background: var(--card); box-shadow: var(--shadow); min-height: 0; @@ -449,15 +716,23 @@ select, input { font-weight: 400; } .key-hint { - padding: 3px 6px; - border-radius: 6px; + padding: 2px 5px; + border-radius: 5px; background: #f0f2ef; color: #7e8583; - font-size: 8.5px; + font-size: 8px; font-weight: 400; } -/* ── Joystick Card ── */ +.joystick-pad, .heave-pad { + display: flex; + align-items: center; + justify-content: center; + flex: 1; + min-height: 0; + padding: 6px; +} + .joystick { --size: var(--joy-size); position: relative; @@ -474,7 +749,6 @@ select, input { .joystick:before, .joystick:after { display: none !important; } .axis, .axis-label, .axis-copy, .stick, .stick-shadow { display: none !important; } -/* ── Vertical Card & Slider (Matched in Height to Joystick Sphere) ── */ .vertical-control { display: flex; flex-direction: column; @@ -486,7 +760,6 @@ select, input { font-size: 8.5px; font-weight: 400; color: #828a87; - padding: 2px 0; } .heave-track { position: relative; @@ -547,14 +820,13 @@ select, input { scale: 0.93; } -/* ── Aligned Footers ── */ .control-card footer { display: flex; align-items: center; height: 14px; margin-top: auto; color: #7e8583; - font-size: 9.5px; + font-size: 9px; font-weight: 300; line-height: 1; } @@ -569,176 +841,10 @@ select, input { align-items: center; gap: 3px; } -.dot { display: none !important; } -/* ── Command Bar (Bottom Pill Tray) ── */ -.bottom-actions { - display: flex; - flex-direction: column; - gap: 5px; -} -.command-bar { - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - height: 42px; - padding: 4px 8px; - border: 1px solid #dde1dc; - border-radius: 999px; - background: #fff; - box-shadow: 0 5px 16px rgba(0, 0, 0, 0.03); -} -.commands { - display: flex; - align-items: center; - gap: 5px; -} -.commands .button { - height: 30px; - padding: 0 12px; - font-size: 10px; -} -.subtle { background: #edf0ec; color: #262d29; } -.arm { - background: #eef3e5; - color: #24351a; - min-width: 66px; - position: relative; - isolation: isolate; - overflow: hidden; - user-select: none; - touch-action: none; - cursor: pointer; -} -.arm::before { - content: ""; - position: absolute; - z-index: 1; - inset: 0 auto 0 0; - width: var(--arm-progress, 0%); - border-radius: inherit; - background: linear-gradient(90deg, #c9f277, #9de848); - pointer-events: none; - transition: width 0.04s linear; -} -.arm-copy { - display: grid; - place-items: center; - width: 100%; - position: relative; - z-index: 2; -} -.arm-copy > span { - grid-area: 1 / 1; - transition: opacity 0.15s, transform 0.15s; -} -.arm-holding-label { opacity: 0; transform: translateY(3px); } -.arm.charging .arm-label { opacity: 0; transform: translateY(-3px); } -.arm.charging .arm-holding-label { opacity: 1; transform: translateY(0); } -.arm.charged { - background: #c9f277 !important; - color: #14200d !important; - transform: scale(1.04); -} -.danger { background: #f8deda; color: #7a2822; } - -/* ── Output Limit Slider ── */ -.output-limit { - display: flex; - align-items: center; - gap: 8px; - font-size: 10px; - color: #656d6a; - font-weight: 300; - flex: 1; - max-width: 240px; - margin: 0 4px; -} -.output-limit span { - white-space: nowrap; -} -.output-limit b { - font-weight: 400; - color: #232926; -} -.range-pill { - display: grid; - grid-template-columns: 22px 1fr 22px; - align-items: center; - width: 100%; - height: 25px; - border-radius: 999px; - background: #eaede8; - overflow: hidden; -} -.range-pill button { - width: 22px; - height: 25px; - border: 0; - background: transparent; - color: #626966; - font-size: 13px; - font-weight: 400; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - padding: 0; -} -.range-pill button:hover { background: #dee2dc; color: #161a18; } -.range-pill input[type="range"] { - width: 100%; - height: 14px; - margin: 0; - padding: 0 3px; - border: 0; - background: transparent; - accent-color: #3b4341; - -webkit-appearance: none; -} -.range-pill input::-webkit-slider-runnable-track { - height: 4.5px; - border-radius: 3px; - background: #d6dbd4; -} -.range-pill input::-webkit-slider-thumb { - width: 12px; - height: 16px; - margin-top: -5.75px; - border: 1px solid #aeb4ae; - border-radius: 999px; - background: #bcc0bb; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); - -webkit-appearance: none; -} - -/* ── Status Line & Logs ── */ -.status-line { - display: flex; - align-items: center; - justify-content: space-between; - font-size: 9.5px; - color: #7c8481; - padding: 1px 3px 0; -} -.status-line p { - margin: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.logs-link { - all: unset; - cursor: pointer; - color: #9aa29f; - font-size: 9.5px; - letter-spacing: 0.02em; - margin-left: auto; -} -.logs-link:hover { color: #3c4240; } - -/* ── Modals & Number Steppers (Floaty, Feathery Transitions) ── */ +/* ══════════════════════════════════════════════════════════════════ + MODALS + ══════════════════════════════════════════════════════════════════ */ .modal { width: min(540px, calc(100vw - 40px)); padding: 22px 24px; @@ -748,322 +854,142 @@ select, input { color: #1a1e1f; box-shadow: 0 30px 80px -12px rgba(0, 0, 0, 0.42), - 0 12px 28px -4px rgba(0, 0, 0, 0.20), - 0 0 0 1px rgba(255, 255, 255, 0.35) inset; - backdrop-filter: blur(16px); - -webkit-backdrop-filter: blur(16px); - outline: none; - transform-origin: center center; - will-change: transform, opacity, filter; + 0 0 0 1px rgba(0, 0, 0, 0.06), + 0 10px 24px -6px rgba(0, 0, 0, 0.16); + backdrop-filter: blur(28px) saturate(160%); + -webkit-backdrop-filter: blur(28px) saturate(160%); } - .modal::backdrop { - background: rgba(8, 17, 19, 0.65); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - will-change: opacity, backdrop-filter; -} - -/* Floaty feathery entrance */ -.modal[open] { - animation: featheryModalIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards; -} - -.modal[open]::backdrop { - animation: featheryBackdropIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards; -} - -/* Floaty feathery exit */ -.modal.closing { - animation: featheryModalOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards; -} - -.modal.closing::backdrop { - animation: featheryBackdropOut 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards; -} - -@keyframes featheryModalIn { - 0% { - opacity: 0; - transform: translateY(26px) scale(0.92); - filter: blur(6px); - } - 65% { - transform: translateY(-2.5px) scale(1.008); - filter: blur(0px); - } - 100% { - opacity: 1; - transform: translateY(0) scale(1); - filter: blur(0px); - } -} - -@keyframes featheryModalOut { - 0% { - opacity: 1; - transform: translateY(0) scale(1); - filter: blur(0px); - } - 100% { - opacity: 0; - transform: translateY(18px) scale(0.94); - filter: blur(4px); - } -} - -@keyframes featheryBackdropIn { - 0% { - opacity: 0; - backdrop-filter: blur(0px); - -webkit-backdrop-filter: blur(0px); - } - 100% { - opacity: 1; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - } -} - -@keyframes featheryBackdropOut { - 0% { - opacity: 1; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - } - 100% { - opacity: 0; - backdrop-filter: blur(0px); - -webkit-backdrop-filter: blur(0px); - } -} - -.modal h2 { - margin: 3px 0 13px; - font-size: 21px; - font-weight: 300; + background: rgba(10, 16, 18, 0.45); + backdrop-filter: blur(8px); + -webkit-backdrop-filter: blur(8px); } .modal-close { position: absolute; - top: 15px; - right: 15px; - width: 28px; - height: 28px; + right: 14px; + top: 14px; + width: 24px; + height: 24px; border: 0; - border-radius: 50%; - background: #e6eae4; - color: #555; - cursor: pointer; + background: transparent; font-size: 16px; - display: grid; - place-items: center; - transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s, color 0.15s; -} -.modal-close:hover { - background: #dde2db; - color: #1a1e1d; - transform: scale(1.1) rotate(90deg); -} -.modal-close:active { - transform: scale(0.9) rotate(90deg); + cursor: pointer; } .form-grid { display: grid; - gap: 10px; + gap: 12px; + margin-top: 12px; } .form-grid.two { grid-template-columns: 1fr 1fr; } -.form-grid.three { grid-template-columns: repeat(3, 1fr); } +.form-grid.three { grid-template-columns: 1fr 1fr 1fr; } .form-grid label { display: flex; flex-direction: column; gap: 4px; - color: #6f7572; - font-size: 9.5px; + font-size: 10px; } .number-pill { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; - height: 32px; - border: 1px solid #dce0db; - border-radius: 12px; - background: #fff; + height: 30px; + border-radius: 999px; + background: #eaede8; overflow: hidden; - transition: border-color 0.15s, box-shadow 0.15s; } -.number-pill:focus-within { - border-color: #9cb0a8; - box-shadow: 0 0 0 3px rgba(114, 216, 232, 0.15); -} -.number-pill input { - width: 100% !important; - height: 100% !important; - border: 0 !important; - background: transparent !important; - border-radius: 0 !important; - text-align: center; - font-size: 11.5px; - font-weight: 400; - color: #202523; - padding: 0 !important; - box-shadow: none !important; - -moz-appearance: textfield; -} -.number-pill input::-webkit-inner-spin-button, -.number-pill input::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} -.num-step { - display: flex; - align-items: center; - justify-content: center; +.number-pill button { width: 24px; - height: 32px; - padding: 0; - margin: 0; + height: 30px; border: 0; background: transparent; - color: #6e7572; - font-size: 13px; cursor: pointer; - user-select: none; - transition: background 0.12s, color 0.12s; } -.num-step:hover { background: #eef1ed; color: #161a18; } -.num-step:active { background: #dee2dd; } - +.number-pill input { + border: 0; + text-align: center; + background: transparent; +} .modal-actions { display: flex; justify-content: flex-end; - gap: 7px; + gap: 8px; margin-top: 16px; } -.modal-actions.wide { grid-column: 1 / -1; } -.note { color: #767d7a; font-size: 10px; line-height: 1.4; } - -.motor-modal { width: min(680px, calc(100vw - 40px)); } +.note { + font-size: 9.5px; + color: #7a8280; + margin-top: 8px; +} +.motor-modal { width: min(600px, calc(100vw - 40px)); } .motor-head, .motor-row { display: grid; - grid-template-columns: 65px 1fr 100px 80px; + grid-template-columns: 70px 1fr 80px 75px; align-items: center; - gap: 7px; + gap: 8px; + padding: 6px 0; + border-bottom: 1px solid #e0e4df; + font-size: 10.5px; +} +.motor-head { + font-weight: 500; + color: #727a7c; + border-bottom: 1.5px solid #c8cec6; } -.motor-head { padding: 5px 8px; color: #8e9592; font-size: 8.5px; } -.motor-list { max-height: 320px; overflow: auto; } -.motor-row { min-height: 38px; padding: 3px 8px; border-top: 1px solid #e1e4df; } -.motor-row select { height: 28px; padding: 0 6px; font-size: 10px; } -.motor-row .button { height: 26px; padding: 0 8px; font-size: 10px; } -/* ── Toast (Floaty Feathery Popup) ── */ +/* ── Toast ── */ .toast { position: fixed; - z-index: 20; - left: 50%; - bottom: 24px; - padding: 9px 18px; - border-radius: 14px; - background: rgba(27, 33, 31, 0.94); + bottom: 16px; + right: 16px; + padding: 8px 14px; + background: #171b19; color: #fff; + border-radius: 8px; font-size: 11px; - font-weight: 400; - border: 1px solid rgba(255, 255, 255, 0.14); - box-shadow: - 0 16px 42px -6px rgba(0, 0, 0, 0.5), - 0 4px 14px rgba(0, 0, 0, 0.25), - inset 0 1px 0 rgba(255, 255, 255, 0.18); - backdrop-filter: blur(14px); - -webkit-backdrop-filter: blur(14px); - transform: translate(-50%, 22px) scale(0.92); opacity: 0; - filter: blur(4px); + transform: translateY(8px); + transition: opacity 0.25s, transform 0.25s; pointer-events: none; - transition: - transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), - opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), - filter 0.32s cubic-bezier(0.16, 1, 0.3, 1); - will-change: transform, opacity, filter; + z-index: 100; } .toast.show { - transform: translate(-50%, 0) scale(1); opacity: 1; - filter: blur(0px); - animation: toastFeatherFloat 3.2s ease-in-out infinite alternate; + transform: translateY(0); } .toast.error { - background: rgba(115, 48, 42, 0.95); - border-color: rgba(240, 149, 139, 0.35); + background: #7a2822; } -@keyframes toastFeatherFloat { - 0% { - transform: translate(-50%, 0) scale(1); - } - 100% { - transform: translate(-50%, -3px) scale(1); - } -} - -/* ── Window Exit Animation ── */ -body.window-exiting .app-shell { - opacity: 0; - transform: scale(0.96) translateY(14px); - filter: blur(5px); - transition: - transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), - opacity 0.34s cubic-bezier(0.4, 0, 0.2, 1), - filter 0.34s cubic-bezier(0.4, 0, 0.2, 1); +/* ══════════════════════════════════════════════════════════════════ + APP-STATE CONDITIONAL GATING + ══════════════════════════════════════════════════════════════════ */ +body:not([data-app-state="armed"]) .controls-grid { + opacity: 0.45; pointer-events: none; + user-select: none; } -/* ── Cursor-Tracked Themed Button Light Glow ── */ -button { - --glow-x: 50%; - --glow-y: 50%; - --glow-c1: rgba(255, 255, 255, 0.20); - --glow-c2: rgba(240, 248, 245, 0.12); - --glow-c3: rgba(180, 210, 205, 0.06); - position: relative; - isolation: isolate; - overflow: hidden; +button:disabled { + opacity: 0.38 !important; + pointer-events: none !important; + cursor: not-allowed !important; } -button::after { - content: ""; - position: absolute; - z-index: 3; - inset: -1px; - border-radius: inherit; +button:disabled::after { display: none !important; } + +body[data-app-state="disconnected"] #engage, +body[data-app-state="connecting"] #engage, +body[data-app-state="link_degraded"] #engage, +body[data-app-state="connecting"] #connect, +body[data-app-state="disconnected"] button[data-open="motors-modal"], +body[data-app-state="connecting"] button[data-open="motors-modal"], +body[data-app-state="link_degraded"] button[data-open="motors-modal"] { + opacity: 0.38; pointer-events: none; - opacity: 0; - background: radial-gradient(circle 55px at var(--glow-x) var(--glow-y), var(--glow-c1) 0%, var(--glow-c2) 30%, var(--glow-c3) 65%, transparent 100%); - transition: opacity 0.25s ease; + cursor: not-allowed; } -button:hover::after { opacity: 1; } -button:active::after { opacity: 0.7; } -.arm { - --glow-c1: rgba(255, 255, 255, 0.30); - --glow-c2: rgba(235, 252, 205, 0.20); - --glow-c3: rgba(201, 242, 119, 0.12); -} -.danger { - --glow-c1: rgba(255, 255, 255, 0.28); - --glow-c2: rgba(254, 228, 224, 0.18); - --glow-c3: rgba(240, 149, 139, 0.10); -} -.connect-button { - --glow-c1: rgba(255, 255, 255, 0.22); - --glow-c2: rgba(215, 245, 255, 0.14); - --glow-c3: rgba(114, 216, 232, 0.08); -} -.subtle, .icon-button { - --glow-c1: rgba(255, 255, 255, 0.22); - --glow-c2: rgba(242, 246, 244, 0.14); - --glow-c3: rgba(195, 210, 205, 0.07); -} -button > svg, button > span, button > kbd { position: relative; z-index: 4; } @media (max-width: 950px) { .app-shell { grid-template-columns: 210px minmax(0, 1fr); } - .drive-grid { grid-template-columns: minmax(260px, 1fr) 160px; } - .workspace { padding: 14px 16px 10px; } + .controls-grid { grid-template-columns: minmax(230px, 1fr) 150px; } + .controls-workspace { padding: 8px 12px; } }