326 lines
9.0 KiB
HTML
326 lines
9.0 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||
<title>espScope</title>
|
||
<style>
|
||
* {
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||
background: #1a1a1a;
|
||
color: #e0e0e0;
|
||
margin: 0;
|
||
padding: 0;
|
||
height: 100vh;
|
||
/* Fallback */
|
||
height: 100dvh;
|
||
/* Mobile viewport fix */
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.container {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
width: 100%;
|
||
max-width: 100%;
|
||
}
|
||
|
||
/* Top Section: Chart (Fills available space) */
|
||
.chart-section {
|
||
flex-grow: 1;
|
||
position: relative;
|
||
background: #000;
|
||
min-height: 0;
|
||
/* Important for flex child with specific height content */
|
||
display: flex;
|
||
}
|
||
|
||
.canvas-container {
|
||
flex-grow: 1;
|
||
position: relative;
|
||
height: 100%;
|
||
width: 100%;
|
||
border: 8px solid #333;
|
||
}
|
||
|
||
canvas {
|
||
width: 100%;
|
||
height: 100%;
|
||
display: block;
|
||
}
|
||
|
||
/* Trigger Slider floating on right */
|
||
#triggerLevel {
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
height: 100%;
|
||
width: 4px;
|
||
margin: 0;
|
||
z-index: 10;
|
||
-webkit-appearance: none;
|
||
border: 1px solid #333;
|
||
/* Reset to control gradient */
|
||
appearance: none;
|
||
writing-mode: vertical-lr;
|
||
}
|
||
|
||
/* Status Text Overlay */
|
||
.status-overlay {
|
||
position: absolute;
|
||
top: 10px;
|
||
right: 20px;
|
||
pointer-events: none;
|
||
text-shadow: 1px 1px 2px black;
|
||
}
|
||
|
||
.status {
|
||
font-family: monospace;
|
||
color: #ccc;
|
||
}
|
||
|
||
#reconnectBtn {
|
||
pointer-events: auto;
|
||
margin-top: 5px;
|
||
}
|
||
|
||
/* Bottom Section: Controls */
|
||
.controls-section {
|
||
background: #2d2d2d;
|
||
padding: 10px;
|
||
padding-bottom: calc(10px + env(safe-area-inset-bottom));
|
||
/* iOS Home Bar fix */
|
||
border-top: 1px solid #444;
|
||
flex-shrink: 0;
|
||
z-index: 20;
|
||
}
|
||
|
||
.controls {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
/* gap: 15px; */
|
||
justify-content: space-around;
|
||
flex-wrap: nowrap;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
.control-group {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
gap: 5px;
|
||
white-space: nowrap;
|
||
margin-right: 15px;
|
||
}
|
||
|
||
label {
|
||
font-size: 0.85em;
|
||
color: #bbb;
|
||
margin-right: 4px;
|
||
}
|
||
|
||
input,
|
||
select {
|
||
background: #3d3d3d;
|
||
border: 1px solid #555;
|
||
color: white;
|
||
border-radius: 4px;
|
||
padding: 6px;
|
||
font-size: 0.9em;
|
||
width: 5em;
|
||
}
|
||
|
||
select {
|
||
width: auto;
|
||
}
|
||
|
||
/* Buttons Group */
|
||
.btn-group {
|
||
display: flex;
|
||
gap: 8px;
|
||
margin-left: auto;
|
||
}
|
||
|
||
button {
|
||
background: #4ade80;
|
||
color: #1a1a1a;
|
||
border: none;
|
||
padding: 8px 12px;
|
||
border-radius: 4px;
|
||
font-weight: bold;
|
||
cursor: pointer;
|
||
white-space: nowrap;
|
||
font-size: 0.9em;
|
||
}
|
||
|
||
button:hover {
|
||
background: #22c55e;
|
||
}
|
||
|
||
button.secondary {
|
||
background: #444;
|
||
color: #ccc;
|
||
}
|
||
|
||
#deltaPanel {
|
||
position: absolute;
|
||
background: rgba(45, 45, 45, 0.9);
|
||
color: #e0e0e0;
|
||
padding: 5px 10px;
|
||
border-radius: 4px;
|
||
pointer-events: none;
|
||
display: none;
|
||
z-index: 50;
|
||
}
|
||
|
||
/* Modal Styles */
|
||
.modal {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background: rgba(0, 0, 0, 0.8);
|
||
z-index: 1000;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.modal-content {
|
||
background: #2d2d2d;
|
||
padding: 20px;
|
||
border-radius: 8px;
|
||
width: 300px;
|
||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
|
||
}
|
||
|
||
.modal-header {
|
||
font-size: 1.2em;
|
||
margin-bottom: 15px;
|
||
color: #4ade80;
|
||
}
|
||
|
||
.form-group {
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.form-group label {
|
||
width: 100%;
|
||
display: block;
|
||
margin-bottom: 5px;
|
||
}
|
||
|
||
.form-group input {
|
||
width: 100%;
|
||
}
|
||
|
||
.modal-actions {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 10px;
|
||
}
|
||
</style>
|
||
</head>
|
||
|
||
<body>
|
||
<div class="container">
|
||
<!-- Top Section: Chart -->
|
||
<div class="chart-section">
|
||
<div class="canvas-container">
|
||
<canvas id="adcChart"></canvas>
|
||
</div>
|
||
|
||
<!-- Floating Trigger Slider -->
|
||
<input type="range" id="triggerLevel" orient="vertical" min="-1" max="4097" value="2048">
|
||
|
||
<!-- Overlay Status -->
|
||
<div class="status-overlay">
|
||
<div class="status" id="trigger-status"></div>
|
||
<div class="status" id="status">Connecting...</div>
|
||
<button id="reconnectBtn"
|
||
style="display:none; background:#eab308; color:#000; padding:4px 8px; font-size:0.8rem;">Reconnect</button>
|
||
<div class="info" id="info"></div>
|
||
</div>
|
||
|
||
<!-- Mouseover Info Tooltip -->
|
||
<div id="deltaPanel"></div>
|
||
</div>
|
||
|
||
<!-- Bottom Section: Controls -->
|
||
<div class="controls-section">
|
||
<div class="controls">
|
||
|
||
<div class="control-group">
|
||
<label>Rate(Hz)</label>
|
||
<input type="number" id="sampleRate" value="20000" min="20000" max="2000000">
|
||
</div>
|
||
|
||
<div class="control-group" style="display: none;">
|
||
<label>BitWidth</label>
|
||
<select id="bitWidth">
|
||
<option value="12" selected>12</option>
|
||
<option value="11">11</option>
|
||
<option value="10">10</option>
|
||
<option value="9">9</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="control-group">
|
||
<label>Atten</label>
|
||
<select id="atten">
|
||
<option value="0">0dB (0–1.0V)</option>
|
||
<option value="1">2.5dB (0–1.34V)</option>
|
||
<option value="2">6dB (0–2.0V)</option>
|
||
<option value="3" selected>11dB (0–3.6V)</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="control-group">
|
||
<label>TestHz</label>
|
||
<input type="number" id="testHz" value="100" min="1" max="10000">
|
||
</div>
|
||
|
||
<div class="btn-group">
|
||
<button title="Reset to default rate, attenuation & test settings" id="resetBtn"
|
||
class="secondary">↺</button>
|
||
<button title="Change wifi access point" id="wifiBtn" class="secondary">🛜</button>
|
||
<button title="Power off the esp-scope" id="powerOff" class="secondary">⚡</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Wifi Modal -->
|
||
<div id="wifiModal" class="modal">
|
||
<div class="modal-content">
|
||
<div class="modal-header">Configure Wi-Fi</div>
|
||
<div class="form-group">
|
||
<label>SSID</label>
|
||
<input type="text" id="wifiSsid" placeholder="Network Name">
|
||
</div>
|
||
<div class="form-group">
|
||
<label>Password</label>
|
||
<input type="password" id="wifiPass" placeholder="Password">
|
||
</div>
|
||
<div class="modal-actions">
|
||
<button id="closeWifi" style="background:#555; color:#fff;">Cancel</button>
|
||
<button id="saveWifi">Save</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="index.js"></script>
|
||
</body>
|
||
|
||
</html> |