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; }
|
50% { box-shadow: 0 0 0 5px rgba(127,127,127,0.12); opacity: .8; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-grid {
|
.control-columns {
|
||||||
grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||||
align-items: start;
|
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 {
|
.device-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||||
gap: 12px;
|
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 {
|
.device-card {
|
||||||
|
|
@ -206,12 +235,14 @@
|
||||||
@keyframes spin { to { transform: rotate(360deg); } }
|
@keyframes spin { to { transform: rotate(360deg); } }
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
.dashboard-grid { grid-template-columns: 1fr; }
|
.control-columns { grid-template-columns: 1fr; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 560px) {
|
@media (max-width: 560px) {
|
||||||
.selected-device { flex-direction: column; align-items: stretch; }
|
.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)); }
|
.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) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
|
|
||||||
94
index.php
94
index.php
|
|
@ -37,44 +37,48 @@ declare(strict_types=1);
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="grid dashboard-grid">
|
<section class="card devices-bar" aria-labelledby="devices-title">
|
||||||
<section class="card" aria-labelledby="devices-title">
|
<div class="card-header">
|
||||||
<div class="card-header">
|
<h2 class="section-title" id="devices-title">Discovered Devices</h2>
|
||||||
<h2 class="section-title" id="devices-title">Discovered Devices</h2>
|
<span class="badge" id="deviceCount">0</span>
|
||||||
<span class="badge" id="deviceCount">0</span>
|
</div>
|
||||||
</div>
|
<div id="scanAlert" class="alert" hidden></div>
|
||||||
<div id="scanAlert" class="alert" hidden></div>
|
<div id="devicesList" class="device-grid device-grid-compact" aria-live="polite">
|
||||||
<div id="devicesList" class="device-grid" aria-live="polite">
|
<p class="empty">No scan yet. Click <strong>Scan Network</strong> to look for devices with port 5555 open.</p>
|
||||||
<p class="empty">No scan yet. Click <strong>Scan Network</strong> to look for devices with port 5555 open.</p>
|
</div>
|
||||||
</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>
|
||||||
<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>
|
|
||||||
|
|
||||||
<section class="card" aria-labelledby="control-title">
|
<div id="controlEmpty" class="card empty">
|
||||||
<div class="card-header">
|
Select a device above to connect and send commands.
|
||||||
<h2 class="section-title" id="control-title">Remote Control</h2>
|
</div>
|
||||||
<span class="badge" id="selectedBadge">No device selected</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="controlEmpty" class="empty">
|
<div id="controlPanel" hidden>
|
||||||
Select a device from the left to connect and send commands.
|
<div class="card selected-bar">
|
||||||
</div>
|
<div class="selected-device no-margin-bottom">
|
||||||
|
<div>
|
||||||
<div id="controlPanel" hidden>
|
<p class="section-title no-margin">Selected Device</p>
|
||||||
<div class="selected-device">
|
<p class="selected-name" id="selectedName">Unknown device</p>
|
||||||
<div>
|
<p class="muted small no-margin" id="selectedIp">—</p>
|
||||||
<p class="selected-name" id="selectedName">Unknown device</p>
|
</div>
|
||||||
<p class="muted small no-margin" id="selectedIp">—</p>
|
<div class="row">
|
||||||
</div>
|
<span class="badge" id="selectedBadge">No device selected</span>
|
||||||
<div class="actions no-margin-top">
|
<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-primary button-small" id="connectBtn">Connect</button>
|
||||||
<button type="button" class="button button-danger button-small" id="disconnectBtn">Disconnect</button>
|
<button type="button" class="button button-danger button-small" id="disconnectBtn">Disconnect</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="commandAlert" class="alert" hidden></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="commandAlert" class="alert" hidden></div>
|
<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">
|
<div class="remote-section first-section">
|
||||||
<p class="section-title">Navigation</p>
|
<p class="section-title">Navigation</p>
|
||||||
<div class="remote-grid" aria-label="Directional controls">
|
<div class="remote-grid" aria-label="Directional controls">
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|
@ -114,6 +118,22 @@ declare(strict_types=1);
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="remote-section">
|
<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>
|
<p class="section-title">Command Picker</p>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="commandSelect">Choose a command</label>
|
<label for="commandSelect">Choose a command</label>
|
||||||
|
|
@ -129,7 +149,7 @@ declare(strict_types=1);
|
||||||
<p class="section-title">Batch Commands</p>
|
<p class="section-title">Batch Commands</p>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="batchInput">Paste commands (one per line)</label>
|
<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>
|
<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>
|
||||||
<div class="actions no-margin-top">
|
<div class="actions no-margin-top">
|
||||||
|
|
@ -138,22 +158,12 @@ declare(strict_types=1);
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<details class="command-log-details">
|
||||||
<summary>Command log</summary>
|
<summary>Command log</summary>
|
||||||
<pre id="commandLog" class="command-log" aria-live="polite">No commands sent yet.</pre>
|
<pre id="commandLog" class="command-log" aria-live="polite">No commands sent yet.</pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue