Files
EAP_Interface_html/.preview/band_settings/option_2_neo_bento.html
T
zhy200308 4a77427c4a feat(ui): 交付手环配置6件物料并全局统一核心主色蓝规范
1. 完成页面优化交付:
   - 【手环配置】:完成6件标准物料交付(原图+image.png+baseline_ui.html+DESIGN_SPEC.md+implementation_plan.md+CARD任务卡),采用流体双栏仪表盘架构、居中底部抽拉式Sheet面板、左上角动态雷达声呐动效、右下角悬浮蓝牙FAB、实时同步日志控制台Terminal,并将设备列表按钮精简为BLE标签且支持整行点击直连。
2. 全局主色蓝规范统一与旧页面修复:
   - README.md 固化《全局核心主色蓝统一规范》,全量统一收敛为 #2563EB(深色 #1D4ED8、浅底 #EFF6FF、高亮 #1E40AF、微光 rgba(37,99,235,0.25))。
   - 同步修复【语言设置】、【版型切换】、【心率区间设置】、【自动连接配置】中的杂色与偏紫蓝色,全部对齐为标准主色蓝。
   - 通过 Chrome Headless 自动批量重新渲染并更新了前 5 个页面的官方 image.png 效果图。
2026-08-17 17:15:54 +08:00

