privatedrop/web/index.html
2026-06-19 13:31:43 +08:00

104 lines
4.4 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Internal Drop</title>
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<main class="app-shell">
<header class="topbar">
<div class="brand-block">
<img class="brand-mark" src="/icon.svg" alt="" aria-hidden="true">
<div class="brand-copy">
<span class="product-kicker">LAN transfer</span>
<h1>Internal Drop</h1>
</div>
</div>
<nav class="utility-nav" aria-label="工具面板">
<button class="panel-toggle" type="button" data-panel="peersPanel" aria-expanded="false">成员 <span id="peerCount">0</span></button>
<button class="panel-toggle" type="button" data-panel="textPanel" aria-expanded="false">文字</button>
<button class="panel-toggle" type="button" data-panel="activityPanel" aria-expanded="false">状态</button>
<button class="panel-toggle" type="button" data-panel="identityPanel" aria-expanded="false">我的 ID</button>
<button class="panel-toggle" type="button" data-panel="serverPanel" aria-expanded="false">服务器</button>
</nav>
<div id="connectionState" class="state">连接中</div>
</header>
<section class="drop-stage" aria-label="文件投放区">
<div class="selected-peer" id="selectedPeer">未选择接收方</div>
<button id="dropZone" class="drop-zone" type="button" aria-label="选择或拖入文件发送" aria-describedby="dropHint">
<span class="drop-ring" aria-hidden="true"></span>
<span class="drop-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="none">
<path d="M12 15V4m0 0 4.5 4.5M12 4 7.5 8.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5 14.5v2.8A2.7 2.7 0 0 0 7.7 20h8.6a2.7 2.7 0 0 0 2.7-2.7v-2.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
</svg>
</span>
<span id="dropHint">选择在线成员后,把文件拖到这里,或点击选择文件</span>
</button>
<input id="fileInput" type="file" aria-label="选择文件">
<progress id="uploadProgress" max="100" value="0"></progress>
</section>
<section class="panel-dock" aria-label="可折叠信息面板">
<aside id="peersPanel" class="dock-panel" hidden>
<header>
<h2>在线成员</h2>
<span class="panel-note">选择一个接收方</span>
</header>
<select id="targetSelect" aria-label="发送给"></select>
<div id="peerList" class="peer-list"></div>
</aside>
<aside id="textPanel" class="dock-panel text-panel" hidden>
<header>
<h2>发送文字</h2>
<span class="panel-note">发送给当前选中成员</span>
</header>
<textarea id="textInput" rows="3" placeholder="输入要发送的文字"></textarea>
<button id="sendText" type="button">发送文字</button>
</aside>
<aside id="activityPanel" class="dock-panel activity-panel" hidden>
<header>
<h2>接收与状态</h2>
<button id="clearLog" class="secondary small-button" type="button">清空</button>
</header>
<div id="activityList" class="activity-list"></div>
</aside>
<aside id="identityPanel" class="dock-panel" hidden>
<header>
<h2>我的 ID</h2>
<span class="panel-note">用于识别当前设备</span>
</header>
<div class="identity-card">
<span>用户码</span>
<strong id="userCode">------</strong>
</div>
<label class="nickname-field">
<span>昵称</span>
<input id="nickname" type="text" maxlength="32" autocomplete="off" aria-label="昵称">
</label>
<div class="identity-actions">
<button id="saveName" type="button">保存</button>
<button id="regenCode" type="button" class="secondary">换码</button>
</div>
</aside>
<aside id="serverPanel" class="dock-panel" hidden>
<header>
<h2>服务器 IP</h2>
<span class="panel-note">只显示内网地址</span>
</header>
<code id="serverAddress" class="server-address">检测中</code>
</aside>
</section>
</main>
<script src="/app.js"></script>
</body>
</html>