forked from ilovexjp/health-code-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
654 lines (601 loc) · 18.2 KB
/
index.html
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
<!DOCTYPE html>
<title>健康码模拟</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
<meta name="theme-color" content="#FFFFFF">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="manifest" href="manifest.json">
<link rel="icon" type="image/jpeg" href="common/logo.jpg">
<link rel="apple-touch-icon" sizes="512x512" href="common/logo.jpg">
<style>
body {
font-family: "PingFang SC", sans-serif;
margin: 20px 4%;
background-color: rgba(0, 0, 0, .01);
}
.apps-list {
display: flex;
flex-direction: column;
align-items: stretch;
margin-bottom: 16px;
}
.app {
border-radius: 4px;
padding: 8px;
margin: 4px 0;
display: flex;
flex-direction: column;
background-color: #fff;
box-shadow: 0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%);
transition: all .1s ease-out;
}
.app.selected {
opacity: 0.6;
}
.app:has(.app-menu-item.active[data-role=pin]):not(.inactivated) {
order: -1;
}
.app.inactivated {
order: 1000 !important;
}
.app.inactivated .app-title {
color: rgba(0, 0, 0, .6);
font-size: 14px;
margin-left: 8px;
}
.app.inactivated .app-title::after {
content: "暂不可用";
margin-left: 5px;
font-weight: normal;
}
.app.inactivated .app-menu {
display: none;
}
.app.inactivated .app-content>img {
display: none;
}
.app.inactivated .app-title-icon {
display: none;
}
.app-content {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
user-select: none;
}
.app-content>img {
height: 54px;
width: 54px;
margin-right: 10px;
padding: 2px;
border-radius: 100px;
border: 2px dotted #aaa;
}
.app-content>.app-description {
display: flex;
flex-direction: column;
justify-content: space-around;
}
.app-title {
font-size: 19px;
font-weight: bold;
flex-shrink: 0;
}
.app-title-wrapper {
display: flex;
flex-direction: row;
align-items: center;
}
.app-title-icon {
height: 18px;
width: 18px;
margin-left: 5px;
opacity: 0.6;
transition: margin-left .1s ease-out;
}
.app.selected .app-title-icon {
margin-left: 16px;
}
.app-menu {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
margin-top: 8px;
}
.app-menu-item {
height: 20px;
font-size: 15px;
background-color: rgba(0, 0, 0, .05);
color: rgba(0, 0, 0, .6);
border-radius: 4px;
padding: 4px 6px;
margin: 2px 9px 2px 0;
display: flex;
flex-direction: row;
align-items: center;
}
.app-menu-item.active {
background-color: rgba(0, 0, 0, .9);
color: rgba(255, 255, 255, .87);
}
.app-menu-item[data-role=link]:hover {
background-color: rgba(0, 0, 0, .9);
color: rgba(255, 255, 255, .87);
}
.app-menu-app-icon {
height: 18px;
width: 18px;
}
.app-menu-item.active .app-menu-app-icon {
filter: invert(1);
}
.app-menu-item[data-role=link]:hover .app-menu-app-icon {
filter: invert(1);
}
.app-menu-app-title {
margin-left: 2px;
}
.links-list {
margin: 10px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
flex-wrap: wrap;
color: rgba(0, 0, 0, .67);
}
.link-wrapper {
margin: 2px 8px;
display: flex;
flex-direction: row;
align-items: center;
font-size: 14px;
}
.link-wrapper>img {
width: 20px;
height: 20px;
}
.link-wrapper>span {
margin-left: 6px;
}
.links-list-help {
color: #999;
}
.app-help {
display: none;
font-size: 14px;
margin: 8px 4px 0 4px;
background-color: rgba(0, 0, 0, .05);
color: rgba(0, 0, 0, .75);
border-radius: 8px;
padding: 8px 12px;
line-height: 150%;
}
.app-help-subtitle {
font-weight: bold;
font-size: 18px;
margin: 4px 0;
}
.app-contributors-container {
margin-top: 8px;
}
.app-contributor {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
margin-top: 8px;
}
.app-contributor-namestrip {
margin-top: 4px;
}
.contributor-nametag {
font-weight: bold;
font-style: italic;
font-size: 17px;
color: transparent;
background: linear-gradient(-68deg, rgba(7, 22, 246, 1) 0%, rgba(0, 209, 255, 1) 100%);
background-clip: text;
-webkit-background-clip: text;
padding: 4px 2px;
margin-right: 4px;
}
.app-contributor-namestrip .contributor-nametag {
margin: 0;
display: inline-block;
height: 21px;
background: rgb(9, 55, 121);
background: linear-gradient(68deg, rgba(249, 197, 7, 1) 0%, rgba(255, 0, 97, 1) 100%);
padding: 4px 12px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
color: #fff;
-webkit-text-stroke: .5px rgba(0, 0, 0, .8);
text-stroke: .5px rgba(0, 0, 0, .8);
}
.contributor-description {
font-style: italic;
font-size: 13px;
color: rgba(0, 0, 0, .6);
}
.app-contributor-namestrip .contributor-description {
display: flex;
align-items: center;
justify-content: center;
padding: 4px 12px 4px 6px;
height: 19px;
border: 1px solid rgba(0, 0, 0, .6);
border-left-width: 0;
border-top-right-radius: 50px;
border-bottom-right-radius: 50px;
background-color: #fff;
}
</style>
<script>
const items = [
{
"title": "通信大数据行程卡",
"icon": "trip-card/static/[email protected]",
"link": "trip-card",
"color": "#2ba667",
"help_text": "<p>点击手机号或途经地点可以修改相关信息。</p>",
"menu": [
]
},
{
"title": "粤康码",
"icon": "ykm/static/yss.jpeg",
"link": "ykm",
"color": "#aacc00",
"help_text": "<p>点击姓名、城市、场所地址等可以修改对应<p>点击二维码可以切换 “粤康码” 及 “粤康码场所通行” 页面。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "ykm/checkin.html"
},
{
"title": "核酸",
"icon": "vaccines",
"link": "ykm/detail.html"
},
]
},
{
"title": "苏康码",
"icon": "skm/src/jszwfw.png",
"link": "skm",
"color": "#a3a8eb99",
"help_text": "<p>点击姓名、证件号、场所地址等可以修改对应信息;</p><p>点击二维码可以展示签到页面。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "skm/index.html#checkin"
},
{
"title": "核酸",
"icon": "vaccines",
"link": "skm/detail.html"
},
]
},
{
"title": "北京健康宝",
"icon": "jkb/static/[email protected]",
"link": "jkb",
"color": "#fa6666",
"help_text": "<p>点击姓名、证件号可以修改对应信息;</p><p>点击照片可以更改或移除照片,超过 4MB 的图片可能无法在本地保存;</p><p>点击右上角二维码标志可以在 “本人健康码自查询” 和 “本人信息扫码登记” 间切换;</p><p>点击 “未见异常” 可以切换 “通勤” 标志。</p>",
"menu": [
{
"title": "扫描",
"icon": "qr_code_scanner",
"link": "jkb/scan.html"
},
{
"title": "场所",
"icon": "place",
"link": "jkb/checkin.html"
},
]
},
{
"title": "四川天府健康通",
"icon": "tfjkt/static/message-icon.png",
"link": "tfjkt",
"color": "#0ba099",
"help_text": "<p>点击姓名、证件号、场所地址等可以修改对应信息;</p><p>点击“扫场所码”展示场所码。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "tfjkt/checkin.html"
},
]
},
{
"title": "随申码",
"icon": "ssm/static/ssbapp-logo.png",
"link": "ssm",
"color": "#bf4046",
"help_text": "<p>点击姓名、证件号、场所地址等可以修改对应信息;</p><p>点击照片可以更改或移除照片,超过 4MB 的图片可能无法在本地保存;</p><p>点击二维码展示场所码。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "ssm/checkin.html"
},
]
},
{
"title": "山东健康通行码",
"icon": "shandong-hc/static/logo.png",
"link": "shandong-hc",
"color": "#68b82e",
"help_text": "<p>点击姓名、证件号、场所地址等可以修改对应信息;</p><p>点击二维码可以切换到场所码页面。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "shandong-hc/index.html#checkin"
},
{
"title": "威海",
"icon": "map",
"link": "shandong-hc/weihai/index.html"
}
],
"contributors": [
{
name: "LibertyNeverDies",
description: "参与制作",
style: "namestrip"
}
]
},
{
"title": "湖北健康码·武汉",
"icon": "hubei-hc/static/QRlogo.png",
"link": "hubei-hc",
"color": "#af9bff",
"help_text": "<p>点击姓名、证件号等可以修改对应信息;</p><p>在武汉健康码中,点击通信行程卡“点击核验”可以添加行程戳。</p>",
"menu": [
{
"title": "其它城市",
"icon": "map",
"link": "hubei-hc/hubei"
}
]
},
{
"title": "湖南电子健康卡",
"icon": "hunan-hc/static/logo-b18dcf7bf55c412ec04989061d0512ad.png",
"link": "hunan-hc",
"help_text": "<p>点击姓名、证件号、采样点等可以修改对应信息。</p>",
"contributors": [
{
name: "uodedcli",
description: "制作",
style: "namestrip"
},
],
},
{
"title": "福建健康码",
"icon": "fujian-hc/static/jkm_logo.png",
"link": "fujian-hc",
"color": "#3a5eff",
"help_text": "<p>点击姓名、证件号可以修改对应信息。</p><p>点击 “扫一扫” 进入场所张贴码。</p>",
"menu": [
{
"title": "场所",
"icon": "place",
"link": "fujian-hc/checkin.html"
}
]
},
{
"title": "浙江健康码",
"icon": "zhejiang-hc/static/logo.ico",
"link": "zhejiang-hc",
"color": "#57ac6c",
"help_text": "<p>点击城市名、姓名、证件号可以修改对应信息。</p>",
}
];
function onIconFail(t) {
t.closest(".app").classList.add("inactivated");
}
function render() {
let html = "";
for (const item of items) {
let menu_html = "";
if (item.menu) {
for (const menu_item of item.menu) {
menu_html += `
<div class="app-menu-item" data-role="link" data-link="${menu_item.link || ""}">
<img class="app-menu-app-icon" src="common/icons/${menu_item.icon || "qr_code"}.svg"></img>
<span class="app-menu-app-title">${menu_item.title}</span>
</div>
`;
}
}
menu_html += `
<div class="app-menu-item ${localStorage.getItem("pinned")?.split(",").indexOf(item.link) >= 0 ? "active" : ""}" data-role="pin">
<img class="app-menu-app-icon" src="common/icons/push_pin.svg"></img>
</div>`;
if (item.help_text) {
menu_html += `
<div class="app-menu-item" data-role="help">
<img class="app-menu-app-icon" src="common/icons/info.svg"></img>
</div>
`;
}
let credits_html = "";
if (item.contributors) {
for (const contributor of item.contributors) {
if (contributor.style == "namestrip") {
credits_html += `
<div class="app-contributor app-contributor-namestrip">
<span class="contributor-nametag">${contributor.name}</span>
<span class="contributor-description">${contributor.description}</span>
</div>
`;
} else if (contributor.style == "text") {
credits_html += `
<div class="app-contributor">
<span class="contributor-nametag">${contributor.name}</span>
<span class="contributor-description">${contributor.description}</span>
</div>
`;
}
}
}
html += `
<div class="app" data-link="${item.link || ""}">
<div class="app-content">
<img src="${item.icon}" onerror="onIconFail(this);" style="border-color: ${item.color || "#aaa"};">
<div class="app-description">
<div class="app-title-wrapper">
<span class="app-title">${item.title}</span>
<img class="app-title-icon" src="common/icons/arrow_forward.svg"></img>
</div>
<div class="app-menu">
${menu_html}
</div>
</div>
</div>
<div class="app-help">
<div class="app-help-subtitle">使用说明</div>
${item.help_text}
${credits_html ? `
<div class="app-help-subtitle">致谢</div>
<div class="app-contributors-container">
${credits_html}
</div>
` : ""}
</div>
</div>`;
}
document.querySelector(".apps-list").innerHTML = html;
const elements = [
...document.querySelectorAll(".app:not(.inactivated)"),
...document.getElementsByClassName("app-menu-item")
];
if (elements.length) {
for (const element of elements) {
const data_link = element.attributes["data-link"]?.value;
const data_role = element.attributes["data-role"]?.value;
if (data_link) {
element.addEventListener("click", (e) => {
e.stopPropagation();
if (element.classList.contains("inactivated")) return;
window.location.href = data_link;
});
} else if (data_role == "help") {
element.addEventListener("click", (e) => {
e.stopPropagation();
if (!element.classList.contains("active")) {
document.querySelectorAll(".app-help").forEach(element => {
element.classList.remove("active");
});
element.classList.add("active");
element.closest(".app")
.getElementsByClassName("app-help")[0].style.display = "block";
} else {
element.classList.remove("active");
element.closest(".app")
.getElementsByClassName("app-help")[0].style.display = "none";
}
});
} else if (data_role == "pin") {
const item_id = element.closest(".app")?.attributes["data-link"]?.value;
if (item_id) {
element.addEventListener("click", (e) => {
e.stopPropagation();
if (!element.classList.contains("active")) {
element.classList.add("active");
element.closest(".app").style.order = -1;
let list = localStorage.getItem("pinned")?.split(",") || [];
list.push(item_id);
localStorage.setItem("pinned", list.join(","));
} else {
element.classList.remove("active");
element.closest(".app").style.order = 0;
let list = localStorage.getItem("pinned")?.split(",") || [];
list = list.filter(x => x != item_id);
if (list.length) localStorage.setItem("pinned", list.join(","));
else localStorage.removeItem("pinned");
}
});
}
}
}
}
const pinned_list = localStorage.getItem("pinned")?.split(",") || [];
if (pinned_list) {
for (const element of document.querySelectorAll(".app:not(.inactivated)") || []) {
if (pinned_list.includes(element.attributes["data-link"].value)) {
element.style.order = -1;
}
element.addEventListener("touchstart", (e) => {
if (!e.target.classList?.[0]?.startsWith("app-menu-item"))
element.classList.add("selected");
});
element.addEventListener("touchmove", () => {
element.classList.remove("selected");
});
element.addEventListener("touchend", () => {
element.classList.remove("selected");
});
element.addEventListener("touchcancel", () => {
element.classList.remove("selected");
});
}
}
for (const element of document.querySelectorAll(".app-menu-item[data-role=link]") || []) {
element.addEventListener("touchstart", () => {
element.classList.add("active");
});
element.addEventListener("touchmove", () => {
element.classList.remove("active");
});
element.addEventListener("touchend", () => {
element.classList.remove("active");
});
element.addEventListener("touchcancel", () => {
element.classList.remove("active");
});
}
for (const element of document.querySelectorAll(".app-help") || []) {
element.addEventListener("click", (e) => {
e.stopPropagation();
});
}
}
</script>
<h2>目录</h2>
<div class="apps-list"></div>
<div class="links-list">
<div class="link-wrapper" onclick="window.location.href = 'https://github.com/ilovexjp';">
<img src="common/github-logo.png">
<span>@ilovexjp</span>
</div>
<div class="link-wrapper" onclick="window.location.href = 'https://t.me/gh_ilovexjp';">
<img src="common/telegram-logo.svg">
<span>@gh_ilovexjp</span>
</div>
</div>
<div class="links-list links-list-help">
<div class="link-wrapper">
<span
onclick="window.confirm('确定清除本地存储的全部信息?') && (localStorage.clear() || window.location.reload());">清除本地数据</span>
</div>
<div class="link-wrapper">
<span>上次更新:2022-11-08</span>
</div>
</div>
<script>
render();
</script>