299 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 2:Linear Precision 工控极客网格 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #5B21B6;
--accent: #7C3AED;
--accent-light: #F5F3FF;
--bg: #0B0F19;
--surface: #111827;
--card-bg: #1F2937;
--text-main: #F9FAFB;
--text-sub: #9CA3AF;
--divider: #374151;
--danger: #F43F5E;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: ui-monospace, SFMono-Regular, "Segoe UI", Roboto, "PingFang SC", sans-serif;
background: #030712;
color: var(--text-main);
min-height: 100vh;
padding: clamp(16px, 2.5vw, 32px);
display: flex;
flex-direction: column;
}
.device-wrapper {
width: 100%;
max-width: min(100%, 1160px);
margin: 0 auto;
background: var(--surface);
border-radius: 20px;
border: 1px solid #1F2937;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
overflow: hidden;
position: relative;
min-height: 640px;
display: flex;
flex-direction: column;
}
/* AppBar */
.appbar {
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
border-bottom: 1px solid var(--divider);
background: #111827;
}
.appbar-left { display: flex; align-items: center; }
.appbar-nav, .appbar-more {
width: 40px; height: 40px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(255, 255, 255, 0.08); }
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
/* 复合 Bento 栅格 */
.linear-grid {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1.1fr 1fr;
gap: clamp(16px, 2vw, 22px);
background: #0B0F19;
flex: 1;
overflow-y: auto;
max-height: 660px;
}
.linear-card {
background: #111827;
border: 1px solid var(--divider);
border-radius: 14px;
padding: 18px 20px;
display: flex;
flex-direction: column;
gap: 14px;
}
.l-head {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
padding-bottom: 10px;
}
.l-title { font-size: 14.5px; font-weight: 700; color: #A78BFA; }
/* 参数矩阵 */
.l-param-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.l-cell { background: #1F2937; border: 1px solid #374151; border-radius: 8px; padding: 10px 12px; }
.l-k { font-size: 11px; color: var(--text-sub); }
.l-v { font-size: 13.5px; font-weight: 700; color: #FFF; margin-top: 2px; }
.l-btn-row { display: flex; justify-content: space-between; align-items: center; }
.btn-red { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-connect {
background: #374151; color: var(--text-sub); border: none; border-radius: 6px; padding: 7px 16px;
font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.btn-connect.on { background: var(--accent); color: white; }
/* 心率设置 */
.hr-l-grid { display: flex; flex-direction: column; gap: 8px; }
.hr-l-box {
background: #1F2937; border: 1px solid #374151; border-radius: 8px; padding: 8px 12px;
display: flex; align-items: center; justify-content: space-between;
}
.hr-select-dark {
background: #111827; color: #A78BFA; border: 1px solid var(--divider); border-radius: 6px;
padding: 4px 10px; font-weight: 700;
}
.btn-linear-wide {
width: 100%; padding: 10px; border-radius: 8px; background: #374151; color: #F9FAFB; font-weight: 700;
border: none; cursor: pointer; transition: background 0.2s;
}
.btn-linear-wide.glow { background: var(--accent); }
/* 控制台 */
.linear-term {
background: #030712; border: 1px solid #1F2937; border-radius: 8px; padding: 10px 12px;
font-size: 11.5px; color: #9CA3AF; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-btn {
position: absolute; bottom: 24px; right: 24px; width: 50px; height: 50px; border-radius: 14px;
background: var(--accent); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 40; border: none;
}
.fab-btn svg { width: 22px; height: 22px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.bottom-sheet-mask.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
position: absolute; bottom: 0; left: 0; right: 0;
background: #111827; border-radius: 24px 24px 0 0; border-top: 1px solid var(--divider);
box-shadow: 0 -15px 40px rgba(0,0,0,0.6); transform: translateY(100%);
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
display: flex; flex-direction: column; max-height: 480px; z-index: 101;
}
.bottom-sheet-mask.open .bottom-sheet { transform: translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #4B5563; margin: 10px auto 4px; }
.radar-pulse-icon {
position: relative; width: 30px; height: 30px; border-radius: 50%; background: rgba(124, 58, 237, 0.2);
display: flex; align-items: center; justify-content: center;
}
.radar-ring {
position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--accent);
animation: radarWave 1.6s infinite ease-out;
}
@keyframes radarWave { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
</style>
</head>
<body>
<div class="device-wrapper">
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
<h1 class="appbar-title">手环配置</h1>
</div>
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
</header>
<main class="linear-grid">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="linear-card">
<div class="l-head">
<span class="l-title">手环设备信息</span>
<span id="lTag" style="font-size: 11px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="l-param-row">
<div class="l-cell"><div class="l-k">设备名称:</div><div class="l-v" id="lName">未连接</div></div>
<div class="l-cell"><div class="l-k">MAC 地址:</div><div class="l-v" id="lMac">设备ID: 未知</div></div>
<div class="l-cell"><div class="l-k">设备电量:</div><div class="l-v" id="lBat">电量: 未知</div></div>
<div class="l-cell"><div class="l-k">固件版本:</div><div class="l-v" id="lFw">固件版本: 未知</div></div>
</div>
<div class="l-btn-row">
<button class="btn-red" onclick="lReset()">重置手环</button>
<button class="btn-connect" id="lBtnDis" onclick="lDis()">断开连接</button>
</div>
</section>
<section class="linear-card">
<div class="l-head">
<span class="l-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--accent);">
</div>
<div class="hr-l-grid">
<div class="hr-l-box"><span>最低心率 (Min):</span><select class="hr-select-dark"><option>40</option></select></div>
<div class="hr-l-box"><span>最高心率 (Max):</span><select class="hr-select-dark"><option>180</option></select></div>
<div class="hr-l-box"><span>心率目标 (Goal):</span><select class="hr-select-dark"><option>140</option></select></div>
</div>
<button class="btn-linear-wide" onclick="lSaveHr()">保存警报阈值</button>
<div style="font-size: 11.5px; color: #10B981;">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="linear-card" style="flex: 1;">
<div class="l-head"><span class="l-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #1F2937; padding: 10px 12px; border-radius: 8px;">
<span style="font-size: 12.5px;">选择同步的时间段:</span>
<select class="hr-select-dark"><option>过去 1 小时</option></select>
</div>
<button class="btn-linear-wide glow" onclick="lSync()">一键同步历史心率/运动</button>
<span style="font-size: 12px; font-weight: 700; color: #A78BFA; margin-top: 4px;">同步日志控制台</span>
<div class="linear-term" id="lTerm">
<div>[INIT] Linear BLE Service 就绪...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-btn" onclick="openLSheet()"><svg viewBox="0 0 24 24"><path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z"/></svg></button>
<!-- 底部抽拉式 Sheet -->
<div class="bottom-sheet-mask" id="lSheetMask" onclick="if(event.target===this) closeLSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div style="padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider);">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-pulse-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#A78BFA"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg></div>
<h2 style="font-size: 15px; font-weight: 700; color: #FFF;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeLSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); background: #1F2937; padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="lPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: rgba(167, 139, 250, 0.2); color: #A78BFA; font-size: 10px; padding: 2px 4px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · -89 dBm</div>
</div>
<button style="background: var(--accent); color: white; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
</div>
</div>
</div>
</div>
</div>
<script>
function lLog(t) {
const b = document.getElementById('lTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openLSheet() { document.getElementById('lSheetMask').classList.add('open'); lLog("从底部抽拉展开【选择设备】面板..."); }
function closeLSheet() { document.getElementById('lSheetMask').classList.remove('open'); }
function lPick(n, m) {
closeLSheet();
lLog(`GATT 连接手环 [${n}]...`);
setTimeout(() => {
document.getElementById('lName').innerText = n;
document.getElementById('lMac').innerText = m;
document.getElementById('lBat').innerText = "90% (正常)";
document.getElementById('lFw').innerText = "v2.1.04";
document.getElementById('lTag').innerText = "状态:已连接";
document.getElementById('lTag').style.color = "#10B981";
document.getElementById('lBtnDis').classList.add('on');
lLog(`手环 [${n}] 已成功在线!`);
}, 500);
}
function lDis() {
document.getElementById('lName').innerText = "未连接";
document.getElementById('lMac').innerText = "设备ID: 未知";
document.getElementById('lBat').innerText = "电量: 未知";
document.getElementById('lFw').innerText = "固件版本: 未知";
document.getElementById('lTag').innerText = "状态:未连接";
document.getElementById('lBtnDis').classList.remove('on');
lLog("正在主动断开连接...");
}
function lReset() { lLog("发送重置指令..."); alert("手环重置请求已发送!"); }
function lSaveHr() { lLog("保存心率预警阈值成功!"); alert("心率预警阈值保存成功!"); }
function lSync() { lLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>