4a77427c4a
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 效果图。
282 lines
14 KiB
HTML
282 lines
14 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>方案 3:Sport Racing 运动遥测风 + 底部抽拉 Sheet</title>
|
||
<style>
|
||
:root {
|
||
--primary: #F59E0B;
|
||
--accent: #0EA5E9;
|
||
--bg: #0F172A;
|
||
--surface: #1E293B;
|
||
--card-bg: #1E293B;
|
||
--text-main: #F8FAFC;
|
||
--text-sub: #94A3B8;
|
||
--divider: #334155;
|
||
--danger: #EF4444;
|
||
--success: #10B981;
|
||
}
|
||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||
background: #020617;
|
||
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(--bg);
|
||
border-radius: 24px;
|
||
border: 1px solid var(--divider);
|
||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
|
||
overflow: hidden;
|
||
position: relative;
|
||
min-height: 640px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
.appbar {
|
||
height: 60px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 20px;
|
||
border-bottom: 1px solid var(--divider);
|
||
background: #1E293B;
|
||
}
|
||
.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; }
|
||
|
||
/* 运动仪表盘布局 */
|
||
.sport-dashboard {
|
||
padding: clamp(20px, 2.5vw, 28px);
|
||
display: grid;
|
||
grid-template-columns: 1fr 1fr;
|
||
gap: clamp(16px, 2vw, 24px);
|
||
flex: 1;
|
||
background: #0B0F19;
|
||
overflow-y: auto;
|
||
max-height: 660px;
|
||
}
|
||
|
||
.sport-card {
|
||
background: #131A2B;
|
||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||
border-radius: 18px;
|
||
padding: 20px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 14px;
|
||
}
|
||
.s-head {
|
||
display: flex; align-items: center; justify-content: space-between;
|
||
border-bottom: 1px solid var(--divider); padding-bottom: 10px;
|
||
}
|
||
.s-title { font-size: 15px; font-weight: 700; color: var(--primary); }
|
||
|
||
.s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
|
||
.s-box { background: #1E293B; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--divider); }
|
||
.s-lbl { font-size: 11px; color: var(--text-sub); }
|
||
.s-val { font-size: 13.5px; font-weight: 700; margin-top: 3px; font-family: monospace; color: #FFF; }
|
||
|
||
.s-action-row { display: flex; justify-content: space-between; align-items: center; }
|
||
.btn-s-danger { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
|
||
.btn-s-primary { background: #334155; color: #94A3B8; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
|
||
.btn-s-primary.active { background: var(--primary); color: #000; }
|
||
|
||
.hr-s-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
|
||
.hr-s-card { background: #1E293B; border-radius: 10px; padding: 10px; text-align: center; border: 1px solid var(--divider); }
|
||
.hr-s-select { background: #0F172A; color: var(--accent); border: 1px solid var(--divider); border-radius: 6px; padding: 4px; font-weight: 700; width: 100%; margin-top: 4px; }
|
||
|
||
.btn-wide-sport {
|
||
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
|
||
background: #334155; color: #FFF;
|
||
}
|
||
.btn-wide-sport.amber { background: var(--primary); color: #000; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4); }
|
||
|
||
.sport-terminal {
|
||
background: #020617; border: 1px solid var(--divider); border-radius: 10px; padding: 12px;
|
||
font-family: monospace; font-size: 11.5px; color: #38BDF8; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
|
||
}
|
||
|
||
/* FAB */
|
||
.fab-sport {
|
||
position: absolute; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 16px;
|
||
background: var(--primary); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
|
||
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
|
||
}
|
||
.fab-sport svg { width: 24px; height: 24px; fill: #000; }
|
||
|
||
/* 底部抽拉式 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: #131A2B; 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: #475569; margin: 10px auto 4px; }
|
||
.radar-sport-icon {
|
||
position: relative; width: 30px; height: 30px; border-radius: 50%; background: rgba(245, 158, 11, 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(--primary);
|
||
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="sport-dashboard">
|
||
<!-- 左列 -->
|
||
<div style="display: flex; flex-direction: column; gap: 16px;">
|
||
<section class="sport-card">
|
||
<div class="s-head">
|
||
<span class="s-title">手环设备信息</span>
|
||
<span id="sTag" style="font-size: 11px; color: var(--text-sub);">状态:未连接</span>
|
||
</div>
|
||
<div class="s-grid">
|
||
<div class="s-box"><div class="s-lbl">设备名称:</div><div class="s-val" id="sName">未连接</div></div>
|
||
<div class="s-box"><div class="s-lbl">MAC 地址:</div><div class="s-val" id="sMac">设备ID: 未知</div></div>
|
||
<div class="s-box"><div class="s-lbl">设备电量:</div><div class="s-val" id="sBat">电量: 未知</div></div>
|
||
<div class="s-box"><div class="s-lbl">固件版本:</div><div class="s-val" id="sFw">固件版本: 未知</div></div>
|
||
</div>
|
||
<div class="s-action-row">
|
||
<button class="btn-s-danger" onclick="sReset()">重置手环</button>
|
||
<button class="btn-s-primary" id="sDisBtn" onclick="sDis()">断开连接</button>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="sport-card">
|
||
<div class="s-head">
|
||
<span class="s-title">心率预警设置</span>
|
||
<input type="checkbox" checked style="accent-color: var(--primary);">
|
||
</div>
|
||
<div class="hr-s-triple">
|
||
<div class="hr-s-card"><div class="s-lbl">最低心率 (Min)</div><select class="hr-s-select"><option>40</option></select></div>
|
||
<div class="hr-s-card"><div class="s-lbl">最高心率 (Max)</div><select class="hr-s-select"><option>180</option></select></div>
|
||
<div class="hr-s-card"><div class="s-lbl">心率目标 (Goal)</div><select class="hr-s-select"><option>140</option></select></div>
|
||
</div>
|
||
<button class="btn-wide-sport" onclick="sSaveHr()">保存警报阈值</button>
|
||
<div style="font-size: 11.5px; color: #10B981;">● 正在主动断开连接...</div>
|
||
</section>
|
||
</div>
|
||
|
||
<!-- 右列 -->
|
||
<div style="display: flex; flex-direction: column; gap: 16px;">
|
||
<section class="sport-card" style="flex: 1;">
|
||
<div class="s-head"><span class="s-title">历史离线数据同步</span></div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; background: #1E293B; padding: 10px 14px; border-radius: 8px;">
|
||
<span style="font-size: 13px;">选择同步的时间段:</span>
|
||
<select class="hr-s-select" style="width: auto;"><option>过去 1 小时</option></select>
|
||
</div>
|
||
<button class="btn-wide-sport amber" onclick="sSync()">一键同步历史心率/运动</button>
|
||
|
||
<span style="font-size: 12px; font-weight: 700; color: #FFF; margin-top: 4px;">同步日志控制台</span>
|
||
<div class="sport-terminal" id="sTerm">
|
||
<div>[TELEMETRY] 运动数据引擎就绪...</div>
|
||
<div>正在主动断开连接...</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</main>
|
||
|
||
<!-- FAB -->
|
||
<button class="fab-sport" onclick="openSSheet()"><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="sSheetMask" onclick="if(event.target===this) closeSSheet()">
|
||
<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-sport-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#F59E0B"><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="closeSSheet()">✕</span>
|
||
</div>
|
||
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
|
||
<div style="border: 1px solid var(--divider); background: #1E293B; padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="sPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
|
||
<div>
|
||
<div style="font-weight: 700; font-family: monospace; color: #FFF;">CL831-62200026 <span style="background: rgba(245, 158, 11, 0.2); color: var(--primary); 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(--primary); color: #000; border: none; border-radius: 6px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer;">连接</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
function sLog(t) {
|
||
const b = document.getElementById('sTerm');
|
||
const d = document.createElement('div');
|
||
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
|
||
b.appendChild(d);
|
||
b.scrollTop = b.scrollHeight;
|
||
}
|
||
function openSSheet() { document.getElementById('sSheetMask').classList.add('open'); sLog("从底部抽拉展开【选择设备】面板..."); }
|
||
function closeSSheet() { document.getElementById('sSheetMask').classList.remove('open'); }
|
||
function sPick(n, m) {
|
||
closeSSheet();
|
||
sLog(`建立遥测通道 [${n}]...`);
|
||
setTimeout(() => {
|
||
document.getElementById('sName').innerText = n;
|
||
document.getElementById('sMac').innerText = m;
|
||
document.getElementById('sBat').innerText = "95% (高能)";
|
||
document.getElementById('sFw').innerText = "v2.1.04";
|
||
document.getElementById('sTag').innerText = "状态:已连接";
|
||
document.getElementById('sTag').style.color = "#F59E0B";
|
||
document.getElementById('sDisBtn').classList.add('active');
|
||
sLog(`手环 [${n}] 实时遥测数据流建立!`);
|
||
}, 500);
|
||
}
|
||
function sDis() {
|
||
document.getElementById('sName').innerText = "未连接";
|
||
document.getElementById('sMac').innerText = "设备ID: 未知";
|
||
document.getElementById('sBat').innerText = "电量: 未知";
|
||
document.getElementById('sFw').innerText = "固件版本: 未知";
|
||
document.getElementById('sTag').innerText = "状态:未连接";
|
||
document.getElementById('sDisBtn').classList.remove('active');
|
||
sLog("正在主动断开连接...");
|
||
}
|
||
function sReset() { sLog("重置指令已发送..."); alert("手环重置请求已发送!"); }
|
||
function sSaveHr() { sLog("保存心率预警阈值成功!"); alert("心率预警阈值保存成功!"); }
|
||
function sSync() { sLog("拉取离线数据帧完成!"); alert("历史离线数据同步完成!"); }
|
||
</script>
|
||
</body>
|
||
</html>
|