-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathios2.html
More file actions
513 lines (448 loc) · 15.2 KB
/
Copy pathios2.html
File metadata and controls
513 lines (448 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<title>设备资产中心</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.12.2/lottie.min.js"></script>
<style>
/* iOS 基础重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
}
body {
/* 纯正的 iOS 深色模式背景色 */
background-color: #000000;
color: #FFFFFF;
/* 强制调用 Apple 原生系统字体 SF Pro */
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
padding: 32px 40px;
overflow-x: hidden;
}
/* 顶部大标题 (类似 iOS 设置应用) */
.header {
margin-bottom: 24px;
padding-left: 4px;
}
h1 {
font-size: 34px;
font-weight: 700;
letter-spacing: 0.4px;
}
#time {
margin-top: 6px;
/* iOS 次级文本标准灰色 */
color: #8E8E93;
font-size: 15px;
font-weight: 500;
}
/* 顶部小组件网格 (Widgets) */
.dashboard-top {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 16px;
margin-bottom: 32px;
}
.dash-card {
/* iOS 经典的二级卡片底色 */
background-color: #1C1C1E;
border-radius: 24px;
padding: 22px 24px;
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
/* 丝滑的果味弹性动画 */
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.2s ease;
cursor: pointer;
}
.dash-card:active {
transform: scale(0.96);
background-color: #2C2C2E;
}
/* 核心枢纽:Apple 标志性的鲜艳渐变卡片 */
.core-card {
background: linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);
box-shadow: 0 10px 30px rgba(10, 132, 255, 0.2);
}
.core-card:active {
background: linear-gradient(135deg, #0970D9 0%, #4D4BB3 100%);
transform: scale(0.98);
}
.dash-card .label {
font-size: 13px;
font-weight: 600;
color: #8E8E93;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 8px;
z-index: 2;
}
/* 核心卡片的次级文字需要白色半透明以适应渐变背景 */
.core-card .label {
color: rgba(255, 255, 255, 0.7);
}
.dash-card .value {
font-size: 34px;
font-weight: 700;
color: #FFFFFF;
line-height: 1.2;
z-index: 2;
font-variant-numeric: tabular-nums;
}
.core-card .coreTitle {
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
margin-bottom: 4px;
z-index: 2;
letter-spacing: 0.2px;
}
.core-card .value {
font-size: 42px;
font-weight: 700;
letter-spacing: -0.5px;
}
/* Lottie 动画容器,移除老旧滤镜,加一点阴影融入环境 */
#lottie-core {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
width: 85px;
height: 85px;
pointer-events: none;
z-index: 1;
filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
opacity: 0.9;
}
.support-card .title {
font-size: 16px;
font-weight: 600;
color: #FFFFFF;
margin-bottom: 6px;
}
.support-card .value {
font-size: 15px;
font-weight: 500;
color: #0A84FF; /* iOS 原生蓝 */
}
/* 底部设备网格 */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
gap: 16px;
}
.card {
background-color: #1C1C1E;
border-radius: 24px;
padding: 24px;
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
cursor: pointer;
}
.card:active {
transform: scale(0.97);
}
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.status {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
font-weight: 600;
color: #8E8E93;
}
/* iOS 风格的指示灯 */
.dot {
width: 8px;
height: 8px;
border-radius: 50%;
}
.green {
background-color: #32D74B; /* iOS 原生绿 */
box-shadow: 0 0 8px rgba(50, 215, 75, 0.5);
}
.gray {
background-color: #636366;
}
.type {
font-size: 13px;
font-weight: 600;
color: #0A84FF;
text-transform: uppercase;
letter-spacing: 0.3px;
}
.name {
font-size: 22px;
font-weight: 600;
letter-spacing: -0.4px;
margin-bottom: 16px;
color: #FFFFFF;
}
.days {
font-size: 44px;
font-weight: 700;
color: #FFFFFF;
letter-spacing: -1px;
line-height: 1;
font-variant-numeric: tabular-nums;
margin-bottom: 8px;
}
.runtime {
font-size: 15px;
font-weight: 500;
color: #EBEBF5; /* iOS 次级文字的高亮版 */
opacity: 0.8;
}
.date {
font-size: 13px;
font-weight: 400;
margin-top: 16px;
line-height: 1.6;
color: #8E8E93;
}
/* 子设备重构为 iOS 原生内嵌分组列表 (Inset Grouped) */
.childBox {
margin-top: 20px;
background-color: #2C2C2E;
border-radius: 12px;
overflow: hidden; /* 保证子元素不会溢出圆角 */
}
.child {
padding: 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
/* 原生分割线 */
border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
.child:last-child {
border-bottom: none;
}
.childName {
font-size: 15px;
font-weight: 500;
color: #FFFFFF;
}
.childDay {
font-size: 15px;
font-weight: 400;
color: #8E8E93;
}
/* 页脚 */
.footer {
text-align: center;
margin-top: 40px;
color: #636366;
font-size: 13px;
font-weight: 500;
}
/* 针对 iPad 竖屏及手机的响应式 */
@media(max-width: 1024px) {
.dashboard-top {
grid-template-columns: 1fr 1fr;
}
.core-card {
grid-column: span 2;
}
body {
padding: 24px;
}
}
@media(max-width: 600px) {
.dashboard-top {
grid-template-columns: 1fr;
}
.core-card {
grid-column: span 1;
}
.days {
font-size: 38px;
}
}
</style>
</head>
<body>
<div class="header">
<h1>设备资产中心</h1>
<div id="time"></div>
</div>
<div class="dashboard-top">
<div class="dash-card core-card">
<div class="label">主控节点系统</div>
<div class="coreTitle">生物认知推理与中央运算枢纽</div>
<div class="value" id="coreRuntime"></div>
<div id="lottie-core"></div>
</div>
<div class="dash-card support-card">
<div class="label">保障组织</div>
<div class="title">下属运行保障组织</div>
<div class="value" id="humanDays"></div>
</div>
<div class="dash-card">
<div class="label">在编设备总数</div>
<div class="value" id="count"></div>
</div>
<div class="dash-card">
<div class="label">系统平均服役时间</div>
<div class="value" id="avg"></div>
</div>
</div>
<div id="board" class="grid"></div>
<div class="footer">
Personal Digital Infrastructure Runtime Center
</div>
<script>
// 初始化 Lottie 动画 (依然挂载同级目录下的 fufu.json)
lottie.loadAnimation({
container: document.getElementById('lottie-core'),
renderer: 'svg',
loop: true,
autoplay: true,
path: 'fufu.json'
});
const devices = [
{
type: "工作站",
name: "x86兼容平台工作站",
start: "2025-07-11",
children: [
{ type: "SSD", name: "Samsung 990 EVO Plus 1TB", start: "2025-07-11" },
{ type: "HDD", name: "WDC WD40EFPX-68C6CN0", start: "2025-01-11" }
]
},
{
type: "移动工作站",
name: "Blade Stealth 13 Shift Late 2019",
start: "2019-09-10",
children: [
{ type: "SSD", name: "LITEON CA5-8D512 512GB", start: "2019-09-10" }
]
},
{
type: "移动工作终端",
name: "iPad Air 2013",
start: "2019-03-01",
end: "2026-03-29"
},
{
type: "移动工作终端",
name: "iPad Pro(M5) 2025",
start: "2026-03-29"
},
{
type: "移动工作终端",
name: "HUAWEI P60",
start: "2023-07-20",
end: "2025-09-07"
},
{
type: "移动工作终端",
name: "vivo X200s",
start: "2025-09-07"
},
{
type: "拍摄设备",
name: "DJI ACTION 5 PRO",
start: "2025-05-28",
children: [
{ type: "MicroSD", name: "SanDisk Extreme QXA1 512GB", start: "2025-05-28" }
]
},
{
type: "移动高速存储",
name: "ROG STRIX Arion feat. Miku",
start: "2025-10-22",
children: [
{ type: "SSD", name: "Samsung 990 EVO Plus 2TB", start: "2025-10-22" }
]
}
];
const coreStart = new Date("2010-11-19");
function calc(device) {
const now = new Date();
const start = new Date(device.start);
const end = device.end ? new Date(device.end) : now;
const realEnd = end < now ? end : now;
let days = Math.floor((realEnd - start) / 86400000);
if (days < 0) days = 0;
const y = Math.floor(days / 365);
const m = Math.floor((days % 365) / 30);
const d = (days % 365) % 30;
return {
days,
runtime: `${y}年 ${m}个月 ${d}天`,
active: now >= start && (!device.end || now < new Date(device.end))
};
}
function updateCore(total) {
const now = new Date();
const days = Math.floor((now - coreStart) / 86400000);
document.getElementById("coreRuntime").innerText = days + " 天";
document.getElementById("humanDays").innerText = "运行时长 " + days + " 天";
}
function render() {
let total = 0;
const board = document.getElementById("board");
board.innerHTML = "";
devices.forEach(device => {
const data = calc(device);
total += data.days;
board.innerHTML += `
<div class="card">
<div class="top">
<div class="status">
<div class="dot ${data.active ? "green" : "gray"}"></div>
${data.active ? "服役中" : "已归档"}
</div>
<div class="type">${device.type}</div>
</div>
<div class="name">${device.name}</div>
<div class="days">${data.days} 天</div>
<div class="runtime">累计运行时长:${data.runtime}</div>
<div class="date">
始于 ${device.start}
${device.end ? `<br>终于 ${device.end}` : ""}
</div>
${device.children ? `
<div class="childBox">
${device.children.map(x => {
const c = calc(x);
return `
<div class="child">
<div class="childName">${x.name}</div>
<div class="childDay">${c.days} 天</div>
</div>
`;
}).join("")}
</div>
` : ""}
</div>
`;
});
document.getElementById("count").innerText = devices.length;
document.getElementById("avg").innerText = Math.floor(total / devices.length) + " 天";
updateCore(total);
}
function clock() {
const options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };
document.getElementById("time").innerText = "最后更新状态:" + new Date().toLocaleString("zh-CN", options).replace(/\//g, '-');
}
render();
clock();
setInterval(clock, 1000);
</script>
</body>
</html>