Restructure UI: compact device bar on top, controls/commands split below
This commit is contained in:
parent
2414409d49
commit
5db99a713b
2 changed files with 87 additions and 46 deletions
|
|
@ -45,16 +45,45 @@
|
|||
50% { box-shadow: 0 0 0 5px rgba(127,127,127,0.12); opacity: .8; }
|
||||
}
|
||||
|
||||
.dashboard-grid {
|
||||
grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
|
||||
.control-columns {
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.devices-bar .hint-foot { margin-top: 10px; }
|
||||
|
||||
.selected-bar { padding: 14px 16px; }
|
||||
.no-margin-bottom { margin-bottom: 0 !important; }
|
||||
.first-section { margin-top: 0 !important; }
|
||||
|
||||
.device-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 12px;
|
||||
min-height: 120px;
|
||||
min-height: 72px;
|
||||
}
|
||||
|
||||
.device-grid-compact {
|
||||
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.device-grid-compact .device-card {
|
||||
padding: 10px 12px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.device-grid-compact .device-name {
|
||||
font-size: .88rem;
|
||||
}
|
||||
|
||||
.device-grid-compact .device-ip {
|
||||
font-size: .74rem;
|
||||
}
|
||||
|
||||
.device-grid-compact .device-meta .badge {
|
||||
font-size: .65rem;
|
||||
padding: 1px 6px;
|
||||
}
|
||||
|
||||
.device-card {
|
||||
|
|
@ -206,12 +235,14 @@
|
|||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.dashboard-grid { grid-template-columns: 1fr; }
|
||||
.control-columns { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.selected-device { flex-direction: column; align-items: stretch; }
|
||||
.selected-bar .row { flex-direction: column; align-items: stretch; }
|
||||
.remote-grid { grid-template-columns: repeat(3, minmax(56px, 72px)); }
|
||||
.device-grid-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
|
|
|||
62
index.php
62
index.php
|
|
@ -37,44 +37,48 @@ declare(strict_types=1);
|
|||
</div>
|
||||
</header>
|
||||
|
||||
<div class="grid dashboard-grid">
|
||||
<section class="card" aria-labelledby="devices-title">
|
||||
<section class="card devices-bar" aria-labelledby="devices-title">
|
||||
<div class="card-header">
|
||||
<h2 class="section-title" id="devices-title">Discovered Devices</h2>
|
||||
<span class="badge" id="deviceCount">0</span>
|
||||
</div>
|
||||
<div id="scanAlert" class="alert" hidden></div>
|
||||
<div id="devicesList" class="device-grid" aria-live="polite">
|
||||
<div id="devicesList" class="device-grid device-grid-compact" aria-live="polite">
|
||||
<p class="empty">No scan yet. Click <strong>Scan Network</strong> to look for devices with port 5555 open.</p>
|
||||
</div>
|
||||
<p class="muted small hint-foot">Discovery probes TCP port 5555 and reads device name via local network lookup (no <code>adb connect</code> until you press Connect).</p>
|
||||
</section>
|
||||
|
||||
<section class="card" aria-labelledby="control-title">
|
||||
<div class="card-header">
|
||||
<h2 class="section-title" id="control-title">Remote Control</h2>
|
||||
<span class="badge" id="selectedBadge">No device selected</span>
|
||||
</div>
|
||||
|
||||
<div id="controlEmpty" class="empty">
|
||||
Select a device from the left to connect and send commands.
|
||||
<div id="controlEmpty" class="card empty">
|
||||
Select a device above to connect and send commands.
|
||||
</div>
|
||||
|
||||
<div id="controlPanel" hidden>
|
||||
<div class="selected-device">
|
||||
<div class="card selected-bar">
|
||||
<div class="selected-device no-margin-bottom">
|
||||
<div>
|
||||
<p class="section-title no-margin">Selected Device</p>
|
||||
<p class="selected-name" id="selectedName">Unknown device</p>
|
||||
<p class="muted small no-margin" id="selectedIp">—</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="badge" id="selectedBadge">No device selected</span>
|
||||
<div class="actions no-margin-top">
|
||||
<button type="button" class="button button-primary button-small" id="connectBtn">Connect</button>
|
||||
<button type="button" class="button button-danger button-small" id="disconnectBtn">Disconnect</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="commandAlert" class="alert" hidden></div>
|
||||
</div>
|
||||
|
||||
<div class="remote-section">
|
||||
<div class="grid control-columns">
|
||||
<section class="card" aria-labelledby="controls-title">
|
||||
<div class="card-header">
|
||||
<h2 class="section-title" id="controls-title">Controls</h2>
|
||||
</div>
|
||||
|
||||
<div class="remote-section first-section">
|
||||
<p class="section-title">Navigation</p>
|
||||
<div class="remote-grid" aria-label="Directional controls">
|
||||
<span></span>
|
||||
|
|
@ -114,6 +118,22 @@ declare(strict_types=1);
|
|||
</div>
|
||||
|
||||
<div class="remote-section">
|
||||
<p class="section-title">Send Text</p>
|
||||
<form id="textForm" class="input-group" autocomplete="off">
|
||||
<label class="sr-only" for="textInput">Text to send</label>
|
||||
<input id="textInput" type="text" maxlength="200" placeholder="Type text to send to device…" inputmode="text">
|
||||
<button type="submit" class="button button-primary">Send</button>
|
||||
</form>
|
||||
<p class="hint">Uses <code>adb shell input text</code>. Basic ASCII characters work best.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card" aria-labelledby="commands-title">
|
||||
<div class="card-header">
|
||||
<h2 class="section-title" id="commands-title">Commands</h2>
|
||||
</div>
|
||||
|
||||
<div class="remote-section first-section">
|
||||
<p class="section-title">Command Picker</p>
|
||||
<div class="field">
|
||||
<label for="commandSelect">Choose a command</label>
|
||||
|
|
@ -129,7 +149,7 @@ declare(strict_types=1);
|
|||
<p class="section-title">Batch Commands</p>
|
||||
<div class="field">
|
||||
<label for="batchInput">Paste commands (one per line)</label>
|
||||
<textarea id="batchInput" rows="5" placeholder="KEYCODE_HOME KEYCODE_DPAD_DOWN KEYCODE_DPAD_CENTER"></textarea>
|
||||
<textarea id="batchInput" rows="6" placeholder="KEYCODE_HOME KEYCODE_DPAD_DOWN KEYCODE_DPAD_CENTER"></textarea>
|
||||
<p class="hint">Runs keycodes in order, one per line. Lines starting with <code>#</code> and empty lines are ignored. Only whitelisted keycodes are accepted.</p>
|
||||
</div>
|
||||
<div class="actions no-margin-top">
|
||||
|
|
@ -138,24 +158,14 @@ declare(strict_types=1);
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="remote-section">
|
||||
<p class="section-title">Send Text</p>
|
||||
<form id="textForm" class="input-group" autocomplete="off">
|
||||
<label class="sr-only" for="textInput">Text to send</label>
|
||||
<input id="textInput" type="text" maxlength="200" placeholder="Type text to send to device…" inputmode="text">
|
||||
<button type="submit" class="button button-primary">Send</button>
|
||||
</form>
|
||||
<p class="hint">Uses <code>adb shell input text</code>. Basic ASCII characters work best.</p>
|
||||
</div>
|
||||
|
||||
<details class="command-log-details">
|
||||
<summary>Command log</summary>
|
||||
<pre id="commandLog" class="command-log" aria-live="polite">No commands sent yet.</pre>
|
||||
</details>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="assets/app.js" defer></script>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue