Skip to content

Commit d57bfda

Browse files
lifeartclaude
andcommitted
Improve markup and styling consistency
- Extract 14+ repeated inline checkbox label styles into .checkbox-label class - Move inline font-size:13px from ~15 summary elements into CSS rule - Add textarea to global input styling rule for consistent theming - Remove redundant .section-group > summary duplicate styles - Simplify padding:10px 10px to padding:10px - Add left/right safe-area insets for landscape notch devices - Extend touch target media query to cover range inputs and checkboxes - Extract stereo indicator color into .indicator-ok CSS class - Remove redundant inline styles on heatmap labels (match base label rule) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3411b2f commit d57bfda

2 files changed

Lines changed: 44 additions & 47 deletions

File tree

index.html

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ <h1>Echoscope — Browser Sonar</h1>
4747
<span class="small">Mic</span>
4848
<canvas id="levelMeter" width="200" height="16" role="img" aria-label="Audio input level meter"></canvas>
4949
<span class="small" id="levelDb"></span>
50-
<span id="stereoIndicator" class="small" style="display:none; color:#4caf50;"></span>
50+
<span id="stereoIndicator" class="small indicator-ok" style="display:none;"></span>
5151
</div>
5252

5353
<p class="hint warn">
5454
Run on <b>https</b> (or localhost). Keep volume low to avoid feedback. On iPhone, tap buttons to start/resume audio.
5555
</p>
5656

5757
<details id="quickSetup" class="section-group" open>
58-
<summary style="font-size:13px">Quick setup</summary>
58+
<summary>Quick setup</summary>
5959

6060
<div class="row">
6161
<div>
@@ -92,7 +92,7 @@ <h1>Echoscope — Browser Sonar</h1>
9292
</select>
9393
</div>
9494
<div>
95-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
95+
<label class="checkbox-label">
9696
<input id="presetApplyScan" type="checkbox" title="Also apply recommended scan parameters when a laptop preset is selected.">
9797
Also apply scan settings
9898
</label>
@@ -101,7 +101,7 @@ <h1>Echoscope — Browser Sonar</h1>
101101
<p class="hint">Presets set speaker spacing and mic position for known devices. Your selection is remembered across sessions.</p>
102102

103103
<details class="section-group" style="margin-top:10px">
104-
<summary style="font-size:13px">Scan parameters</summary>
104+
<summary>Scan parameters</summary>
105105

106106
<div class="row" style="margin-top:10px">
107107
<div>
@@ -146,7 +146,7 @@ <h1>Echoscope — Browser Sonar</h1>
146146
</details>
147147

148148
<details id="probeSettings" class="section-group" style="margin-top:10px">
149-
<summary style="font-size:13px">Probe parameters</summary>
149+
<summary>Probe parameters</summary>
150150
<p class="hint" style="margin:6px 0 0">Tune probe parameters only when you need higher quality or speed.</p>
151151

152152
<div id="chirpBox" style="margin-top:10px">
@@ -327,13 +327,13 @@ <h1>Echoscope — Browser Sonar</h1>
327327
</div>
328328
<div class="row" style="margin-top:8px">
329329
<div>
330-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
330+
<label class="checkbox-label">
331331
<input id="multiplexUseCalibrated" type="checkbox" checked title="Use carrier set selected by prior calibration if available.">
332332
Use calibrated carriers
333333
</label>
334334
</div>
335335
<div>
336-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
336+
<label class="checkbox-label">
337337
<input id="multiplexFallbackToChirp" type="checkbox" checked title="Fallback to chirp probe when multiplex confidence is too low.">
338338
Fallback to chirp on low confidence
339339
</label>
@@ -344,7 +344,7 @@ <h1>Echoscope — Browser Sonar</h1>
344344
</details>
345345

346346
<details class="section-group" style="margin-top:10px">
347-
<summary style="font-size:13px">Advanced</summary>
347+
<summary>Advanced</summary>
348348
<div class="row" style="margin-top:10px">
349349
<div>
350350
<label for="spacing" title="Distance between L/R speakers. Steering delay &amp; TDOA gating depend on this. Must be > 0.02 m.">Speaker spacing d (m)</label>
@@ -369,13 +369,13 @@ <h1>Echoscope — Browser Sonar</h1>
369369
</details>
370370

371371
<details id="expertSettings" class="section-group" style="margin-top:10px">
372-
<summary style="font-size:13px">Expert scan &amp; tracking</summary>
372+
<summary>Expert scan &amp; tracking</summary>
373373

