Files
intercept/templates/partials/modes/wifi_locate.html
Smittix e687862043 feat: UI/UX overhaul — CSS cleanup, accessibility, error handling, inline style extraction
Phase 0 — CSS-only fixes:
- Fix --font-mono to use real monospace stack (JetBrains Mono, Fira Code, etc.)
- Replace hardcoded hex colors with CSS variables across 16+ files
- Merge global-nav.css (507 lines) into layout.css, delete original
- Reduce !important in responsive.css from 71 to 8 via .app-shell specificity
- Standardize breakpoints to 480/768/1024/1280px

Phase 1 — Loading states & SSE connection feedback:
- Add centralized SSEManager (sse-manager.js) with exponential backoff
- Add SSE status indicator dot in nav bar
- Add withLoadingButton() + .btn-loading CSS spinner
- Add mode section crossfade transitions

Phase 2 — Accessibility:
- Add aria-labels to icon-only buttons across mode partials
- Add for/id associations to 42 form labels in 5 mode partials
- Add aria-live on toast stack, enableListKeyNav() utility

Phase 3 — Destructive action guards & list overflow:
- Add confirmAction() styled modal, replace all 25 native confirm() calls
- Add toast cap at 5 simultaneous toasts
- Add list overflow indicator CSS

Phase 4 — Inline style extraction:
- Refactor switchMode() in app.js and index.html to use classList.toggle()
- Add CSS toggle rules for all switchMode-controlled elements
- Remove inline style="display:none" from 7+ HTML elements
- Add utility classes (.hidden, .d-flex, .d-grid, etc.)

Phase 5 — Mobile UX polish:
- pre/code overflow handling already in place
- Touch target sizing via --touch-min variable

Phase 6 — Error handling consistency:
- Add reportActionableError() to user-facing catch blocks in 5 mode JS files
- 28 error toast additions alongside existing console.error calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:04:36 +00:00

67 lines
3.6 KiB
HTML

<!-- WIFI LOCATE MODE -->
<div id="wflMode" class="mode-content">
<div class="section">
<h3>WiFi Locate</h3>
<p class="info-text" style="font-size: 11px; color: var(--text-dim); margin-bottom: 12px;">
Locate a WiFi access point by BSSID &mdash; real-time signal strength meter with proximity audio.
</p>
</div>
<!-- Target Lock -->
<div class="section">
<h3>Target</h3>
<div id="wflHandoffCard" style="display: none; background: rgba(0,255,136,0.08); border: 1px solid rgba(0,255,136,0.3); border-radius: 6px; padding: 8px; margin-bottom: 8px;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 10px; color: var(--accent-green); text-transform: uppercase; font-weight: 600;">Handed off from WiFi</span>
<button onclick="WiFiLocate.clearHandoff()" aria-label="Clear handoff" style="background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 10px;">&times;</button>
</div>
<div id="wflHandoffName" style="font-size: 12px; font-weight: 600; color: var(--text-primary); margin-top: 4px;"></div>
<div id="wflHandoffMeta" style="font-size: 10px; color: var(--text-dim); font-family: var(--font-mono);"></div>
</div>
<label class="input-label">BSSID (MAC Address)</label>
<input type="text" id="wflBssid" class="text-input" placeholder="AA:BB:CC:DD:EE:FF" style="font-family: var(--font-mono); font-size: 11px;">
</div>
<!-- Environment Preset -->
<div class="section">
<h3>Environment</h3>
<div class="wfl-env-grid">
<button class="wfl-env-btn" data-env="FREE_SPACE" onclick="WiFiLocate.setEnvironment('FREE_SPACE')">
<span class="wfl-env-icon">&#127968;</span>
<span class="wfl-env-label">Open Field</span>
<span class="wfl-env-n">n=2.0</span>
</button>
<button class="wfl-env-btn active" data-env="OUTDOOR" onclick="WiFiLocate.setEnvironment('OUTDOOR')">
<span class="wfl-env-icon">&#127795;</span>
<span class="wfl-env-label">Outdoor</span>
<span class="wfl-env-n">n=2.8</span>
</button>
<button class="wfl-env-btn" data-env="INDOOR" onclick="WiFiLocate.setEnvironment('INDOOR')">
<span class="wfl-env-icon">&#127970;</span>
<span class="wfl-env-label">Indoor</span>
<span class="wfl-env-n">n=3.5</span>
</button>
</div>
</div>
<!-- Info note -->
<div class="section">
<p class="info-text" style="font-size: 10px; color: var(--text-dim);">
Deep scan recommended for continuous RSSI tracking. Will auto-start if not running.
</p>
</div>
<!-- Controls -->
<div class="section">
<div style="display: flex; gap: 6px;">
<button class="run-btn" id="wflStartBtn" onclick="WiFiLocate.start()">Start Locate</button>
<button class="stop-btn" id="wflStopBtn" onclick="WiFiLocate.stop()" style="display: none;">Stop</button>
</div>
<div id="wflScanStatus" style="display: none; margin-top: 6px; font-size: 10px; color: var(--text-dim);">
<span id="wflScanDot" style="display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; margin-right: 4px; vertical-align: middle;"></span>
<span id="wflScanText">WiFi scanner active</span>
</div>
</div>
</div>