forked from Mai19930513/SamsungTestFirmwareVersionDecrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSamsungFirmware.html
More file actions
802 lines (723 loc) · 29.7 KB
/
SamsungFirmware.html
File metadata and controls
802 lines (723 loc) · 29.7 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
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>三星固件版本查询系统</title>
<style>
:root {
--primary-color: #4a90e2;
--secondary-color: #6c5ce7;
--bg-gradient: linear-gradient(135deg, #f8f9ff 0%, #f1f3ff 100%);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', system-ui, sans-serif;
}
body {
background: var(--bg-gradient);
min-height: 100vh;
padding: 2rem;
}
.container {
max-width: 1400px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
padding: 2rem;
}
h1 {
color: var(--primary-color);
text-align: center;
margin-bottom: 1rem;
font-size: 1.8rem;
letter-spacing: -0.5px;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.filters {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
flex-wrap: wrap;
/* 在小屏幕上换行 */
margin-bottom: 2rem;
}
.filter-group {
position: relative;
flex: 1 1 100%;
/* 在小屏幕上每个筛选器占满一行 */
}
.filter-group i {
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
color: #6c757d;
}
input,
select {
width: 100%;
padding: 0.8rem 1rem 0.8rem 2.5rem;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 1rem;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
input:focus,
select:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}
table {
width: 100%;
border-collapse: collapse;
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
isolation: isolate;
/* 隔离层叠上下文 */
}
th,
td {
padding: 0.8rem;
font-size: 0.9rem;
text-align: center;
border-bottom: 1px solid #f0f0f0;
white-space: nowrap;
}
th {
background: var(--primary-color) !important;
/* 强制背景色 */
color: white !important;
position: sticky;
min-width: 100px;
/* 设置最小宽度 */
white-space: nowrap;
/* 禁止文字换行 */
top: 0 !important;
overflow: visible;
/* 确保内容不被隐藏 */
text-overflow: clip;
/* 禁止省略号显示 */
z-index: 1001 !important;
border-bottom: 1px solid #f0f0f0;
}
tr:hover {
background: #f8f9ff;
}
.version-badge {
display: inline-block;
padding: 0.4rem 0.8rem;
border-radius: 20px;
font-family: 'Fira Code', monospace;
font-size: 0.9em;
}
.official-badge {
background: rgba(74, 144, 226, 0.1);
color: var(--primary-color);
border: 1px solid rgba(74, 144, 226, 0.2);
}
.beta-badge {
background: rgba(108, 92, 231, 0.1);
color: var(--secondary-color);
border: 1px solid rgba(108, 92, 231, 0.2);
}
.no-results {
text-align: center;
padding: 2rem;
color: #6c757d;
display: none;
}
.table-container {
top: 0;
max-height: 70vh;
overflow-y: auto;
overflow-x: auto;
/* 固定在页面顶部 */
background-color: white;
/* 设置背景颜色,避免透明 */
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
/* 添加阴影效果 */
position: relative;
z-index: 0;
}
#firmwareTable {
width: 100%;
border-collapse: collapse;
}
#firmwareTable thead th {
position: sticky;
top: 0;
background: var(--primary-color);
color: white;
z-index: 2;
}
.last-update {
text-align: center;
/* 文字右对齐 */
position: static;
/* 使用绝对定位 */
top: 10px;
/* 距离顶部 20px */
right: 25px;
/* 距离右侧 20px */
font-size: 0.9rem;
/* 字体稍小 */
color: #4a90e2;
/* 使用主色调 */
font-weight: bold;
/* 加粗字体 */
background-color: #f0f8ff;
/* 添加浅蓝色背景 */
padding: 0.6rem 1rem;
/* 内边距 */
border-radius: 8px;
/* 圆角边框 */
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
/* 添加阴影效果 */
z-index: 1000;
/* 确保在其他内容之上 */
margin-bottom: 1rem;
/* 增加与下方内容的间距 */
}
@media (max-width: 768px) {
body {
padding: 1rem;
}
.container {
padding: 1rem;
}
th,
td {
padding: 0.6rem;
font-size: 0.8rem;
}
/* 隐藏地区代码 */
th:nth-child(3),
td:nth-child(3) {
/* 隐藏测试版本号说明 */
display: none;
}
}
@media (min-width: 768px) {
.last-update {
position: absolute;
/* 在大屏幕上恢复绝对定位 */
top: 10px;
right: 25px;
}
}
/* 清空按钮 */
.filter-group {
flex: 1 1 100%;
/* 在小屏幕上每个筛选器占满一行 */
}
.clear-btn {
width: 100%;
/* 在小屏幕上按钮占满一行 */
text-align: center;
display: flex;
align-items: center;
padding: 0.8rem;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
border: 2px solid #e0e0e0;
border-radius: 8px;
background: white;
font-size: 1rem;
cursor: pointer;
transition: border-color 0.3s, box-shadow 0.3s;
}
.clear-btn i {
margin-right: 0.5rem;
color: #6c757d;
}
.clear-btn:hover {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}
@media (min-width: 768px) {
.clear-btn {
width: auto;
/* 在大屏幕上恢复为自动宽度 */
}
.filter-group {
flex: 1 1 auto;
/* 在大屏幕上恢复为水平布局 */
}
}
/* 自定义弹窗样式 */
.custom-popup {
width: 90%;
/* 在小屏幕上限制弹窗宽度 */
max-width: 450px;
/* 设置最大宽度 */
position: fixed;
top: 95%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #1775e1e1;
color: white;
padding: 1rem 2rem;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
font-size: 0.8rem;
font-weight: bold;
text-align: center;
z-index: 1000;
opacity: 1;
transition: opacity 0.3s ease, transform 0.3s ease;
}
.custom-popup.fade-out {
opacity: 0;
transform: translate(-50%, -60%);
}
.sortable {
cursor: pointer;
font-weight: bold;
}
.sortable::after {
content: '▲';
/* 默认显示升序箭头 */
font-size: 0.7rem;
margin-left: 5px;
/* transition: transform 0.3s ease; */
}
.sortable.desc::after {
content: '▼';
/* 显示降序箭头 */
}
.android_os {
font-size: 0.7rem;
/* 字体稍小 */
color: #4a90e2;
/* 使用灰色 */
margin-top: 0.3rem;
/* 与上方内容保持间距 */
display: block;
/* 独占一行 */
font-weight: bold;
/* 加粗字体 */
padding: 0.1rem 0.4rem;
/* 内边距 */
border-radius: 20px;
/* 圆角边框 */
text-align: center;
/* 居中对齐 */
border: 0.5px SOLID
}
@keyframes fadeInRow {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.tr-fade-in {
animation: fadeInRow 0.3s ease;
}
.end-tip-row {
background: linear-gradient(90deg, #e3f0ff 0%, #f0f0f0 100%);
color: #4a90e2;
font-weight: bold;
text-align: center;
border-radius: 0 0 12px 12px;
font-size: 1.05rem;
letter-spacing: 2px;
animation: fadeInEndTip 0.6s;
box-shadow: 0 2px 8px rgba(74, 144, 226, 0.08);
}
@keyframes fadeInEndTip {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fixed-header-bar {
position: sticky;
top: 0;
z-index: 1100;
background: #fff;
/* 保证有背景色,避免内容叠加 */
box-shadow: 0 2px 8px rgba(74, 144, 226, 0.06);
padding-bottom: 1rem;
/* 可选:加点阴影和间距 */
}
</style>
</head>
<body>
<div class="container">
<h1><i class="title"></i>三星测试版固件版本查询</h1>
<div id="lastUpdate" class="last-update"></div>
<div class="filters">
<div class="filter-group">
<i class="fas fa-search"></i>
<input type="text" id="modelFilter" placeholder="输入设备型号(如:SM-S9280)">
</div>
<div class="filter-group">
<i class="fas fa-globe-asia"></i>
<input type="text" id="regionFilter" placeholder="输入地区代码(如:CHC)">
</div>
<!-- 新增:清空按钮 -->
<div class="filter-group">
<button id="clearFilters" class="clear-btn" title="清空筛选">
<i class="fas fa-times"></i> 清空
</button>
</div>
</div>
<div class="table-container">
<table id="firmwareTable">
<thead>
<tr>
<th>设备名称</th>
<th id="sortModel" class="sortable">设备型号</th>
<th>地区代码</th>
<th>地区名称</th>
<th>最新正式版</th>
<th>最新测试版</th>
<th id="sortUpdateTime" class="sortable">测试版上线时间</th>
<th>测试版本号说明</th>
</tr>
</thead>
<tbody></tbody>
</table>
<div class="no-results" id="noResults">
<i></i> 没有找到匹配的结果
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const timestamp = Date.now()
const DATA_URL = `https://cdn.jsdelivr.net/gh/Mai19930513/SamsungTestFirmwareVersionDecrypt/firmware_mini.json?v=${timestamp}`;
class FirmwareTable {
constructor() {
this.tableBody = document.querySelector('#firmwareTable tbody');
this.pageSize = 30; // 每次加载的数据量
this.currentIndex = 0; // 当前加载到的数据索引
this.isLoading = false; // 是否正在加载数据
this.filters = { model: '', region: '' }; // 筛选条件
this.sortOrder = 'desc'; // 默认排序顺序为降序
this.sortKey = 'model';
this.copyEventBound = false; // 事件委托标记
this.initFilters();
this.loadData();
this.initScrollListener();
this.initSortListeners(); // 初始化排序事件监听器
this.addCopyEvent(); // 只需绑定一次事件委托
this.checkAutoLoad(); // 页面初始化时检测
}
initSortListeners() {
const sortModelHeader = document.getElementById('sortModel');
const sortUpdateTimeHeader = document.getElementById('sortUpdateTime'); // 新增
sortModelHeader.addEventListener('click', () => {
this.sortKey = 'model';
this.sortOrder = this.sortOrder === 'asc' ? 'desc' : 'asc';
sortModelHeader.classList.toggle('desc', this.sortOrder === 'desc');
sortUpdateTimeHeader.classList.remove('desc');
this.sortData('model', this.sortOrder);
this.resetTable();
});
sortUpdateTimeHeader.addEventListener('click', () => {
this.sortKey = 'updateTime';
this.sortOrder = this.sortOrder === 'asc' ? 'desc' : 'asc';
sortUpdateTimeHeader.classList.toggle('desc', this.sortOrder === 'desc');
sortModelHeader.classList.remove('desc');
this.sortData('updateTime', this.sortOrder);
this.resetTable();
});
}
sortData(key, order) {
this.processedData.sort((a, b) => {
let valueA = a[key];
let valueB = b[key];
// 针对时间字段做特殊处理
if (key === 'updateTime') {
// 统一为时间戳,未知排最后
valueA = Date.parse(valueA) || 0;
valueB = Date.parse(valueB) || 0;
} else {
valueA = valueA.toLowerCase();
valueB = valueB.toLowerCase();
}
if (order === 'asc') {
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
} else {
return valueA > valueB ? -1 : valueA < valueB ? 1 : 0;
}
});
}
async loadData() {
try {
const response = await fetch(DATA_URL)
const data = await response.json();
this.processData(data);
// 默认按设备型号降序排序
this.sortData('model', this.sortOrder);
// 更新箭头样式
const sortModelHeader = document.getElementById('sortModel');
sortModelHeader.classList.add('desc');
this.renderTable();
} catch (error) {
console.error('数据加载失败:', error);
}
}
processData(rawData) {
this.processedData = [];
if (!rawData || typeof rawData !== 'object') {
console.error('无效的数据格式:', rawData);
return;
}
Object.entries(rawData).forEach(([model, regions]) => {
// 跳过 "上次更新时间"
if (model === "上次更新时间") {
document.getElementById('lastUpdate').textContent = `更新时间:${regions}`;
return;
}
Object.entries(regions).forEach(([regionCode, details]) => {
if (!details || !details.最新正式版 || !details.常规更新测试版) {
console.warn('跳过无效数据:', { model, regionCode, details });
return; // 跳过无效数据
}
this.processedData.push({
model,
regionCode,
regionName: details.地区,
official: this.parseVersion(details.最新正式版),
official_full: details.最新正式版,
major: this.parseVersion(details.大版本测试版),
major_full: details.大版本测试版,
minor: this.parseVersion(details.常规更新测试版),
minor_full: details.常规更新测试版,
description: details.最新版本号说明,
deviceName: details.机型,
updateTime: details.最新测试版上传时间,
stableOS: details.正式版安卓版本,
devOS: details.测试版安卓版本,
});
});
});
}
checkAutoLoad() {
// 防止递归死循环
if (this.isLoading) return;
// 获取当前筛选后的数据总量
const filteredData = this.processedData.filter(item => {
const modelMatch = item.model.toLowerCase().includes(this.filters.model.toLowerCase());
const regionMatch = item.regionCode.toLowerCase().includes(this.filters.region.toLowerCase());
return modelMatch && regionMatch;
});
// 只要页面未填满且还有数据就继续加载
if (
this.currentIndex < filteredData.length &&
document.body.scrollHeight <= window.innerHeight + 10
) {
this.renderTable();
}
}
parseVersion(version) {
if (!version || typeof version !== 'string') {
console.warn('无效的版本号:', version);
return "未知版本"; // 返回默认值
}
const parts = version.split('/');
return parts[0]; // 返回分割后的第一个部分
}
renderTable() {
if (this.isLoading) return; // 防止重复加载
this.isLoading = true;
// 先移除已存在的“已到最后”提示行
const lastTipRow = this.tableBody.querySelector('tr[data-tip="end"]');
if (lastTipRow) lastTipRow.remove();
// 应用筛选条件
const filteredData = this.processedData.filter(item => {
const modelMatch = item.model.toLowerCase().includes(this.filters.model.toLowerCase());
const regionMatch = item.regionCode.toLowerCase().includes(this.filters.region.toLowerCase());
return modelMatch && regionMatch;
});
// 获取当前需要加载的数据
const nextData = filteredData.slice(this.currentIndex, this.currentIndex + this.pageSize);
this.currentIndex += this.pageSize;
// 动态生成表格行
const fragment = document.createDocumentFragment();
nextData.forEach(item => {
const row = document.createElement('tr');
row.classList.add('tr-fade-in'); // 添加动画类
row.innerHTML = `
<td>${item.deviceName}</td>
<td>${item.model}</td>
<td>${item.regionCode}</td>
<td>${item.regionName}</td>
<td style="min-width:180; vertical-align:middle; ">
<div style="margin-bottom:0.5em;">
${item.official ? `<a href="https://samfw.com/firmware/${item.model}/${item.regionCode}/${item.official}" target="_blank" class="version-badge official-badge">${item.official}</a>` : '-'}
</div>
<div class="android_os" style="margin-bottom:0.2em;">Android OS:${item.stableOS || '未知'}</div>
</td>
<td style="min-width:180px; vertical-align:middle; ">
<div>
<span style="font-weight:bold;color:#4a90e2;display:inline-block;text-align:right;">日常更新(OS:${item.stableOS || '未知'}):</span>
${item.minor ? `<span class="version-badge beta-badge">${item.minor}</span>` : '-'}
</div>
<div>
<span style="font-weight:bold;color:#6c5ce7;display:inline-block;text-align:right;">下个版本(OS:${item.devOS || '未知'}):</span>
${item.major ? `<span class="version-badge beta-badge">${item.major}</span>` : '-'}
</div>
</td>
<td>${item.updateTime || '未知'}</td>
<td>${item.description}</td>
`;
fragment.appendChild(row);
});
// 判断是否已到最后,插入提示行
if (this.currentIndex >= filteredData.length && filteredData.length > 0) {
const tipRow = document.createElement('tr');
tipRow.setAttribute('data-tip', 'end'); // 标记提示行
tipRow.className = 'end-tip-row'; // 添加美观样式和动画
tipRow.innerHTML = `<td colspan="8">加载完毕!共 ${filteredData.length} 条数据</td>`;
fragment.appendChild(tipRow);
}
this.tableBody.appendChild(fragment);
this.isLoading = false;
document.getElementById('noResults').style.display =
filteredData.length ? 'none' : 'block';
// 每次渲染后都检测是否需要继续加载
setTimeout(() => {
this.checkAutoLoad();
}, 0);
}
// 滚动事件节流
initScrollListener() {
window.addEventListener('scroll', throttle(() => {
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - 100) {
this.renderTable();
}
this.checkAutoLoad(); // 每次滚动后都检测
}, 200)); // 200ms 节流
}
initFilters() {
this.filters = {
model: '',
region: '',
};
// 绑定筛选事件
document.getElementById('modelFilter').addEventListener('input', debounce(e => {
this.filters.model = e.target.value;
this.resetTable(); // 重置表格
}, 300));
document.getElementById('regionFilter').addEventListener('input', debounce(e => {
this.filters.region = e.target.value;
this.resetTable(); // 重置表格
}, 300));
document.getElementById('clearFilters').addEventListener('click', debounce(e => {
// 清空 state
this.filters.model = '';
this.filters.region = '';
// 清空输入框
document.getElementById('modelFilter').value = '';
document.getElementById('regionFilter').value = '';
// 重置并重新渲染表格
this.resetTable();
}, 300));
}
resetTable() {
this.currentIndex = 0; // 重置索引
this.tableBody.innerHTML = ''; // 清空表格
this.renderTable(); // 重新渲染表格
}
renderPagination(totalItems, currentPage, pageSize) {
const totalPages = Math.ceil(totalItems / pageSize);
const paginationContainer = document.getElementById('pagination');
if (!paginationContainer) return;
paginationContainer.innerHTML = '';
if (totalPages === 0) {
paginationContainer.style.display = 'none'; // 隐藏分页容器
return;
}
paginationContainer.style.display = 'block'; // 显示分页容器
for (let i = 1; i <= totalPages; i++) {
const button = document.createElement('button');
button.textContent = i;
button.disabled = i === currentPage;
button.addEventListener('click', () => this.renderTable(i, pageSize));
paginationContainer.appendChild(button);
}
}
// 事件委托,只绑定一次
addCopyEvent() {
if (this.copyEventBound) return;
this.tableBody.addEventListener('click', (e) => {
const cell = e.target.closest('.copyable');
if (cell) {
const textToCopy = cell.getAttribute('title');
if (textToCopy && textToCopy !== '无版本号') {
navigator.clipboard.writeText(textToCopy).then(() => {
this.showCustomPopup(`已复制到剪贴板: ${textToCopy}`);
}).catch(err => {
console.error('复制失败:', err);
});
} else {
this.showCustomPopup('无可复制的版本号');
}
}
});
this.copyEventBound = true;
}
// 自定义弹窗显示方法
showCustomPopup(message) {
const popup = document.createElement('div');
popup.className = 'custom-popup';
popup.textContent = message;
// 添加到页面
document.body.appendChild(popup);
// 显示弹窗并在 2 秒后自动移除
setTimeout(() => {
popup.classList.add('fade-out');
popup.addEventListener('transitionend', () => {
popup.remove();
});
}, 2000);
}
}
// 防抖函数
function debounce(func, delay) {
let timer;
return function (...args) {
clearTimeout(timer);
timer = setTimeout(() => func.apply(this, args), delay);
};
}
// 节流函数
function throttle(func, delay) {
let last = 0;
return function (...args) {
const now = Date.now();
if (now - last > delay) {
last = now;
func.apply(this, args);
}
}
}
// 初始化表格
new FirmwareTable();
});
</script>
</body>
</html>