374374
<details style="margin-top:10px">
375-
<summary style="font-size:13px">Microphone spectrogram</summary>
375+
<summary>Microphone spectrogram</summary>
376376
<div class="row" style="margin-top:10px">
377377
<div>
378-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
378+
<label class="checkbox-label">
379379
<input id="spectrogramEnabled" type="checkbox" checked title="Enable real-time microphone spectrogram view.">
380380
Enable spectrogram
381381
</label>
@@ -404,7 +404,7 @@ <h1>Echoscope — Browser Sonar</h1>
404404
</details>
405405

406406
<details style="margin-top:10px">
407-
<summary style="font-size:13px">Advanced scan settings</summary>
407+
<summary>Advanced scan settings</summary>
408408
<div class="row" style="margin-top:10px">
409409
<div>
410410
<label for="strengthGate" title="Min correlation strength to report target. 0-1. Lower = more sensitive but noisier.">Min strength gate</label>
@@ -419,7 +419,7 @@ <h1>Echoscope — Browser Sonar</h1>
419419
<input id="cfarPfa" type="number" step="0.0005" min="0.000001" max="0.5" value="0.001" title="Cell-averaging CFAR false-alarm probability used for detection thresholding.">
420420
</div>
421421
<div>
422-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
422+
<label class="checkbox-label">
423423
<input id="scanClutterOn" type="checkbox" checked title="Enable static clutter suppression across scan frames.">
424424
Suppress static reflections
425425
</label>
@@ -465,7 +465,7 @@ <h1>Echoscope — Browser Sonar</h1>
465465
<input id="continuityBins" type="number" step="1" min="1" max="64" value="8" title="Maximum allowed peak-bin mismatch for continuity checks.">
466466
</div>
467467
<div>
468-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Enable adaptive auto-quality with hysteresis.">
468+
<label class="checkbox-label" title="Enable adaptive auto-quality with hysteresis.">
469469
<input id="adaptiveQualityOn" type="checkbox" checked title="Automatically switch quality mode based on signal conditions.">
470470
Adaptive auto quality
471471
</label>
@@ -478,7 +478,7 @@ <h1>Echoscope — Browser Sonar</h1>
478478

479479
<div class="row" style="margin-top:10px">
480480
<div>
481-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Back off subtraction when profile collapses too much.">
481+
<label class="checkbox-label" title="Back off subtraction when profile collapses too much.">
482482
<input id="subtractionBackoffOn" type="checkbox" checked title="Reduce subtraction automatically when profile collapse is detected.">
483483
Subtraction self-limiting
484484
</label>
@@ -495,7 +495,7 @@ <h1>Echoscope — Browser Sonar</h1>
495495

496496
<div class="row" style="margin-top:10px">
497497
<div>
498-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Use Kalman-estimated per-bin noise floor during scanning.">
498+
<label class="checkbox-label" title="Use Kalman-estimated per-bin noise floor during scanning.">
499499
<input id="noiseKalmanEnabled" type="checkbox" checked title="Enable per-bin noise-floor Kalman subtraction.">
500500
Noise-floor Kalman
501501
</label>
@@ -513,7 +513,7 @@ <h1>Echoscope — Browser Sonar</h1>
513513
<input id="noiseKalmanStrength" type="number" step="0.05" min="0" max="1.5" value="0.55" title="Strength of noise-floor subtraction.">
514514
</div>
515515
<div>
516-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Freeze Kalman floor updates on confident detections to avoid target swallowing.">
516+
<label class="checkbox-label" title="Freeze Kalman floor updates on confident detections to avoid target swallowing.">
517517
<input id="noiseKalmanFreezeHighConf" type="checkbox" checked title="Freeze noise-floor update when confidence is high.">
518518
Freeze on high confidence
519519
</label>
@@ -534,7 +534,7 @@ <h1>Echoscope — Browser Sonar</h1>
534534

535535
<div class="row" style="margin-top:10px">
536536
<div>
537-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Attenuate near-field bins where laptop display multipath often dominates.">
537+
<label class="checkbox-label" title="Attenuate near-field bins where laptop display multipath often dominates.">
538538
<input id="displayBlankingOn" type="checkbox" title="Enable near-field attenuation window to suppress display-related reflections.">
539539
Display reflection blanking
540540
</label>
@@ -587,10 +587,10 @@ <h1>Echoscope — Browser Sonar</h1>
587587
</div>
588588

589589
<details style="margin-top:10px">
590-
<summary style="font-size:13px">Virtual array (SAFT/DAS)</summary>
590+
<summary>Virtual array (SAFT/DAS)</summary>
591591
<div class="row" style="margin-top:10px">
592592
<div>
593-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Coherently combine neighboring steering angles to synthesize a larger aperture.">
593+
<label class="checkbox-label" title="Coherently combine neighboring steering angles to synthesize a larger aperture.">
594594
<input id="vaEnabled" type="checkbox" title="Enable synthetic aperture focusing by combining neighboring angle rows.">
595595
Enable SAFT/DAS
596596
</label>
@@ -619,7 +619,7 @@ <h1>Echoscope — Browser Sonar</h1>
619619
<div class="pill"><span id="bestReadout">Best: &#x2014;</span></div>
620620
<div class="pill"><span id="dirReadout">Direction: &#x2014;</span></div>
621621
<div class="pill" id="pingStats" style="display:none"></div>
622-
<label style="display:flex; align-items:center; gap:8px; margin:0;">
622+
<label class="checkbox-label">
623623
<input id="showTrace" type="checkbox" checked title="Overlay current best-target trajectory on the heatmap/geometry views.">
624624
Show best-target trace
625625
</label>
@@ -632,18 +632,18 @@ <h1>Echoscope — Browser Sonar</h1>
632632
<!-- Calibration -->
633633
<p class="hint">Calibration measures speaker-to-mic distances to lock direct-path timing and improve range accuracy.</p>
634634
<div class="row" style="justify-content:space-between">
635-
<label style="display:flex; align-items:center; gap:8px; margin:0;">
635+
<label class="checkbox-label">
636636
<input id="useCalib" type="checkbox" checked title="Use calibration data to constrain direct-path search and reduce ambiguity.">
637637
Use calibration to lock direct-path search
638638
</label>
639-
<label style="display:flex; align-items:center; gap:8px; margin:0;">
639+
<label class="checkbox-label">
640640
<input id="useMultiband" type="checkbox" checked title="Use multiple frequency bands during calibration for more robust lock.">
641641
Multiband calibration
642642
</label>
643643
</div>
644644

645645
<details style="margin-top:10px">
646-
<summary style="font-size:13px">Advanced calibration settings</summary>
646+
<summary>Advanced calibration settings</summary>
647647
<div class="row" style="margin-top:10px">
648648
<div>
649649
<label for="calRepeats" title="Independent L/R measurement pairs. 1-9. More = more robust.">Calibration repeats (N)</label>
@@ -662,13 +662,13 @@ <h1>Echoscope — Browser Sonar</h1>
662662
<input id="envBaselineStrength" type="number" step="0.05" min="0" max="1.2" value="0.55" title="Strength of environmental baseline subtraction.">
663663
</div>
664664
<div>
665-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;">
665+
<label class="checkbox-label">
666666
<input id="useEnvBaseline" type="checkbox" checked title="Capture ambient baseline and subtract static room reflections during calibration.">
667667
Use env baseline
668668
</label>
669669
</div>
670670
<div>
671-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Also apply Kalman noise-floor filtering while collecting calibration baseline pings.">
671+
<label class="checkbox-label" title="Also apply Kalman noise-floor filtering while collecting calibration baseline pings.">
672672
<input id="noiseKalmanUseInCalibration" type="checkbox" title="Enable Kalman filtering during baseline calibration pings.">
673673
Kalman in calibration
674674
</label>
@@ -677,7 +677,7 @@ <h1>Echoscope — Browser Sonar</h1>
677677
</details>
678678

679679
<details id="diagnostics" class="section-group" style="margin-top:12px;">
680-
<summary style="font-size:13px">Diagnostics</summary>
680+
<summary>Diagnostics</summary>
681681

682682
<details id="sanityDetails" style="margin-top:12px;">
683683
<summary>Calibration sanity view</summary>
@@ -700,7 +700,7 @@ <h1>Echoscope — Browser Sonar</h1>
700700
</details>
701701

702702
<details id="peerSection" style="margin-top:12px;">
703-
<summary style="font-size:13px">Network / Peers</summary>
703+
<summary>Network / Peers</summary>
704704
<p class="hint">Connect two devices via WebRTC. One creates an offer, the other accepts.</p>
705705

706706
<div class="row" style="margin-top:8px">
@@ -710,7 +710,7 @@ <h1>Echoscope — Browser Sonar</h1>
710710
</div>
711711

712712
<div class="row" style="margin-top:8px; align-items:flex-end;">
713-
<label style="display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:#bdbdbd;" title="Use connected peer microphones as additional channels during ping/scan.">
713+
<label class="checkbox-label" title="Use connected peer microphones as additional channels during ping/scan.">
714714
<input id="distributedEnabled" type="checkbox">
715715
Use remote captures in ping/scan
716716
</label>
@@ -728,7 +728,7 @@ <h1>Echoscope — Browser Sonar</h1>
728728

729729
<div id="peerSignalBox" style="display:none; margin-top:10px;">
730730
<label id="peerSignalLabel" for="peerSignalText">Signal:</label>
731-
<textarea id="peerSignalText" class="mono" rows="3" title="Paste incoming signaling payload here, or copy the generated payload to send to another device." style="width:100%; font-size:11px; background:#111; color:#eee; border:1px solid #333; border-radius:6px; padding:6px; resize:vertical;"></textarea>
731+
<textarea id="peerSignalText" class="mono" rows="3" title="Paste incoming signaling payload here, or copy the generated payload to send to another device."></textarea>
732732
<div class="row" style="margin-top:6px">
733733
<button id="btnPeerCopySignal" title="Copy the current signaling payload to clipboard.">Copy</button>
734734
<button id="btnPeerApplySignal" style="display:none" title="Apply the pasted signaling payload and continue the handshake.">Apply</button>
@@ -767,13 +767,13 @@ <h1>Echoscope — Browser Sonar</h1>
767767
</div>
768768

769769
<details id="heatmapDetails" open style="margin-top:10px">
770-
<summary style="font-size:13px">Angle x Range heatmap</summary>
770+
<summary>Angle x Range heatmap</summary>
771771
<p class="hint" style="margin:4px 0 8px">
772772
Main scan view: bright spots show stronger reflections by angle and range.
773773
</p>
774774
<canvas id="heatmap" width="1000" height="520" role="img" aria-label="Angle versus range heatmap showing echo strength"></canvas>
775775
<div class="row" style="margin-top:6px;display:flex;gap:12px;align-items:center;flex-wrap:wrap">
776-
<label style="font-size:12px;color:#bdbdbd">Colormap
776+
<label>Colormap
777777
<select id="colormapSelect" title="Choose color mapping for heatmap intensity rendering.">
778778
<option value="inferno" selected>Inferno</option>
779779
<option value="viridis">Viridis</option>
@@ -783,22 +783,22 @@ <h1>Echoscope — Browser Sonar</h1>
783783
<label style="font-size:12px;color:#bdbdbd;display:flex;align-items:center;gap:4px">
784784
<input id="heatmapDbScaleOn" type="checkbox" title="Display heatmap values on logarithmic dB scale."> dB scale
785785
</label>
786-
<label style="font-size:12px;color:#bdbdbd">Dynamic range (dB)
786+
<label>Dynamic range (dB)
787787
<input id="heatmapDynamicRangeDb" type="number" step="5" min="10" max="120" value="40" title="Dynamic range window in dB; lower values increase contrast for weak echoes." style="width:50px">
788788
</label>
789789
</div>
790790
</details>
791791

792792
<details id="profileDetails" style="margin-top:10px">
793-
<summary style="font-size:13px">Range profile</summary>
793+
<summary>Range profile</summary>
794794
<p class="hint" style="margin:4px 0 8px">
795795
Correlation vs range for the latest ping/scan row.
796796
</p>
797797
<canvas id="profile" width="1000" height="260" role="img" aria-label="Correlation profile showing echo strength vs range"></canvas>
798798
</details>
799799

800800
<details id="micSpectrogramDetails" style="margin-top:10px">
801-
<summary style="font-size:13px">Microphone spectrogram</summary>
801+
<summary>Microphone spectrogram</summary>
802802
<p class="hint" style="margin:4px 0 8px">
803803
Real-time STFT waterfall of microphone input. After successful calibration it shows filtered (noise-floor suppressed) spectrum.
804804
</p>
@@ -809,13 +809,13 @@ <h1>Echoscope — Browser Sonar</h1>
809809
</details>
810810

811811
<details id="geometryDetails" style="margin-top:10px">
812-
<summary style="font-size:13px">Geometry view</summary>
812+
<summary>Geometry view</summary>
813813
<p class="hint" style="margin:4px 0 8px">
814814
Device layout and target position estimate in top view.
815815
</p>
816816
<canvas id="geometry" width="1000" height="280" role="img" aria-label="Geometry view showing speaker and microphone positions"></canvas>
817817
<div class="row" style="margin-top:8px">
818-
<label style="display:flex; align-items:center; gap:8px; margin:0;">
818+
<label class="checkbox-label">
819819
<input id="geomWizardOn" type="checkbox" title="Enable interactive geometry editing by dragging handles on the geometry plot.">
820820
Geometry wizard
821821
</label>

0 commit comments

Comments
 (0)