SNAPKITTYWEST commited on
Commit
0d24eba
·
verified ·
1 Parent(s): 0624bdb

Upload src/ui/cockpit.ts

Browse files
Files changed (1) hide show
  1. src/ui/cockpit.ts +41 -0
src/ui/cockpit.ts ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {SYSTEMS} from '../sim/state';
2
+ export function cockpit(){return `
3
+ <div class="flightdeck" data-view="COCKPIT">
4
+ <div id="world" aria-label="Three-dimensional spacecraft environment"></div>
5
+ <div class="vignette"></div>
6
+ <header class="topbar">
7
+ <a class="wordmark" href="./" aria-label="Orbital One flight deck"><span class="mark">O<span>1</span></span><span>ORBITAL<span class="brand-sub">FLIGHT SYSTEMS / ONE</span></span></a>
8
+ <div class="mission-ident"><span class="status-dot"></span> ODYSSEY / LEO–01 <span class="divider">|</span> <span class="muted">CREWED ORBITAL FLIGHT</span></div>
9
+ <div class="utilities"><button id="audio" title="Enable synthesized engine audio and voice">AUDIO <span>OFF</span></button><button id="engineering-toggle" title="Engineering telemetry (E)">⌘ <span>ENG</span></button><button id="help" aria-label="Open flight manual">? <span>MANUAL</span></button><button id="pause" aria-label="Pause simulation">Ⅱ <span>PAUSE</span></button></div>
10
+ </header>
11
+ <main class="viewport">
12
+ <svg class="window-frame" viewBox="0 0 1440 650" preserveAspectRatio="none" aria-hidden="true"><defs><linearGradient id="metal" x2="0" y2="1"><stop stop-color="#2b3540"/><stop offset=".45" stop-color="#121b25"/><stop offset="1" stop-color="#050a10"/></linearGradient></defs><path d="M0 0H1440V650H0Z M210 22L1230 22L1370 560L720 630L70 560Z" fill="url(#metal)" fill-rule="evenodd"/><path d="M210 22L1230 22L1370 560L720 630L70 560Z" fill="none" stroke="#60717c" stroke-opacity=".35" stroke-width="4"/><path d="M215 30L1225 30M75 551L720 619L1365 551" stroke="#9bc6d2" stroke-opacity=".16" stroke-width="2"/><path d="M-10 230L166 173M1275 173L1450 230" stroke="#01060c" stroke-width="25"/></svg>
13
+ <div class="view-label"><span class="tiny">FORWARD OBSERVATION</span><b id="view-label">COCKPIT / PILOT SEAT</b><span class="tiny muted">DRAG WINDOW TO LOOK AROUND</span></div>
14
+ <div class="mission-callout"><div class="eyebrow"><span class="status-dot"></span> MISSION CONTROL</div><h1 id="phase">PRELAUNCH</h1><p id="context">Run preflight. Your spacecraft is standing by.</p></div>
15
+ <div class="hud" aria-label="Primary flight telemetry">
16
+ <div class="hud-reading altitude"><span>ALTITUDE <small>KM</small></span><strong id="alt">0.03</strong><i id="vs">↑ 0 M/S</i><div class="tape"></div></div>
17
+ <div class="reticle" aria-hidden="true"><div class="reticle-top">HDG <span id="heading">090</span></div><div class="pitch-ladder"><i></i><i></i><i></i></div><div class="crosshair"><span></span>⌄<span></span></div><div class="reticle-bottom">PROGRADE</div></div>
18
+ <div class="hud-reading velocity"><span>VELOCITY <small>KM/S</small></span><strong id="velocity">0.000</strong><i id="gforce">1.00 G</i><div class="tape"></div></div>
19
+ </div>
20
+ <div id="countdown" class="countdown" hidden><span>TERMINAL COUNT</span><strong>10</strong><small>IGNITION SEQUENCE ACTIVE</small></div>
21
+ <div id="completion" class="completion" hidden><span>MISSION OBJECTIVE COMPLETE</span><strong>ORBIT ACHIEVED</strong><small>The spacecraft is yours. Disengage guidance for manual flight.</small><button id="dismiss-complete">CONTINUE FREE FLIGHT →</button></div>
22
+ <div class="viewport-bottom"><div id="warnings" role="status"></div><div class="camera-selector" aria-label="Camera view">${['COCKPIT','EXTERNAL','CHASE','ORBIT','EARTH'].map((m,i)=>`<button data-camera="${m}" class="${i===0?'selected':''}" aria-pressed="${i===0}"><span>0${i+1}</span> ${m}</button>`).join('')}</div></div>
23
+ </main>
24
+ <div class="console-tabs"><button class="selected" data-tab="flight">FLIGHT DECK</button><button data-tab="systems">SYSTEMS</button><button data-tab="engineering">ENGINEERING</button></div>
25
+ <section class="console" aria-label="Spacecraft instrument console">
26
+ <section class="panel systems-panel"><div class="panel-title"><span>01 / VEHICLE SYSTEMS</span><i id="systems-count">0 / 7</i></div>
27
+ <div class="switch-grid">${SYSTEMS.map(k=>`<button class="system-switch" data-system="${k}" aria-pressed="false"><span class="switch"><i></i></span><span>${k.toUpperCase()}</span><small>OFF</small></button>`).join('')}</div>
28
+ <button id="preflight" class="prepare">RUN PREFLIGHT <span>→</span></button>
29
+ </section>
30
+ <section class="panel attitude-panel"><div class="panel-title"><span>02 / FLIGHT DIRECTOR</span><i>FD</i></div><canvas id="horizon" aria-label="Artificial horizon"></canvas><div class="attitude-values"><span>PITCH <b id="pitch">0.0°</b></span><span>ROLL <b id="roll">0.0°</b></span></div><button id="guidance" class="guidance active" aria-pressed="true"><span class="status-dot"></span> GUIDANCE <b>ENGAGED</b></button></section>
31
+ <section class="panel nav-panel"><div class="panel-title"><span>03 / ORBITAL NAVIGATION</span><i>LEO</i></div><canvas id="orbit-map" aria-label="Earth and predicted coast trajectory"></canvas><div class="orbit-values"><div><span>APOAPSIS</span><b id="apo">—</b><small>KM</small></div><div><span>PERIAPSIS</span><b id="peri">—</b><small>KM</small></div></div><div class="target-orbit">TARGET <span>180–400 KM / STABLE ORBIT</span></div></section>
32
+ <section class="panel engine-panel"><div class="panel-title"><span>04 / PROPULSION</span><i id="stage-indicator">S1</i></div><div class="propulsion-grid"><div class="engine-figure" aria-hidden="true"><div class="rocket-silhouette"></div><i></i><i></i><i></i></div><div class="engine-values"><label>THRUST <b id="thrust">0.00 <small>MN</small></b></label><label>PROPELLANT <b id="fuel">100.0 <small>%</small></b></label><div class="fuel-track"><i id="fuel-bar"></i></div><label>CHAMBER <b id="temperature">22 <small>°C</small></b></label></div></div><div class="life-support"><span>CABIN <b id="cabin">101.3</b> kPa</span><span>BUS <b id="battery">100</b>%</span></div></section>
33
+ <section class="panel control-panel"><div class="panel-title"><span>05 / FLIGHT CONTROL</span><i>MAN</i></div><div class="throttle-row"><label for="throttle">THROTTLE<b id="throttle-value">100<small>%</small></b></label><input id="throttle" type="range" min="0" max="100" value="100" aria-label="Engine throttle"/></div><div class="stick" aria-label="Attitude controls"><button data-hold="pitch:-1" aria-label="Pitch toward vertical">↑</button><div><button data-hold="yaw:-1" aria-label="Yaw left">←</button><span class="stick-knob"></span><button data-hold="yaw:1" aria-label="Yaw right">→</button></div><button data-hold="pitch:1" aria-label="Pitch toward horizon">↓</button></div><div class="roll-controls"><button data-hold="roll:-1" aria-label="Roll left">↶ ROLL</button><button data-hold="roll:1" aria-label="Roll right">ROLL ↷</button></div></section>
34
+ </section>
35
+ <section id="engineering" hidden aria-label="Engineering telemetry"><div class="panel-title">ENGINEERING / FIXED STEP 60 HZ <span>SI UNITS</span></div><pre id="engineering-data"></pre></section>
36
+ <footer class="command-bar"><div class="met"><span>MISSION ELAPSED</span><b id="met">00:00:00</b></div><div class="arm-controls"><button id="engine-arm" aria-pressed="false"><i></i> ENGINE ARM</button><button id="launch-arm" aria-pressed="false"><i></i> LAUNCH ARM</button></div><button id="launch" class="launch-button">INITIATE LAUNCH <span>↗</span></button><button id="stage" class="stage-button" disabled>STAGE <kbd>SPACE</kbd></button><button id="abort" class="abort-button">ABORT</button><label class="pace">PACE<select id="pace" aria-label="Mission time multiplier"><option value="1">1× REALTIME</option><option value="5">5×</option><option value="20" selected>20×</option><option value="50">50×</option></select></label><button id="reset" title="Reset mission">↺</button></footer>
37
+ <div class="comm-strip"><span class="comm-light"></span><b>FLIGHT LOOP</b><span id="comms">ODYSSEY, ground systems connected. You are go for preflight.</span><span class="build-label">O1 / SIMULATION</span></div>
38
+ <div id="paused" class="modal-backdrop" hidden><section class="dialog"><span class="eyebrow">FLIGHT HOLD</span><h2>Simulation paused.</h2><p>Your spacecraft state is preserved.</p><button id="resume" class="primary">RESUME FLIGHT →</button></section></div>
39
+ <dialog id="manual"><button id="close-manual" class="close-dialog" aria-label="Close manual">×</button><span class="eyebrow">PILOT BRIEFING / 001</span><h2>You have the spacecraft.</h2><p>Run preflight, arm the engine, arm launch, then initiate the ten-second countdown. Guidance flies the ascent and stages automatically.</p><div class="manual-keys"><span><kbd>W / S</kbd> Throttle</span><span><kbd>↑ / ↓</kbd> Pitch vertical / horizon</span><span><kbd>← / →</kbd> Yaw</span><span><kbd>A / D</kbd> Roll</span><span><kbd>ENTER</kbd> Launch</span><span><kbd>SPACE</kbd> Stage when available</span><span><kbd>ESC</kbd> Pause</span><span><kbd>R</kbd> Reset mission</span><span><kbd>E</kbd> Engineering telemetry</span></div><p>Manual attitude or throttle input disengages guidance. Re-engage it to recover the ascent. Staging is authorized below 10% first-stage fuel and above 1 km.</p><p>Mission pace accelerates the same fixed-step physics. Countdown stays in real time. Drag the window to look around; select another camera to observe the spacecraft or Earth.</p><small>Simplified two-stage, Earth-centered flight model. The dashed orbit is the target; the amber trace predicts an unpowered coast. Audio is synthesized locally.</small><button id="manual-ready" class="primary">RETURN TO FLIGHT DECK →</button></dialog>
40
+ <div id="renderer-error" class="renderer-error" hidden>3D rendering is unavailable on this device. Flight controls and instruments remain active.</div>
41
+ </div>`;}