feat(ui): 交付手环配置并完成已修改页面的主色蓝统一优化(语言设置、版型切换、心率区间设置、自动连接配置、手环配置)

【已完成优化与色彩统一的页面清单】:
1. 语言设置(完成主色蓝统一 #2563EB,单选框/指示条/文字/图标底色对齐,重新渲染 image.png)
2. 版型切换(完成主色蓝统一 #2563EB,消除偏紫杂色,选中边框/单选框/标题对齐,重新渲染 image.png)
3. 心率区间设置(完成主色蓝统一 #2563EB,年龄数值与Slider滑块对齐,重新渲染 image.png)
4. 自动连接配置(完成主色蓝统一 #2563EB,重新渲染 image.png)
5. 手环配置(全新交付6件套标准物料,采用流体双栏架构、居中底部抽拉式Sheet、动态雷达声呐、右下角蓝牙FAB、BLE直连标签与实时同步日志控制台,主色蓝统一 #2563EB)

【全局规范更新】:
- README.md 固化《全局核心主色蓝统一规范》,所有蓝色元素 100% 严格收敛为 #2563EB
This commit is contained in:
zhy200308
2026-08-17 17:15:54 +08:00
parent c50d6f00f5
commit 16e3a2e698
24 changed files with 2866 additions and 18 deletions
@@ -0,0 +1,630 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 1:Apple HealthKit 灵动岛屿 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #2563EB;
--primary-light: #EFF6FF;
--primary-glow: rgba(37, 99, 235, 0.2);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #EF4444;
--danger-light: #FEF2F2;
--success: #10B981;
--terminal-bg: #0F172A;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
background: var(--bg);
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: 24px;
border: 1px solid var(--divider);
box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08);
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: var(--surface);
flex-shrink: 0;
}
.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; transition: all 0.15s ease;
}
.appbar-nav:hover, .appbar-more:hover { background: rgba(15, 23, 42, 0.06); transform: scale(0.96); }
.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; }
/* 2列非对称现代仪表盘 */
.main-dashboard {
flex: 1;
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1.15fr;
gap: clamp(16px, 2vw, 24px);
background: #F8FAFC;
overflow-y: auto;
max-height: 660px;
}
.dash-col { display: flex; flex-direction: column; gap: 18px; }
.health-card {
background: var(--surface);
border-radius: 18px;
border: 1.5px solid var(--divider);
padding: 20px 22px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
display: flex;
flex-direction: column;
gap: 14px;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
padding-bottom: 12px;
}
.card-title-wrap {
display: flex;
align-items: center;
gap: 10px;
}
.card-icon {
width: 32px;
height: 32px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.icon-blue { background: #EFF6FF; fill: #2563EB; }
.icon-red { background: #FEF2F2; fill: #EF4444; }
.icon-green { background: #ECFDF5; fill: #10B981; }
.card-title-text { font-size: 15.5px; font-weight: 700; color: var(--text-main); }
.status-pill {
font-size: 11.5px;
font-weight: 700;
padding: 3px 8px;
border-radius: 100px;
background: #F1F5F9;
color: var(--text-sub);
}
.status-pill.connected { background: #ECFDF5; color: #10B981; }
/* 遥测参数流 */
.telemetry-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.tele-cell {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 12px;
padding: 10px 14px;
}
.tele-lbl { font-size: 11.5px; color: var(--text-sub); }
.tele-val { font-size: 14px; font-weight: 700; color: var(--text-main); margin-top: 3px; font-family: ui-monospace, monospace; }
.action-line {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 2px;
}
.btn-text-danger { color: var(--danger); background: transparent; border: none; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px; }
.btn-action-primary {
background: #E2E8F0;
color: var(--text-sub);
border: none;
padding: 8px 18px;
border-radius: 10px;
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: all 0.2s;
}
.btn-action-primary.active { background: var(--primary); color: white; box-shadow: 0 4px 12px var(--primary-glow); }
/* 心率调节卡片 */
.hr-stack {
display: flex;
flex-direction: column;
gap: 10px;
}
.hr-row-card {
background: #F8FAFC;
border: 1px solid var(--divider);
border-radius: 12px;
padding: 10px 14px;
display: flex;
align-items: center;
justify-content: space-between;
}
.hr-row-name { font-size: 13px; font-weight: 600; }
.hr-select-pill {
background: white;
border: 1.5px solid var(--divider);
border-radius: 8px;
padding: 5px 28px 5px 12px;
font-size: 13.5px;
font-weight: 700;
color: var(--primary);
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
cursor: pointer;
}
.btn-wide {
width: 100%;
padding: 11px;
border-radius: 10px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
border: none;
transition: all 0.2s;
}
.btn-wide.secondary { background: #E2E8F0; color: #334155; }
.btn-wide.primary { background: var(--primary); color: white; box-shadow: 0 4px 14px var(--primary-glow); }
/* 控制台终端 */
.terminal-hud {
background: var(--terminal-bg);
border-radius: 12px;
border: 1px solid #1E293B;
padding: 12px 14px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 11.5px;
color: #94A3B8;
height: 140px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 4px;
}
.term-line { line-height: 1.5; }
.term-line.info { color: #38BDF8; }
.term-line.success { color: #4ADE80; }
.term-line.warn { color: #FBBF24; }
/* Switch 开关 */
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
background-color: #CBD5E1; transition: .25s; border-radius: 24px;
}
.slider:before {
position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
background-color: white; transition: .25s; border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }
/* 右下角悬浮蓝牙按钮 (FAB) */
.bt-floating-btn {
position: absolute;
bottom: 24px;
right: 24px;
width: 52px;
height: 52px;
border-radius: 16px;
background: var(--surface);
border: 1.5px solid var(--divider);
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
z-index: 40;
}
.bt-floating-btn:hover {
transform: scale(1.08) translateY(-2px);
border-color: var(--primary);
box-shadow: 0 14px 28px var(--primary-glow);
}
.bt-floating-btn svg { width: 24px; height: 24px; fill: var(--primary); }
/* =========================================================================
【核心升级】从底部滑出的抽拉式 Sheet (Bottom Sheet)
========================================================================= */
.bottom-sheet-mask {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.45);
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: var(--surface);
border-radius: 28px 28px 0 0;
border-top: 1.5px solid var(--divider);
box-shadow: 0 -15px 40px rgba(15, 23, 42, 0.2);
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: 5px;
border-radius: 10px;
background: #CBD5E1;
margin: 10px auto 4px;
cursor: grab;
}
.sheet-head {
padding: 12px 24px 14px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--divider);
}
/* 动态雷达声呐图标 */
.radar-box {
position: relative;
width: 34px;
height: 34px;
border-radius: 50%;
background: #EFF6FF;
display: flex;
align-items: center;
justify-content: center;
}
.radar-wave-ring {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid var(--primary);
animation: radarWave 1.8s infinite ease-out;
}
@keyframes radarWave {
0% { transform: scale(0.6); opacity: 1; }
100% { transform: scale(1.6); opacity: 0; }
}
.radar-box svg { width: 18px; height: 18px; fill: var(--primary); z-index: 2; }
.sheet-chips-line {
padding: 10px 24px;
background: #F8FAFC;
display: flex;
gap: 8px;
border-bottom: 1px solid var(--divider);
overflow-x: auto;
}
.s-chip {
padding: 5px 12px;
border-radius: 100px;
font-size: 12px;
font-weight: 600;
border: 1px solid var(--divider);
background: white;
cursor: pointer;
white-space: nowrap;
}
.s-chip.active { background: var(--primary-light); color: var(--primary); border-color: #BFDBFE; }
.sheet-device-list {
padding: 14px 24px;
display: flex;
flex-direction: column;
gap: 10px;
overflow-y: auto;
max-height: 220px;
}
.sheet-dev-card {
border: 1.5px solid var(--divider);
border-radius: 14px;
padding: 12px 16px;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
transition: all 0.15s ease;
cursor: pointer;
}
.sheet-dev-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); }
.sheet-foot {
padding: 14px 24px 20px;
border-top: 1px solid var(--divider);
background: #F8FAFC;
}
.btn-pause-scan {
width: 100%;
background: #DCFCE7;
color: #15803D;
border: 1px solid #BBF7D0;
padding: 10px;
border-radius: 12px;
font-size: 13.5px;
font-weight: 700;
cursor: pointer;
}
</style>
</head>
<body>
<div class="device-wrapper">
<!-- AppBar 统一规范 -->
<header class="appbar">
<div class="appbar-left">
<button class="appbar-nav" title="返回"><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="main-dashboard">
<!-- 左列:设备信息与心率预警 -->
<div class="dash-col">
<!-- 1. 手环设备信息 -->
<section class="health-card">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-blue"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg></div>
<span class="card-title-text">手环设备信息</span>
</div>
<span class="status-pill" id="connTag">状态:未连接</span>
</div>
<div class="telemetry-grid">
<div class="tele-cell"><div class="tele-lbl">设备名称:</div><div class="tele-val" id="valName">未连接</div></div>
<div class="tele-cell"><div class="tele-lbl">MAC 地址:</div><div class="tele-val" id="valMac">设备ID: 未知</div></div>
<div class="tele-cell"><div class="tele-lbl">设备电量:</div><div class="tele-val" id="valBat">电量: 未知</div></div>
<div class="tele-cell"><div class="tele-lbl">固件版本:</div><div class="tele-val" id="valFw">固件版本: 未知</div></div>
</div>
<div class="action-line">
<button class="btn-text-danger" onclick="triggerReset()">重置手环</button>
<button class="btn-action-primary" id="btnDisconnect" onclick="toggleConnect()">断开连接</button>
</div>
</section>
<!-- 2. 心率预警设置 -->
<section class="health-card">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-red"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg></div>
<span class="card-title-text">心率预警设置</span>
</div>
<label class="switch"><input type="checkbox" id="swHr" checked onchange="toggleHr()"><span class="slider"></span></label>
</div>
<div class="hr-stack">
<div class="hr-row-card"><span class="hr-row-name">最低心率 (Min):</span><select class="hr-select-pill" id="selMin"><option>40</option><option>50</option><option>60</option></select></div>
<div class="hr-row-card"><span class="hr-row-name">最高心率 (Max):</span><select class="hr-select-pill" id="selMax"><option>40</option><option selected>180</option></select></div>
<div class="hr-row-card"><span class="hr-row-name">心率目标 (Goal):</span><select class="hr-select-pill" id="selGoal"><option>40</option><option selected>140</option></select></div>
</div>
<button class="btn-wide secondary" onclick="saveHrThresholds()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;" id="statusHint">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列:历史离线数据同步与终端日志 -->
<div class="dash-col">
<section class="health-card" style="flex: 1;">
<div class="card-header">
<div class="card-title-wrap">
<div class="card-icon icon-green"><svg width="18" height="18" viewBox="0 0 24 24"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></div>
<span class="card-title-text">历史离线数据同步</span>
</div>
</div>
<div class="hr-row-card">
<span class="hr-row-name">选择同步的时间段:</span>
<select class="hr-select-pill" id="selSyncDur"><option>过去 1 小时</option><option>过去 6 小时</option><option>过去 24 小时</option></select>
</div>
<button class="btn-wide primary" onclick="syncOfflineData()">一键同步历史心率/运动</button>
<div style="display: flex; flex-direction: column; gap: 8px; margin-top: 6px; flex: 1;">
<span style="font-size: 13px; font-weight: 700; color: var(--text-main);">同步日志控制台</span>
<div class="terminal-hud" id="termConsole">
<div class="term-line info">[SYS] 蓝牙驱动就绪,等待手环连接指令...</div>
<div class="term-line">正在主动断开连接...</div>
</div>
</div>
</section>
</div>
</main>
<!-- 右下角悬浮蓝牙按钮 (FAB) -->
<button class="bt-floating-btn" onclick="openBottomSheet()" title="扫描并选择手环">
<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 (Bottom Sheet) -->
<div class="bottom-sheet-mask" id="sheetMask" onclick="if(event.target===this) closeBottomSheet()">
<div class="bottom-sheet">
<div class="sheet-handle-bar"></div>
<div class="sheet-head">
<div style="display: flex; align-items: center; gap: 10px;">
<div class="radar-box">
<div class="radar-wave-ring"></div>
<svg viewBox="0 0 24 24"><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: 16px; font-weight: 700;">选择设备</h2>
</div>
<span style="cursor: pointer; font-size: 16px; color: var(--text-sub);" onclick="closeBottomSheet()">✕</span>
</div>
<div class="sheet-chips-line">
<span class="s-chip active">✓ 扫描顺序</span>
<span class="s-chip">名称</span>
<span class="s-chip">信号强度</span>
<span class="s-chip">类型</span>
</div>
<div class="sheet-device-list">
<div class="sheet-dev-card" onclick="connectDevice('CL831-62200026', 'D9:24:0F:1C:55:FA', '88%')">
<div>
<div style="font-weight: 700; font-family: monospace; font-size: 14px;">CL831-62200026 <span style="background: #EFF6FF; color: var(--primary); font-size: 10.5px; padding: 2px 6px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 2px;">D9:24:0F:1C:55:FA · 信号: -89 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer;">连接</button>
</div>
<div class="sheet-dev-card" onclick="connectDevice('CL831-2200006', 'DF:16:BC:22:2E:5B', '95%')">
<div>
<div style="font-weight: 700; font-family: monospace; font-size: 14px;">CL831-2200006 <span style="background: #EFF6FF; color: var(--primary); font-size: 10.5px; padding: 2px 6px; border-radius: 4px;">BLE</span></div>
<div style="font-size: 11.5px; color: var(--text-sub); margin-top: 2px;">DF:16:BC:22:2E:5B · 信号: -98 dBm</div>
</div>
<button style="background: var(--primary); color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer;">连接</button>
</div>
</div>
<div class="sheet-foot">
<button class="btn-pause-scan" id="btnScan" onclick="toggleScan()">暂停扫描</button>
</div>
</div>
</div>
</div>
<script>
let isConnected = false;
let isScanning = true;
function appendLog(t, type = '') {
const c = document.getElementById('termConsole');
const d = document.createElement('div');
d.className = `term-line ${type}`;
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
c.appendChild(d);
c.scrollTop = c.scrollHeight;
}
function openBottomSheet() {
document.getElementById('sheetMask').classList.add('open');
appendLog("从底部抽拉展开【选择设备】面板,雷达声呐正在扫描周围 BLE 广播...", "info");
}
function closeBottomSheet() {
document.getElementById('sheetMask').classList.remove('open');
}
function toggleScan() {
const b = document.getElementById('btnScan');
isScanning = !isScanning;
if (isScanning) {
b.innerText = "暂停扫描";
b.style.background = "#DCFCE7";
b.style.color = "#15803D";
appendLog("已恢复 BLE 设备雷达广播扫描...", "info");
} else {
b.innerText = "继续扫描";
b.style.background = "#FEF3C7";
b.style.color = "#D97706";
appendLog("已暂停 BLE 广播扫描。", "warn");
}
}
function connectDevice(name, mac, bat) {
closeBottomSheet();
appendLog(`正在尝试连接手环 [${name} | ${mac}]...`, "info");
setTimeout(() => {
isConnected = true;
document.getElementById('valName').innerText = name;
document.getElementById('valMac').innerText = mac;
document.getElementById('valBat').innerText = `${bat} (正常)`;
document.getElementById('valFw').innerText = "v2.1.04-BLE";
document.getElementById('connTag').innerText = "状态:已连接";
document.getElementById('connTag').classList.add('connected');
document.getElementById('btnDisconnect').classList.add('active');
document.getElementById('statusHint').innerText = `● 设备已在线 [${name}]`;
appendLog(`成功建立 GATT 通信!手环 [${name}] 在线,电量: ${bat}`, "success");
}, 600);
}
function toggleConnect() {
if (!isConnected) { openBottomSheet(); return; }
isConnected = false;
document.getElementById('valName').innerText = "未连接";
document.getElementById('valMac').innerText = "设备ID: 未知";
document.getElementById('valBat').innerText = "电量: 未知";
document.getElementById('valFw').innerText = "固件版本: 未知";
document.getElementById('connTag').innerText = "状态:未连接";
document.getElementById('connTag').classList.remove('connected');
document.getElementById('btnDisconnect').classList.remove('active');
document.getElementById('statusHint').innerText = "● 正在主动断开连接...";
appendLog("正在主动断开连接... 设备已释放。", "warn");
}
function triggerReset() {
appendLog("向手环发送恢复出厂设置指令 (Factory Reset)...", "warn");
alert("手环重置指令已成功下发!");
}
function toggleHr() {
const v = document.getElementById('swHr').checked;
appendLog(`心率预警开关切换为: ${v ? '开启' : '关闭'}`, "info");
}
function saveHrThresholds() {
const min = document.getElementById('selMin').value;
const max = document.getElementById('selMax').value;
const goal = document.getElementById('selGoal').value;
appendLog(`写入心率预警阈值 -> Min: ${min} BPM | Max: ${max} BPM | Goal: ${goal} BPM`, "success");
alert("心率预警阈值已保存生效!");
}
function syncOfflineData() {
if (!isConnected) {
appendLog("同步中断:请先连接手环设备。", "warn");
openBottomSheet();
return;
}
const dur = document.getElementById('selSyncDur').value;
appendLog(`正在同步 [${dur}] 历史离线数据包...`, "info");
setTimeout(() => {
appendLog(`历史离线数据包已同步入库:读取 280 个心率帧,CRC 校验通过。`, "success");
alert("历史离线数据同步完成!");
}, 1000);
}
</script>
</body>
</html>
@@ -0,0 +1,298 @@
<!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>
@@ -0,0 +1,281 @@
<!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>
@@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 4:Nordic Slate 极简极净风格 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #0F766E;
--primary-light: #F0FDFA;
--bg: #F8FAFC;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #E11D48;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #F1F5F9;
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: 24px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.06);
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: var(--surface);
}
.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(0, 0, 0, 0.04); }
.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; }
/* 极简双列仪表盘 */
.nordic-dash {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
flex: 1;
background: #FAFAFA;
overflow-y: auto;
max-height: 660px;
}
.nordic-card {
background: #FFFFFF;
border: 1px solid var(--divider);
border-radius: 16px;
padding: 22px;
display: flex;
flex-direction: column;
gap: 16px;
}
.n-head {
display: flex; align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--divider); padding-bottom: 10px;
}
.n-title { font-size: 15.5px; font-weight: 700; color: var(--primary); }
.n-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.n-box { background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.n-action-row { display: flex; justify-content: space-between; align-items: center; }
.btn-n-danger { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-n-primary { background: #F1F5F9; color: var(--text-sub); border: 1px solid var(--divider); border-radius: 8px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.btn-n-primary.active { background: var(--primary); color: white; border-color: var(--primary); }
.hr-n-row { display: flex; flex-direction: column; gap: 8px; }
.hr-n-box { display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); border-radius: 8px; padding: 10px 14px; }
.hr-n-select { border: 1px solid var(--divider); border-radius: 6px; padding: 4px 10px; font-weight: 700; background: white; }
.btn-n-wide {
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1px solid var(--divider);
background: #F1F5F9; color: var(--text-main);
}
.btn-n-wide.teal { background: var(--primary); color: white; border: none; }
.nordic-term {
background: #0F172A; border-radius: 10px; padding: 12px 14px; font-family: monospace; font-size: 11.5px; color: #2DD4BF;
height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-nordic {
position: absolute; bottom: 24px; right: 24px; width: 50px; height: 50px; border-radius: 16px;
background: var(--primary); box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
}
.fab-nordic svg { width: 24px; height: 24px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.4); 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: #FFFFFF; border-radius: 28px 28px 0 0; border-top: 1px solid var(--divider);
box-shadow: 0 -15px 40px rgba(15, 23, 42, 0.15); 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: #CBD5E1; margin: 10px auto 4px; }
.radar-nordic-icon {
position: relative; width: 32px; height: 32px; border-radius: 50%; background: #F0FDFA;
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="nordic-dash">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="nordic-card">
<div class="n-head">
<span class="n-title">手环设备信息</span>
<span id="nTag" style="font-size: 12px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="n-grid">
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">设备名称:</div><div style="font-weight: 700; margin-top: 2px;" id="nName">未连接</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">MAC 地址:</div><div style="font-weight: 700; margin-top: 2px;" id="nMac">设备ID: 未知</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">设备电量:</div><div style="font-weight: 700; margin-top: 2px;" id="nBat">电量: 未知</div></div>
<div class="n-box"><div style="font-size: 11.5px; color: var(--text-sub);">固件版本:</div><div style="font-weight: 700; margin-top: 2px;" id="nFw">固件版本: 未知</div></div>
</div>
<div class="n-action-row">
<button class="btn-n-danger" onclick="nReset()">重置手环</button>
<button class="btn-n-primary" id="nDisBtn" onclick="nDis()">断开连接</button>
</div>
</section>
<section class="nordic-card">
<div class="n-head">
<span class="n-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--primary);">
</div>
<div class="hr-n-row">
<div class="hr-n-box"><span>最低心率 (Min):</span><select class="hr-n-select"><option>40</option></select></div>
<div class="hr-n-box"><span>最高心率 (Max):</span><select class="hr-n-select"><option>180</option></select></div>
<div class="hr-n-box"><span>心率目标 (Goal):</span><select class="hr-n-select"><option>140</option></select></div>
</div>
<button class="btn-n-wide" onclick="nSaveHr()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;">正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="nordic-card" style="flex: 1;">
<div class="n-head"><span class="n-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); padding: 10px 14px; border-radius: 8px;">
<span style="font-size: 13px; font-weight: 600;">选择同步的时间段:</span>
<select class="hr-n-select"><option>过去 1 小时</option></select>
</div>
<button class="btn-n-wide teal" onclick="nSync()">一键同步历史心率/运动</button>
<span style="font-size: 13px; font-weight: 700; color: var(--text-main); margin-top: 4px;">同步日志控制台</span>
<div class="nordic-term" id="nTerm">
<div>[NORDIC] 设备总线就绪...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-nordic" onclick="openNSheet()"><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="nSheetMask" onclick="if(event.target===this) closeNSheet()">
<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-nordic-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#0F766E"><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;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeNSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); padding: 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="nPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: #F0FDFA; 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: 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 nLog(t) {
const b = document.getElementById('nTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openNSheet() { document.getElementById('nSheetMask').classList.add('open'); nLog("从底部抽拉展开【选择设备】面板..."); }
function closeNSheet() { document.getElementById('nSheetMask').classList.remove('open'); }
function nPick(n, m) {
closeNSheet();
nLog(`连接手环 [${n}]...`);
setTimeout(() => {
document.getElementById('nName').innerText = n;
document.getElementById('nMac').innerText = m;
document.getElementById('nBat').innerText = "88%";
document.getElementById('nFw').innerText = "v2.1.04";
document.getElementById('nTag').innerText = "状态:已连接";
document.getElementById('nTag').style.color = "#0F766E";
document.getElementById('nDisBtn').classList.add('active');
nLog(`手环 [${n}] 连接成功!`);
}, 500);
}
function nDis() {
document.getElementById('nName').innerText = "未连接";
document.getElementById('nMac').innerText = "设备ID: 未知";
document.getElementById('nBat').innerText = "电量: 未知";
document.getElementById('nFw').innerText = "固件版本: 未知";
document.getElementById('nTag').innerText = "状态:未连接";
document.getElementById('nDisBtn').classList.remove('active');
nLog("正在主动断开连接...");
}
function nReset() { nLog("下发重置指令..."); alert("手环重置请求已发送!"); }
function nSaveHr() { nLog("保存心率预警阈值成功!"); alert("心率预警保存成功!"); }
function nSync() { nLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,291 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>方案 5:Fluid Modern Studio 流体工作室 + 底部抽拉 Sheet</title>
<style>
:root {
--primary: #2563EB;
--primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
--bg: #EEF2F6;
--surface: #FFFFFF;
--text-main: #0F172A;
--text-sub: #64748B;
--divider: #E2E8F0;
--danger: #EF4444;
--success: #10B981;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
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: 24px;
border: 1px solid var(--divider);
box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
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: var(--surface);
}
.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(15, 23, 42, 0.06); }
.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; }
/* 现代流体双栏 */
.fluid-studio {
padding: clamp(20px, 2.5vw, 28px);
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(16px, 2vw, 24px);
flex: 1;
background: #F8FAFC;
overflow-y: auto;
max-height: 660px;
}
.studio-card {
background: var(--surface);
border: 1.5px solid var(--divider);
border-radius: 18px;
padding: 22px;
display: flex;
flex-direction: column;
gap: 16px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}
.card-head {
display: flex; align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--divider); padding-bottom: 12px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell-box { background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.cell-k { font-size: 11.5px; color: var(--text-sub); }
.cell-v { font-size: 14px; font-weight: 700; color: var(--text-main); margin-top: 2px; font-family: monospace; }
.btn-row { display: flex; justify-content: space-between; align-items: center; }
.btn-red-link { color: var(--danger); background: transparent; border: none; font-weight: 700; cursor: pointer; }
.btn-dis-pill { background: #E2E8F0; color: var(--text-sub); border: none; border-radius: 8px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.btn-dis-pill.active { background: var(--primary-gradient); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.hr-box-list { display: flex; flex-direction: column; gap: 8px; }
.hr-box-item { display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); border-radius: 10px; padding: 10px 14px; }
.hr-select { background: white; border: 1.5px solid var(--divider); border-radius: 6px; padding: 4px 10px; font-weight: 700; color: var(--primary); }
.btn-fluid-wide {
width: 100%; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
background: #E2E8F0; color: #334155;
}
.btn-fluid-wide.blue { background: var(--primary-gradient); color: white; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35); }
.terminal-stream {
background: #0F172A; border-radius: 12px; padding: 12px 14px; font-family: monospace; font-size: 11.5px; color: #38BDF8;
height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* FAB */
.fab-studio {
position: absolute; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 16px;
background: var(--primary-gradient); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; z-index: 40;
}
.fab-studio svg { width: 24px; height: 24px; fill: white; }
/* 底部抽拉式 Sheet */
.bottom-sheet-mask {
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(15, 23, 42, 0.45); 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: 50%;
transform: translateX(-50%) translateY(100%);
width: min(92%, 560px);
background: #FFFFFF;
border-radius: 24px 24px 0 0;
border: 1.5px solid var(--divider);
border-bottom: none;
box-shadow: 0 -16px 45px rgba(15, 23, 42, 0.18);
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: translateX(-50%) translateY(0); }
.sheet-handle-bar { width: 44px; height: 4px; border-radius: 4px; background: #CBD5E1; margin: 10px auto 4px; }
.radar-fluid-icon {
position: relative; width: 32px; height: 32px; border-radius: 50%; background: #EFF6FF;
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="fluid-studio">
<!-- 左列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="studio-card">
<div class="card-head">
<span class="card-title">手环设备信息</span>
<span id="fTag" style="font-size: 12px; color: var(--text-sub);">状态:未连接</span>
</div>
<div class="grid-2x2">
<div class="cell-box"><div class="cell-k">设备名称:</div><div class="cell-v" id="fName">未连接</div></div>
<div class="cell-box"><div class="cell-k">MAC 地址:</div><div class="cell-v" id="fMac">设备ID: 未知</div></div>
<div class="cell-box"><div class="cell-k">设备电量:</div><div class="cell-v" id="fBat">电量: 未知</div></div>
<div class="cell-box"><div class="cell-k">固件版本:</div><div class="cell-v" id="fFw">固件版本: 未知</div></div>
</div>
<div class="btn-row">
<button class="btn-red-link" onclick="fReset()">重置手环</button>
<button class="btn-dis-pill" id="fDisBtn" onclick="fDis()">断开连接</button>
</div>
</section>
<section class="studio-card">
<div class="card-head">
<span class="card-title">心率预警设置</span>
<input type="checkbox" checked style="accent-color: var(--primary);">
</div>
<div class="hr-box-list">
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">最低心率 (Min):</span><select class="hr-select"><option>40</option></select></div>
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">最高心率 (Max):</span><select class="hr-select"><option>180</option></select></div>
<div class="hr-box-item"><span style="font-size: 13px; font-weight: 600;">心率目标 (Goal):</span><select class="hr-select"><option>140</option></select></div>
</div>
<button class="btn-fluid-wide" onclick="fSaveHr()">保存警报阈值</button>
<div style="font-size: 12px; color: #10B981; font-weight: 600;">● 正在主动断开连接...</div>
</section>
</div>
<!-- 右列 -->
<div style="display: flex; flex-direction: column; gap: 16px;">
<section class="studio-card" style="flex: 1;">
<div class="card-head"><span class="card-title">历史离线数据同步</span></div>
<div style="display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: 1px solid var(--divider); padding: 10px 14px; border-radius: 8px;">
<span style="font-size: 13px; font-weight: 600;">选择同步的时间段:</span>
<select class="hr-select"><option>过去 1 小时</option></select>
</div>
<button class="btn-fluid-wide blue" onclick="fSync()">一键同步历史心率/运动</button>
<span style="font-size: 13px; font-weight: 700; color: var(--text-main); margin-top: 4px;">同步日志控制台</span>
<div class="terminal-stream" id="fTerm">
<div>[STUDIO] 离线数据同步管道已建立...</div>
<div>正在主动断开连接...</div>
</div>
</section>
</div>
</main>
<!-- FAB -->
<button class="fab-studio" onclick="openFSheet()"><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="fSheetMask" onclick="if(event.target===this) closeFSheet()">
<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-fluid-icon"><div class="radar-ring"></div><svg width="16" height="16" viewBox="0 0 24 24" fill="#2563EB"><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;">选择设备</h2>
</div>
<span style="cursor: pointer;" onclick="closeFSheet()">✕</span>
</div>
<div style="padding: 14px 20px; display: flex; flex-direction: column; gap: 8px;">
<div style="border: 1px solid var(--divider); padding: 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;" onclick="fPick('CL831-62200026', 'D9:24:0F:1C:55:FA')">
<div>
<div style="font-weight: 700; font-family: monospace;">CL831-62200026 <span style="background: #EFF6FF; 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: 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 fLog(t) {
const b = document.getElementById('fTerm');
const d = document.createElement('div');
d.innerText = `[${new Date().toTimeString().split(' ')[0]}] ${t}`;
b.appendChild(d);
b.scrollTop = b.scrollHeight;
}
function openFSheet() { document.getElementById('fSheetMask').classList.add('open'); fLog("从底部抽拉展开【选择设备】面板..."); }
function closeFSheet() { document.getElementById('fSheetMask').classList.remove('open'); }
function fPick(n, m) {
closeFSheet();
fLog(`建立连接 [${n}]...`);
setTimeout(() => {
document.getElementById('fName').innerText = n;
document.getElementById('fMac').innerText = m;
document.getElementById('fBat').innerText = "88% (正常)";
document.getElementById('fFw').innerText = "v2.1.04";
document.getElementById('fTag').innerText = "状态:已连接";
document.getElementById('fTag').style.color = "#10B981";
document.getElementById('fDisBtn').classList.add('active');
fLog(`手环 [${n}] 已连接在线!`);
}, 500);
}
function fDis() {
document.getElementById('fName').innerText = "未连接";
document.getElementById('fMac').innerText = "设备ID: 未知";
document.getElementById('fBat').innerText = "电量: 未知";
document.getElementById('fFw').innerText = "固件版本: 未知";
document.getElementById('fTag').innerText = "状态:未连接";
document.getElementById('fDisBtn').classList.remove('active');
fLog("正在主动断开连接...");
}
function fReset() { fLog("发送重置指令..."); alert("手环重置请求已发送!"); }
function fSaveHr() { fLog("保存心率预警阈值成功!"); alert("心率预警保存成功!"); }
function fSync() { fLog("离线同步历史数据完成!"); alert("历史离线数据同步完成!"); }
</script>
</body>
</html>
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>【手环配置】全新架构 5 套竞标方案全景对比看板 (支持底部抽拉 Sheet 与实时日志交互)</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
background: #0F172A;
color: #F8FAFC;
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
padding: 14px 24px;
background: #1E293B;
border-bottom: 1px solid #334155;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
h1 { font-size: 16.5px; font-weight: 700; color: #38BDF8; white-space: nowrap; }
.tabs { display: flex; gap: 8px; overflow-x: auto; }
.tab-btn {
padding: 8px 14px;
background: #334155;
color: #CBD5E1;
border: 1px solid #475569;
border-radius: 8px;
cursor: pointer;
font-size: 12.5px;
font-weight: 600;
white-space: nowrap;
transition: all 0.2s;
}
.tab-btn:hover { background: #475569; color: #FFF; }
.tab-btn.active { background: #2563EB; color: #FFF; border-color: #3B82F6; box-shadow: 0 0 12px rgba(37, 99, 235, 0.4); }
.preview-container {
flex: 1;
display: flex;
position: relative;
}
iframe {
width: 100%;
height: calc(100vh - 65px);
border: none;
background: #EEF2F6;
}
</style>
</head>
<body>
<header>
<h1>【手环配置】全新 5 套竞标方案(支持底部抽拉 Sheet & 交互控制台)</h1>
<div class="tabs">
<button class="tab-btn active" onclick="loadFrame('option_1_ipados_island.html', this)">方案 1:Apple HealthKit Pro 灵动双栏 (推荐)</button>
<button class="tab-btn" onclick="loadFrame('option_2_neo_bento.html', this)">方案 2:Linear Precision 极客网格</button>
<button class="tab-btn" onclick="loadFrame('option_3_cyber_obsidian.html', this)">方案 3:Sport Racing 运动遥测风</button>
<button class="tab-btn" onclick="loadFrame('option_4_nordic_slate.html', this)">方案 4:Nordic Slate 极简极净风格</button>
<button class="tab-btn" onclick="loadFrame('option_5_master_detail_hub.html', this)">方案 5:Fluid Studio 流体双栏</button>
</div>
</header>
<div class="preview-container">
<iframe id="main-frame" src="option_1_ipados_island.html"></iframe>
</div>
<script>
function loadFrame(src, btn) {
document.getElementById('main-frame').src = src;
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB