modify css & webicon

This commit is contained in:
xianguo 2026-06-19 13:31:43 +08:00
parent 31828cbee2
commit 1bf61238a9
4 changed files with 519 additions and 294 deletions

View File

@ -6,6 +6,7 @@ const state = {
users: [], users: [],
serverInfo: null, serverInfo: null,
activities: new Map(), activities: new Map(),
selectedPeerId: "",
ws: null, ws: null,
reconnectTimer: null reconnectTimer: null
}; };
@ -17,13 +18,14 @@ const els = {
regenCode: document.querySelector("#regenCode"), regenCode: document.querySelector("#regenCode"),
serverAddress: document.querySelector("#serverAddress"), serverAddress: document.querySelector("#serverAddress"),
connectionState: document.querySelector("#connectionState"), connectionState: document.querySelector("#connectionState"),
selectedPeer: document.querySelector("#selectedPeer"),
dropZone: document.querySelector("#dropZone"),
peerCount: document.querySelector("#peerCount"), peerCount: document.querySelector("#peerCount"),
peerList: document.querySelector("#peerList"), peerList: document.querySelector("#peerList"),
targetSelect: document.querySelector("#targetSelect"), targetSelect: document.querySelector("#targetSelect"),
textInput: document.querySelector("#textInput"), textInput: document.querySelector("#textInput"),
sendText: document.querySelector("#sendText"), sendText: document.querySelector("#sendText"),
fileInput: document.querySelector("#fileInput"), fileInput: document.querySelector("#fileInput"),
sendFile: document.querySelector("#sendFile"),
uploadProgress: document.querySelector("#uploadProgress"), uploadProgress: document.querySelector("#uploadProgress"),
activityList: document.querySelector("#activityList"), activityList: document.querySelector("#activityList"),
clearLog: document.querySelector("#clearLog") clearLog: document.querySelector("#clearLog")
@ -85,16 +87,57 @@ function connectWebSocket() {
} }
function bindEvents() { function bindEvents() {
document.querySelectorAll(".panel-toggle").forEach((button) => {
button.addEventListener("click", (event) => {
event.stopPropagation();
togglePanel(button.dataset.panel, button);
});
});
document.querySelectorAll(".dock-panel").forEach((panel) => {
panel.addEventListener("click", (event) => event.stopPropagation());
});
document.addEventListener("click", closePanels);
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") closePanels();
});
els.saveName.addEventListener("click", saveName); els.saveName.addEventListener("click", saveName);
els.regenCode.addEventListener("click", regenerateCode); els.regenCode.addEventListener("click", regenerateCode);
els.sendText.addEventListener("click", sendText); els.sendText.addEventListener("click", sendText);
els.sendFile.addEventListener("click", sendFile); els.fileInput.addEventListener("change", () => {
const file = els.fileInput.files[0];
if (file) uploadFile(file);
});
els.dropZone.addEventListener("click", () => els.fileInput.click());
els.dropZone.addEventListener("dragenter", handleDragEnter);
els.dropZone.addEventListener("dragover", handleDragOver);
els.dropZone.addEventListener("dragleave", handleDragLeave);
els.dropZone.addEventListener("drop", handleDrop);
els.targetSelect.addEventListener("change", () => selectPeer(els.targetSelect.value));
els.clearLog.addEventListener("click", () => { els.clearLog.addEventListener("click", () => {
els.activityList.innerHTML = ""; els.activityList.innerHTML = "";
state.activities.clear(); state.activities.clear();
}); });
} }
function togglePanel(panelId, button) {
const shouldOpen = document.querySelector(`#${panelId}`)?.hidden;
setPanel(panelId, shouldOpen, button);
}
function setPanel(panelId, open, button = null) {
const panel = document.querySelector(`#${panelId}`);
if (!panel) return;
closePanels();
panel.hidden = !open;
const toggle = button || document.querySelector(`.panel-toggle[data-panel="${panelId}"]`);
if (toggle) toggle.setAttribute("aria-expanded", String(open));
}
function closePanels() {
document.querySelectorAll(".dock-panel").forEach((item) => { item.hidden = true; });
document.querySelectorAll(".panel-toggle").forEach((item) => item.setAttribute("aria-expanded", "false"));
}
async function saveName() { async function saveName() {
const name = els.nickname.value.trim(); const name = els.nickname.value.trim();
if (!name) return; if (!name) return;
@ -133,9 +176,8 @@ function sendText() {
els.textInput.value = ""; els.textInput.value = "";
} }
function sendFile() { function uploadFile(file) {
const file = els.fileInput.files[0]; const receiverId = state.selectedPeerId || els.targetSelect.value;
const receiverId = els.targetSelect.value;
if (!file || !receiverId || !state.user) return; if (!file || !receiverId || !state.user) return;
const url = `/api/uploads?sender_id=${encodeURIComponent(state.user.id)}&receiver_id=${encodeURIComponent(receiverId)}&filename=${encodeURIComponent(file.name)}`; const url = `/api/uploads?sender_id=${encodeURIComponent(state.user.id)}&receiver_id=${encodeURIComponent(receiverId)}&filename=${encodeURIComponent(file.name)}`;
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
@ -164,6 +206,30 @@ function sendFile() {
xhr.send(file); xhr.send(file);
} }
function handleDragEnter(event) {
event.preventDefault();
els.dropZone.classList.add("drag-over");
}
function handleDragOver(event) {
event.preventDefault();
event.dataTransfer.dropEffect = state.selectedPeerId ? "copy" : "none";
}
function handleDragLeave(event) {
if (!els.dropZone.contains(event.relatedTarget)) {
els.dropZone.classList.remove("drag-over");
}
}
function handleDrop(event) {
event.preventDefault();
els.dropZone.classList.remove("drag-over");
const file = event.dataTransfer.files[0];
if (!file) return;
uploadFile(file);
}
function handleEvent(event) { function handleEvent(event) {
switch (event.type) { switch (event.type) {
case "user.list": case "user.list":
@ -212,6 +278,7 @@ function handleEvent(event) {
} }
function addIncomingText(event) { function addIncomingText(event) {
setPanel("activityPanel", true);
const text = event.text || event.transfer?.text || ""; const text = event.text || event.transfer?.text || "";
const item = upsertActivity({ const item = upsertActivity({
key: transferKey(event.transfer), key: transferKey(event.transfer),
@ -232,6 +299,7 @@ function addIncomingText(event) {
} }
function addIncomingFile(event) { function addIncomingFile(event) {
setPanel("activityPanel", true);
const transfer = event.transfer; const transfer = event.transfer;
if (!transfer) return; if (!transfer) return;
const item = upsertActivity({ const item = upsertActivity({
@ -325,6 +393,12 @@ function renderUsers() {
els.peerCount.textContent = peers.length; els.peerCount.textContent = peers.length;
els.peerList.innerHTML = ""; els.peerList.innerHTML = "";
els.targetSelect.innerHTML = ""; els.targetSelect.innerHTML = "";
if (state.selectedPeerId && !peers.some((user) => user.id === state.selectedPeerId)) {
state.selectedPeerId = "";
}
if (!state.selectedPeerId && peers.length > 0) {
state.selectedPeerId = peers[0].id;
}
if (peers.length === 0) { if (peers.length === 0) {
const empty = document.createElement("div"); const empty = document.createElement("div");
empty.className = "peer"; empty.className = "peer";
@ -335,23 +409,41 @@ function renderUsers() {
const option = document.createElement("option"); const option = document.createElement("option");
option.value = user.id; option.value = user.id;
option.textContent = `${user.name} (${user.code})`; option.textContent = `${user.name} (${user.code})`;
option.selected = user.id === state.selectedPeerId;
els.targetSelect.append(option); els.targetSelect.append(option);
const card = document.createElement("div"); const card = document.createElement("button");
card.type = "button";
card.className = "peer"; card.className = "peer";
card.innerHTML = `<strong></strong><code></code>`; card.innerHTML = `<strong></strong><code></code>`;
card.querySelector("strong").textContent = user.name; card.querySelector("strong").textContent = user.name;
card.querySelector("code").textContent = user.code; card.querySelector("code").textContent = user.code;
card.addEventListener("click", () => { if (user.id === state.selectedPeerId) card.classList.add("selected");
els.targetSelect.value = user.id; card.addEventListener("click", () => selectPeer(user.id));
document.querySelectorAll(".peer.selected").forEach((node) => node.classList.remove("selected"));
card.classList.add("selected");
});
els.peerList.append(card); els.peerList.append(card);
} }
if (state.selectedPeerId) els.targetSelect.value = state.selectedPeerId;
const hasTarget = peers.length > 0; const hasTarget = peers.length > 0;
els.sendText.disabled = !hasTarget; els.sendText.disabled = !hasTarget;
els.sendFile.disabled = !hasTarget; els.dropZone.disabled = !hasTarget;
renderSelectedPeer();
}
function selectPeer(userId) {
state.selectedPeerId = userId;
els.targetSelect.value = userId;
renderUsers();
}
function renderSelectedPeer() {
const peer = state.users.find((user) => user.id === state.selectedPeerId);
if (!peer) {
els.selectedPeer.textContent = "打开“成员”选择接收方";
els.dropZone.querySelector("#dropHint").textContent = "选择在线成员后,把文件拖到这里,或点击选择文件";
return;
}
els.selectedPeer.textContent = `发送给 ${peer.name} · ${peer.code}`;
els.dropZone.querySelector("#dropHint").textContent = "把文件拖到这里,或点击选择文件";
} }
function addActivity(title, body, tone = "") { function addActivity(title, body, tone = "") {

9
web/icon.svg Normal file
View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" role="img" aria-labelledby="title desc">
<title id="title">Internal Drop icon</title>
<desc id="desc">A simple blue local transfer mark with a white drop arrow and receiving line.</desc>
<rect width="256" height="256" rx="58" fill="#1e88e5"/>
<circle cx="128" cy="128" r="74" fill="none" stroke="#ffffff" stroke-width="14" opacity="0.24"/>
<path d="M128 66v96" fill="none" stroke="#ffffff" stroke-width="18" stroke-linecap="round"/>
<path d="M92 105 128 69l36 36" fill="none" stroke="#ffffff" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M82 178h92" fill="none" stroke="#ffffff" stroke-width="18" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 736 B

View File

@ -4,26 +4,78 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Internal Drop</title> <title>Internal Drop</title>
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/styles.css"> <link rel="stylesheet" href="/styles.css">
</head> </head>
<body> <body>
<main class="app-shell"> <main class="app-shell">
<section class="topbar"> <header class="topbar">
<div class="brand-block"> <div class="brand-block">
<span class="product-kicker">LAN transfer desk</span> <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> <h1>Internal Drop</h1>
</div> </div>
<div class="top-meta">
<div class="server-line">
<span>服务器</span>
<code id="serverAddress">检测中</code>
</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> <div id="connectionState" class="state">连接中</div>
</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>
<section class="identity-bar"> <section class="panel-dock" aria-label="可折叠信息面板">
<div class="identity-code"> <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> <span>用户码</span>
<strong id="userCode">------</strong> <strong id="userCode">------</strong>
</div> </div>
@ -35,43 +87,15 @@
<button id="saveName" type="button">保存</button> <button id="saveName" type="button">保存</button>
<button id="regenCode" type="button" class="secondary">换码</button> <button id="regenCode" type="button" class="secondary">换码</button>
</div> </div>
</section>
<section class="workspace">
<aside class="peer-panel">
<header>
<h2>在线成员</h2>
<span id="peerCount">0</span>
</header>
<div id="peerList" class="peer-list"></div>
</aside> </aside>
<section class="send-panel"> <aside id="serverPanel" class="dock-panel" hidden>
<div class="target-row">
<label for="targetSelect">发送给</label>
<select id="targetSelect"></select>
</div>
<div class="composer">
<label for="textInput">文字</label>
<textarea id="textInput" rows="3" placeholder="输入要发送的文字"></textarea>
<button id="sendText" type="button">发送文字</button>
</div>
<div class="file-box">
<input id="fileInput" type="file">
<button id="sendFile" type="button">发送文件</button>
<progress id="uploadProgress" max="100" value="0"></progress>
</div>
</section>
<section class="activity-panel">
<header> <header>
<h2>接收与状态</h2> <h2>服务器 IP</h2>
<button id="clearLog" type="button">清空</button> <span class="panel-note">只显示内网地址</span>
</header> </header>
<div id="activityList" class="activity-list"></div> <code id="serverAddress" class="server-address">检测中</code>
</section> </aside>
</section> </section>
</main> </main>
<script src="/app.js"></script> <script src="/app.js"></script>

View File

@ -1,24 +1,26 @@
:root { :root {
color-scheme: light; color-scheme: light;
--bg: #eef2f5; --bg: #f5f7fb;
--bg-2: #e9f0f7;
--surface: #ffffff; --surface: #ffffff;
--surface-subtle: #f7f9fb; --surface-soft: #f8fafc;
--ink: #111827; --ink: #111827;
--muted: #64748b; --muted: #667085;
--line: #d8e0e8; --line: #d9e2ec;
--line-strong: #c6d1dc; --line-strong: #c8d3df;
--primary: #0f766e; --primary: #176b87;
--primary-strong: #115e59; --primary-strong: #0f5369;
--primary-soft: #e3f5f2; --primary-soft: #e7f4f7;
--blue: #2563eb; --blue: #2f6fed;
--blue-soft: #eaf1ff; --blue-soft: #eaf1ff;
--ok: #166534; --ok: #166534;
--ok-soft: #eaf7ee; --ok-soft: #eaf7ee;
--warn: #9a5b00; --warn: #995f00;
--warn-soft: #fff4dc; --warn-soft: #fff5df;
--bad: #a33838; --bad: #a33838;
--bad-soft: #fff0f0; --bad-soft: #fff0f0;
--shadow: 0 16px 40px rgba(28, 45, 64, 0.08); --shadow-sm: 0 8px 24px rgba(31, 45, 61, 0.08);
--shadow-lg: 0 24px 80px rgba(31, 45, 61, 0.16);
} }
* { * {
@ -28,9 +30,11 @@
body { body {
margin: 0; margin: 0;
min-height: 100vh; min-height: 100vh;
overflow-x: hidden;
background: background:
linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 220px), radial-gradient(circle at top left, rgba(47, 111, 237, 0.12), transparent 34vw),
var(--bg); radial-gradient(circle at bottom right, rgba(23, 107, 135, 0.12), transparent 30vw),
linear-gradient(180deg, var(--bg), var(--bg-2));
color: var(--ink); color: var(--ink);
font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
} }
@ -44,39 +48,27 @@ textarea {
button { button {
min-height: 44px; min-height: 44px;
border: 1px solid var(--primary); border: 1px solid var(--line-strong);
border-radius: 8px; border-radius: 8px;
background: var(--primary); background: var(--surface);
color: #fff; color: var(--ink);
cursor: pointer; cursor: pointer;
padding: 0 16px; padding: 0 14px;
font-weight: 700; font-weight: 700;
transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
} }
button:hover { button:hover {
background: var(--primary-strong);
border-color: var(--primary-strong);
}
button.secondary,
.activity button.secondary {
background: #fff;
color: var(--primary-strong);
border-color: var(--line-strong);
}
button.secondary:hover,
.activity button.secondary:hover {
border-color: var(--primary); border-color: var(--primary);
background: var(--primary-soft); background: var(--primary-soft);
color: var(--primary-strong);
} }
button:focus-visible, button:focus-visible,
input:focus-visible, input:focus-visible,
select:focus-visible, select:focus-visible,
textarea:focus-visible { textarea:focus-visible {
outline: 3px solid rgba(37, 99, 235, 0.22); outline: 3px solid rgba(47, 111, 237, 0.22);
outline-offset: 2px; outline-offset: 2px;
} }
@ -86,34 +78,37 @@ button:disabled {
} }
.app-shell { .app-shell {
width: min(1240px, calc(100% - 36px)); position: relative;
min-height: 100dvh;
width: min(1200px, calc(100% - 32px));
margin: 0 auto; margin: 0 auto;
padding: 24px 0 36px; padding: 22px 0 34px;
}
.topbar,
.identity-bar,
.peer-panel,
.send-panel,
.activity-panel {
background: rgba(255, 255, 255, 0.92);
border: 1px solid rgba(216, 224, 232, 0.92);
border-radius: 8px;
box-shadow: var(--shadow);
} }
.topbar { .topbar {
display: flex; display: grid;
grid-template-columns: minmax(180px, 1fr) auto auto;
align-items: center; align-items: center;
justify-content: space-between; gap: 16px;
gap: 20px; min-height: 64px;
margin-bottom: 12px;
padding: 18px 20px;
} }
.brand-block { .brand-block {
display: flex;
align-items: center;
gap: 12px;
}
.brand-mark {
width: 48px;
height: 48px;
border-radius: 15px;
box-shadow: 0 10px 28px rgba(23, 107, 135, 0.24);
}
.brand-copy {
display: grid; display: grid;
gap: 4px; gap: 2px;
} }
.product-kicker { .product-kicker {
@ -127,94 +122,209 @@ button:disabled {
h1, h1,
h2 { h2 {
margin: 0; margin: 0;
letter-spacing: 0;
line-height: 1.2; line-height: 1.2;
letter-spacing: 0;
} }
h1 { h1 {
font-size: 28px; font-size: clamp(24px, 4vw, 34px);
} }
h2 { h2 {
font-size: 15px; font-size: 15px;
} }
.top-meta { .utility-nav {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10px;
min-width: 0;
}
.server-line {
display: flex;
align-items: center;
gap: 8px; gap: 8px;
min-width: 0;
color: var(--muted);
} }
.server-line span { .panel-toggle {
font-size: 12px; min-height: 40px;
font-weight: 700;
}
.server-line code {
display: inline-block;
max-width: min(460px, 52vw);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border: 1px solid var(--line);
border-radius: 999px; border-radius: 999px;
background: var(--surface-subtle); background: rgba(255, 255, 255, 0.82);
color: #334155; backdrop-filter: blur(12px);
padding: 5px 10px; padding: 0 13px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
font-size: 12px; box-shadow: 0 6px 20px rgba(31, 45, 61, 0.06);
} }
.identity-bar { .panel-toggle[aria-expanded="true"] {
display: grid; border-color: var(--primary);
grid-template-columns: auto minmax(220px, 320px) auto; background: var(--primary);
align-items: end; color: #fff;
gap: 12px;
margin-bottom: 16px;
padding: 14px 16px;
} }
.identity-code, #peerCount {
.nickname-field {
display: grid;
gap: 5px;
}
.identity-code span,
.nickname-field span,
.target-row label,
.composer label {
color: var(--muted);
font-size: 12px;
font-weight: 700;
}
.identity-code strong {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
min-height: 44px; justify-content: center;
border: 1px solid var(--line); min-width: 22px;
border-radius: 8px; margin-left: 4px;
background: var(--primary-soft); border-radius: 999px;
padding: 0 14px; background: rgba(255, 255, 255, 0.65);
color: var(--primary-strong); padding: 1px 6px;
font: 800 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
} }
.identity-actions { .state {
justify-self: end;
border: 1px solid var(--line-strong);
border-radius: 999px;
background: rgba(255, 255, 255, 0.82);
color: var(--muted);
padding: 8px 12px;
white-space: nowrap;
font-size: 13px;
font-weight: 800;
}
.state.online {
border-color: #b8dfc8;
background: var(--ok-soft);
color: var(--ok);
}
.state.offline {
border-color: #efc4c4;
background: var(--bad-soft);
color: var(--bad);
}
.drop-stage {
display: grid;
place-items: center;
min-height: calc(100dvh - 132px);
padding: 28px 0;
}
.selected-peer {
align-self: end;
margin-bottom: 16px;
border: 1px solid rgba(200, 211, 223, 0.9);
border-radius: 999px;
background: rgba(255, 255, 255, 0.74);
color: #334155;
padding: 8px 14px;
font-size: 13px;
font-weight: 800;
box-shadow: var(--shadow-sm);
}
.drop-zone {
position: relative;
display: grid;
place-items: center;
gap: 10px;
width: min(520px, 78vw);
aspect-ratio: 1;
border: 1px solid rgba(200, 211, 223, 0.95);
border-radius: 50%;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
var(--surface);
color: var(--ink);
box-shadow: var(--shadow-lg);
text-align: center;
padding: 52px;
}
.drop-zone:hover,
.drop-zone.drag-over {
border-color: var(--primary);
background: linear-gradient(180deg, #ffffff, var(--primary-soft));
}
.drop-zone:disabled {
opacity: 0.82;
}
.drop-ring {
position: absolute;
inset: 10%;
border: 1px dashed rgba(23, 107, 135, 0.28);
border-radius: 50%;
pointer-events: none;
}
.drop-icon {
display: grid;
place-items: center;
width: 78px;
height: 78px;
border-radius: 50%;
background: var(--blue-soft);
color: var(--blue);
}
.drop-icon svg {
width: 38px;
height: 38px;
}
.drop-zone #dropHint {
max-width: 290px;
color: var(--muted);
font-size: clamp(16px, 2.2vw, 20px);
font-weight: 800;
}
#fileInput {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
}
#uploadProgress {
width: min(360px, 70vw);
height: 9px;
margin-top: 18px;
accent-color: var(--primary);
}
.panel-dock {
position: fixed;
z-index: 20;
top: 92px;
right: max(18px, calc((100vw - 1200px) / 2));
display: grid;
gap: 10px;
width: min(420px, calc(100vw - 28px));
pointer-events: none;
}
.dock-panel {
pointer-events: auto;
border: 1px solid rgba(217, 226, 236, 0.95);
border-radius: 8px;
background: rgba(255, 255, 255, 0.96);
box-shadow: var(--shadow-lg);
padding: 16px;
backdrop-filter: blur(16px);
}
.dock-panel[hidden] {
display: none;
}
.dock-panel header {
display: flex; display: flex;
gap: 8px; align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 12px;
}
.panel-note {
color: var(--muted);
font-size: 12px;
} }
input, input,
@ -230,95 +340,33 @@ textarea {
} }
textarea { textarea {
min-height: 92px; min-height: 96px;
max-height: 170px; max-height: 180px;
resize: vertical; resize: vertical;
} }
.state {
border: 1px solid var(--line);
border-radius: 999px;
background: var(--surface-subtle);
color: var(--muted);
padding: 6px 12px;
white-space: nowrap;
font-size: 13px;
font-weight: 700;
}
.state.online {
border-color: #b8dfc8;
background: var(--ok-soft);
color: var(--ok);
}
.state.offline {
border-color: #efc4c4;
background: var(--bad-soft);
color: var(--bad);
}
.workspace {
display: grid;
grid-template-columns: minmax(220px, 270px) minmax(360px, 1fr) minmax(420px, 520px);
gap: 16px;
align-items: start;
}
.peer-panel,
.send-panel,
.activity-panel {
min-height: 420px;
padding: 16px;
}
.peer-panel header,
.activity-panel header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 14px;
}
#peerCount {
border-radius: 999px;
background: var(--blue-soft);
color: var(--blue);
min-width: 30px;
padding: 3px 9px;
text-align: center;
font-size: 12px;
font-weight: 800;
}
.peer-list, .peer-list,
.activity-list { .activity-list {
display: grid; display: grid;
gap: 8px; gap: 8px;
} }
.peer-list {
margin-top: 10px;
}
.peer { .peer {
display: grid;
width: 100%;
min-height: 58px;
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 8px; border-radius: 8px;
padding: 11px 12px;
cursor: pointer;
background: #fff; background: #fff;
transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; padding: 10px 12px;
} text-align: left;
.peer:hover {
border-color: var(--primary);
box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
}
.peer.selected {
border-color: var(--primary);
background: var(--primary-soft);
} }
.peer strong { .peer strong {
display: block;
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
@ -328,23 +376,73 @@ textarea {
font-size: 12px; font-size: 12px;
} }
.target-row, .peer.selected {
.composer, border-color: var(--primary);
.file-box { background: var(--primary-soft);
}
.text-panel {
display: grid; display: grid;
gap: 9px; gap: 10px;
margin-bottom: 16px;
} }
.file-box { .text-panel header {
border-top: 1px solid var(--line); margin-bottom: 2px;
padding-top: 16px;
} }
progress { .identity-card,
width: 100%; .nickname-field {
height: 10px; display: grid;
accent-color: var(--primary); gap: 6px;
margin-bottom: 12px;
}
.identity-card span,
.nickname-field span {
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
.identity-card strong {
display: inline-flex;
align-items: center;
min-height: 48px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--primary-soft);
padding: 0 14px;
color: var(--primary-strong);
font: 900 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.identity-actions {
display: flex;
gap: 8px;
}
.server-address {
display: block;
overflow-wrap: anywhere;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface-soft);
padding: 12px;
color: #334155;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.small-button,
.activity button {
min-height: 34px;
padding: 0 10px;
font-size: 12px;
}
.secondary,
.activity button.secondary {
background: #fff;
color: var(--primary-strong);
} }
.activity { .activity {
@ -388,7 +486,7 @@ progress {
.activity-status { .activity-status {
border-radius: 999px; border-radius: 999px;
background: var(--surface-subtle); background: var(--surface-soft);
color: var(--muted); color: var(--muted);
padding: 4px 8px; padding: 4px 8px;
font-size: 12px; font-size: 12px;
@ -407,13 +505,6 @@ progress {
gap: 6px; gap: 6px;
} }
.activity button {
min-height: 32px;
border-radius: 7px;
padding: 0 10px;
font-size: 12px;
}
.activity-progress { .activity-progress {
grid-column: 1 / -1; grid-column: 1 / -1;
height: 5px; height: 5px;
@ -458,47 +549,45 @@ progress {
} }
} }
@media (max-width: 1080px) { @media (max-width: 820px) {
.workspace {
grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
}
.activity-panel {
grid-column: 1 / -1;
}
}
@media (max-width: 760px) {
.app-shell { .app-shell {
width: min(100% - 20px, 1240px); width: min(100% - 20px, 1200px);
padding-top: 10px; padding-top: 12px;
} }
.topbar, .topbar {
.identity-bar {
align-items: flex-start;
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.topbar, .utility-nav,
.top-meta, .state {
.identity-actions { justify-self: stretch;
flex-direction: column;
align-items: stretch;
} }
.workspace { .utility-nav {
grid-template-columns: 1fr; display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
} }
.peer-panel, .panel-toggle {
.send-panel, width: 100%;
.activity-panel { padding: 0 10px;
}
.drop-stage {
min-height: auto; min-height: auto;
padding: 36px 0 20px;
} }
.server-line code { .drop-zone {
max-width: 100%; width: min(440px, 86vw);
padding: 34px;
}
.panel-dock {
position: static;
width: 100%;
margin-top: 12px;
} }
.activity { .activity {
@ -513,3 +602,14 @@ progress {
grid-column: 1 / -1; grid-column: 1 / -1;
} }
} }
@media (max-width: 520px) {
.utility-nav {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.drop-icon {
width: 64px;
height: 64px;
}
}