-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
651 lines (608 loc) · 36.4 KB
/
index.html
File metadata and controls
651 lines (608 loc) · 36.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.5, user-scalable=yes">
<title>⚔️KARDS 击剑大厅🤺</title>
<style>
* { box-sizing: border-box; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background: #e2ddd5; margin: 0; padding: 16px; color: #1f2b30; }
.container { max-width: 1200px; margin: 0 auto; }
.header {
background: #1f2b30; color: #f0eae0; padding: 18px 22px; border-radius: 48px;
margin-bottom: 18px; box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.header h1 { margin: 0 0 6px 0; font-weight: 550; letter-spacing: 1px; font-size: 1.8rem; }
.header p { margin: 0; opacity: 0.8; font-size: 1rem; }
.footer-simple {
text-align: center;
font-size: 1rem;
background: transparent;
color: #1f2b30;
margin-top: 30px;
padding: 12px 0;
border-top: 2px solid #cbbfb0;
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
flex-wrap: wrap;
}
.footer-simple a {
color: #1f2b30;
text-decoration: none;
font-weight: 600;
display: inline-flex;
align-items: center;
gap: 8px;
background: #ece4d9;
padding: 8px 24px;
border-radius: 60px;
border: 2px solid #b89b7b;
transition: 0.15s;
}
.footer-simple a:hover {
background: #b89b7b;
color: white;
border-color: #6e543b;
}
.footer-simple img {
width: 24px;
height: 24px;
filter: none;
}
.modal-overlay {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
backdrop-filter: blur(3px);
}
.modal-card {
background: #fcf9f5;
border-radius: 60px;
padding: 32px 40px;
max-width: 480px;
width: 90%;
border: 4px solid #a6806a;
box-shadow: 0 20px 30px rgba(0,0,0,0.2);
text-align: center;
}
.modal-card h2 {
font-size: 2rem;
margin: 0 0 16px;
color: #1f2b30;
border-left: none;
padding-left: 0;
}
.modal-card img {
max-width: 100%;
border-radius: 48px;
border: 4px solid #cbbfb0;
background: white;
margin-bottom: 24px;
}
.modal-card button {
background: #1f2b30;
color: white;
border: none;
padding: 16px 40px;
border-radius: 60px;
font-size: 1.3rem;
font-weight: 600;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.modal-card button:hover { background: #36454f; }
.publish-area, .filter-area { background: transparent; padding: 0; margin-bottom: 28px; }
h2 {
font-weight: 550; font-size: 1.7rem; border-left: 8px solid #a6806a;
padding-left: 20px; margin: 16px 0 22px 0; color: #1f2b30;
}
input, select, textarea, button {
font-size: 1rem; padding: 12px 20px; border: 2px solid #cbbfb0;
border-radius: 60px; background: white; width: auto; max-width: 100%;
}
textarea { border-radius: 32px; width: 100%; max-width: 600px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #a6806a; }
button {
background: #1f2b30; color: white; font-weight: 600; border: none;
padding: 12px 34px; border-radius: 60px; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
button:hover { background: #36454f; }
.btn-secondary { background: #cbbfb0; color: #1f2b30; margin-left: 12px; }
.major-nav {
display: flex; flex-wrap: wrap; gap: 8px; background: #ece4d9; padding: 14px;
border-radius: 80px; margin: 20px 0 12px; border: 2px solid #d1c2b2;
}
.major-nav-item {
flex: 1 0 auto; text-align: center; padding: 14px 8px; border-radius: 60px;
font-weight: 700; cursor: pointer; transition: 0.15s; background: #e0d6c8;
color: #1f2b30; border: 2px solid transparent; min-width: 70px;
}
.major-nav-item.selected { border-color: #8a6e53; background: #b89b7b; color: white; }
.major-nav-item[data-major="苏"] { background: #8A4B08; }
.major-nav-item[data-major="苏"].selected { background: #000000; color: white; border-color: #8A4B08; }
.major-nav-item[data-major="德"] { background: #58ACFA; }
.major-nav-item[data-major="德"].selected { background: #000000; color: white; border-color: #58ACFA; }
.major-nav-item[data-major="英"] { background: #F3E2A9; }
.major-nav-item[data-major="英"].selected { background: #000000; color: white; border-color: #F3E2A9; }
.major-nav-item[data-major="美"] { background: #5FB404; }
.major-nav-item[data-major="美"].selected { background: #000000; color: white; border-color: #5FB404; }
.major-nav-item[data-major="日"] { background: #FFBF00; }
.major-nav-item[data-major="日"].selected { background: #000000; color: white; border-color: #FFBF00; }
.ally-box {
background: #ece4d9; border-radius: 60px; padding: 24px 28px;
margin: 20px 0 0 0; border-left: 8px solid #b89b7b;
}
.ally-header {
display: flex; flex-wrap: wrap; justify-content: space-between;
align-items: center; margin-bottom: 20px; gap: 12px;
}
.ally-header p { margin: 0; font-weight: 600; font-size: 1.3rem; }
.checkbox-grid {
display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
}
.checkbox-grid label {
display: inline-flex; align-items: center; gap: 8px; background: white;
padding: 10px 24px; border-radius: 60px; border: 2px solid #cbbfb0;
cursor: pointer; font-weight: 500; font-size: 1rem;
}
.select-all-btn, .deselect-all-btn {
background: white; border: 2px solid #a6806a; border-radius: 60px; padding: 8px 24px;
font-weight: 600; cursor: pointer; color: #1f2b30; display: inline-block; margin-right: 10px;
}
.select-all-btn:hover { background: #a6806a; color: white; }
.deselect-all-btn:hover { background: #b3a18f; color: white; border-color: #5e4d3e; }
.card {
background: #fcf9f5; border-radius: 48px; padding: 24px 28px;
margin-bottom: 28px; border: 2px solid #d9cfc0; box-shadow: 0 8px 16px rgba(0,0,0,0.03);
}
.card-header {
display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 18px;
}
.card-header h3 {
margin: 0; font-size: 1.9rem; font-weight: 700; color: #1f2b30; word-break: break-word;
}
.tag {
display: inline-block; border-radius: 60px; padding: 6px 22px; font-size: 1rem;
font-weight: 700; background: #2d3f48; color: white;
}
.tag.gold { background: #c4a24b; color: #1f2b30; }
.tag.silver { background: #9099a5; color: white; }
.tag.bronze { background: #b87b4b; color: white; }
.expiry { background: #dfd6c9; border-radius: 60px; padding: 6px 22px; font-size: 1rem; font-weight: 500; }
.exclusion-area {
background: #ece4d9; border-radius: 48px; padding: 24px 22px; margin: 20px 0 16px;
}
.exclusion-title {
font-weight: 600; font-size: 1.2rem; margin-bottom: 20px; color: #3f3a33;
}
.major-nested-group {
display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 20px;
}
.major-nested-group:last-child { margin-bottom: 0; }
.outer-major-circle {
background: #b89b7b; color: white; font-weight: 700; font-size: 1.5rem;
padding: 10px 30px; border-radius: 60px; border: 3px solid #6e543b;
display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.inner-ally-circle {
background: white; color: #1f2b30; font-weight: 600; font-size: 1.3rem;
padding: 8px 28px; border-radius: 60px; border: 3px solid #a6806a;
display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.inner-ally-circle span { margin: 0 2px; }
.inner-ally-circle .banned-ally {color: #a03a2f;}
.major-alone {
background: #b89b7b; color: white; font-weight: 700; font-size: 1.5rem;
padding: 10px 40px; border-radius: 60px; border: 3px solid #6e543b;
}
.exclusion-empty {
background: #e0d6cc; border-radius: 60px; padding: 18px 28px;
font-size: 1.1rem; color: #2f413b; font-style: italic; text-align: center;
}
.time-left { background: #e7dfd3; border-radius: 60px; padding: 8px 22px; font-size: 0.95rem; }
.card-footer {
display: flex; flex-wrap: wrap; justify-content: space-between;
align-items: center; margin-top: 22px; gap: 16px;
}
.delete-btn { background: #ccbcac; border: none; border-radius: 60px; padding: 10px 28px; font-weight: 600; cursor: pointer; }
.delete-btn:hover { background: #a6806a; color: white; }
.filter-row {
display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-bottom: 28px;
}
.filter-label { font-weight: 700; min-width: 100px; color: #1f2b30; font-size: 1.2rem; }
.filter-options { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.filter-major-group, .filter-ally-group { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 6px 0; }
.filter-major-item, .filter-ally-item {
padding: 10px 22px; border-radius: 60px; background: #e6d9cb;
font-weight: 600; cursor: pointer; border: 2px solid transparent; font-size: 1rem;
}
.filter-major-item.selected { background: #b89b7b; color: white; border-color: #8a6e53; }
.filter-ally-item.selected { background: #5f8b95; color: white; border-color: #2e5a64; }
.filter-ally-item { background: #cfc4b6; }
@media (max-width: 700px) {
body { padding: 8px; }
.header h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; }
.major-nav-item { padding: 12px 4px; font-size: 0.9rem; }
.card-header h3 { font-size: 1.5rem; }
.outer-major-circle { font-size: 1.2rem; padding: 6px 20px; gap: 8px; }
.inner-ally-circle { font-size: 1.1rem; padding: 5px 18px; }
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>⚔️KARDS 击剑大厅🤺</h1>
<p>欢迎KARDS玩家自由击剑</p>
</div>
<!-- 发布区域 -->
<div class="publish-area">
<h2>✍️发布击剑申请</h2>
<form id="publishForm">
<p><strong>战斗代码/游戏ID</strong><br><input type="text" name="code" placeholder="请勿使用特殊含义数字,如114514" style="width:100%;max-width:420px;" required></p>
<p><em>可选描述</em><br><textarea name="desc"></textarea></p>
<p><strong>资历</strong>
<label><input type="radio" name="tier" value="老逼" checked> <span class="tag gold">老逼</span></label>
<label><input type="radio" name="tier" value="中逼"> <span class="tag silver">中逼</span></label>
<label><input type="radio" name="tier" value="小逼"> <span class="tag bronze">小逼</span></label>
</p>
<p><strong>时效</strong>
<select name="expiry" id="expirySelect">
<option value="3600">1小时后过期</option>
<option value="10800">3小时后过期</option>
<option value="86400">1天后过期</option>
</select>
</p>
<fieldset style="border:2px solid #cbbfb0; border-radius:60px; padding:20px;">
<legend style="font-weight:600; background:white; padding:6px 22px; border-radius:60px;">选择卡组ban位</legend>
<div class="major-nav" id="majorNav">
<div class="major-nav-item" data-major="苏" onclick="selectMajor('苏')">苏联</div>
<div class="major-nav-item" data-major="德" onclick="selectMajor('德')">德国</div>
<div class="major-nav-item" data-major="英" onclick="selectMajor('英')">英国</div>
<div class="major-nav-item" data-major="美" onclick="selectMajor('美')">美国</div>
<div class="major-nav-item" data-major="日" onclick="selectMajor('日')">日本</div>
</div>
<div id="allySU" class="ally-box" style="display: none;"><div class="ally-header"><p>苏联·ban以下盟国</p><span><span class="select-all-btn" onclick="toggleAll('su', true)">全选</span><span class="deselect-all-btn" onclick="toggleAll('su', false)">取消全选</span></span></div><div class="checkbox-grid" id="suAllies"><label><input type="checkbox" name="ally_su" value="苏">苏联</label><label><input type="checkbox" name="ally_su" value="德">德国</label><label><input type="checkbox" name="ally_su" value="英">英国</label><label><input type="checkbox" name="ally_su" value="美">美国</label><label><input type="checkbox" name="ally_su" value="日">日本</label><label><input type="checkbox" name="ally_su" value="意">意大利</label><label><input type="checkbox" name="ally_su" value="法">法国</label><label><input type="checkbox" name="ally_su" value="波">波兰</label><label><input type="checkbox" name="ally_su" value="芬">芬兰</label></div></div>
<div id="allyDE" class="ally-box" style="display: none;"><div class="ally-header"><p>德国·ban以下盟国</p><span><span class="select-all-btn" onclick="toggleAll('de', true)">全选</span><span class="deselect-all-btn" onclick="toggleAll('de', false)">取消全选</span></span></div><div class="checkbox-grid" id="deAllies"><label><input type="checkbox" name="ally_de" value="苏">苏联</label><label><input type="checkbox" name="ally_de" value="德">德国</label><label><input type="checkbox" name="ally_de" value="英">英国</label><label><input type="checkbox" name="ally_de" value="美">美国</label><label><input type="checkbox" name="ally_de" value="日">日本</label><label><input type="checkbox" name="ally_de" value="意">意大利</label><label><input type="checkbox" name="ally_de" value="法">法国</label><label><input type="checkbox" name="ally_de" value="波">波兰</label><label><input type="checkbox" name="ally_de" value="芬">芬兰</label></div></div>
<div id="allyUK" class="ally-box" style="display: none;"><div class="ally-header"><p>英国·ban以下盟国</p><span><span class="select-all-btn" onclick="toggleAll('uk', true)">全选</span><span class="deselect-all-btn" onclick="toggleAll('uk', false)">取消全选</span></span></div><div class="checkbox-grid" id="ukAllies"><label><input type="checkbox" name="ally_uk" value="苏">苏联</label><label><input type="checkbox" name="ally_uk" value="德">德国</label><label><input type="checkbox" name="ally_uk" value="英">英国</label><label><input type="checkbox" name="ally_uk" value="美">美国</label><label><input type="checkbox" name="ally_uk" value="日">日本</label><label><input type="checkbox" name="ally_uk" value="意">意大利</label><label><input type="checkbox" name="ally_uk" value="法">法国</label><label><input type="checkbox" name="ally_uk" value="波">波兰</label><label><input type="checkbox" name="ally_uk" value="芬">芬兰</label></div></div>
<div id="allyUS" class="ally-box" style="display: none;"><div class="ally-header"><p>美国·ban以下盟国</p><span><span class="select-all-btn" onclick="toggleAll('us', true)">全选</span><span class="deselect-all-btn" onclick="toggleAll('us', false)">取消全选</span></span></div><div class="checkbox-grid" id="usAllies"><label><input type="checkbox" name="ally_us" value="苏">苏联</label><label><input type="checkbox" name="ally_us" value="德">德国</label><label><input type="checkbox" name="ally_us" value="英">英国</label><label><input type="checkbox" name="ally_us" value="美">美国</label><label><input type="checkbox" name="ally_us" value="日">日本</label><label><input type="checkbox" name="ally_us" value="意">意大利</label><label><input type="checkbox" name="ally_us" value="法">法国</label><label><input type="checkbox" name="ally_us" value="波">波兰</label><label><input type="checkbox" name="ally_us" value="芬">芬兰</label></div></div>
<div id="allyJP" class="ally-box" style="display: none;"><div class="ally-header"><p>日本·ban以下盟国</p><span><span class="select-all-btn" onclick="toggleAll('jp', true)">全选</span><span class="deselect-all-btn" onclick="toggleAll('jp', false)">取消全选</span></span></div><div class="checkbox-grid" id="jpAllies"><label><input type="checkbox" name="ally_jp" value="苏">苏联</label><label><input type="checkbox" name="ally_jp" value="德">德国</label><label><input type="checkbox" name="ally_jp" value="英">英国</label><label><input type="checkbox" name="ally_jp" value="美">美国</label><label><input type="checkbox" name="ally_jp" value="日">日本</label><label><input type="checkbox" name="ally_jp" value="意">意大利</label><label><input type="checkbox" name="ally_jp" value="法">法国</label><label><input type="checkbox" name="ally_jp" value="波">波兰</label><label><input type="checkbox" name="ally_jp" value="芬">芬兰</label></div></div>
</fieldset>
<p style="margin:28px 0 16px;"><button type="submit">发布申请</button><button type="reset" class="btn-secondary">重置</button></p>
</form>
<hr style="border-top:3px solid #d1c2b2; margin:40px 0;">
</div>
<!-- 筛选区域 -->
<div class="filter-area">
<h2>🔍筛选申请</h2>
<form id="filterForm">
<div class="filter-row"><span class="filter-label">资历</span><div class="filter-options"><label><input type="checkbox" name="filter_tier" value="老逼" checked> 老逼</label><label><input type="checkbox" name="filter_tier" value="中逼" checked> 中逼</label><label><input type="checkbox" name="filter_tier" value="小逼" checked> 小逼</label></div></div>
<div class="filter-row"><span class="filter-label">时效</span><div class="filter-options"><label><input type="radio" name="filter_expiry" value="all" checked> 全部</label><label><input type="radio" name="filter_expiry" value="1h"> 1小时内</label><label><input type="radio" name="filter_expiry" value="3h"> 3小时内</label><label><input type="radio" name="filter_expiry" value="today"> 今日</label></div></div>
<div class="filter-row">
<span class="filter-label">预期卡组</span>
<div style="display:flex; flex-direction:column; gap:12px; width:100%;">
<div class="filter-major-group" id="filterMajorGroup">
<span class="filter-major-item" data-major="" onclick="selectFilterMajor('')">任意主国</span>
<span class="filter-major-item" data-major="苏" onclick="selectFilterMajor('苏')">苏联</span>
<span class="filter-major-item" data-major="德" onclick="selectFilterMajor('德')">德国</span>
<span class="filter-major-item" data-major="英" onclick="selectFilterMajor('英')">英国</span>
<span class="filter-major-item" data-major="美" onclick="selectFilterMajor('美')">美国</span>
<span class="filter-major-item" data-major="日" onclick="selectFilterMajor('日')">日本</span>
</div>
<div class="filter-ally-group" id="filterAllyGroup">
<span class="filter-ally-item" data-ally="" onclick="selectFilterAlly('')">任意盟国</span>
<span class="filter-ally-item" data-ally="苏" onclick="selectFilterAlly('苏')">苏联</span>
<span class="filter-ally-item" data-ally="德" onclick="selectFilterAlly('德')">德国</span>
<span class="filter-ally-item" data-ally="英" onclick="selectFilterAlly('英')">英国</span>
<span class="filter-ally-item" data-ally="美" onclick="selectFilterAlly('美')">美国</span>
<span class="filter-ally-item" data-ally="日" onclick="selectFilterAlly('日')">日本</span>
<span class="filter-ally-item" data-ally="意" onclick="selectFilterAlly('意')">意大利</span>
<span class="filter-ally-item" data-ally="法" onclick="selectFilterAlly('法')">法国</span>
<span class="filter-ally-item" data-ally="波" onclick="selectFilterAlly('波')">波兰</span>
<span class="filter-ally-item" data-ally="芬" onclick="selectFilterAlly('芬')">芬兰</span>
</div>
</div>
</div>
<div style="margin-top:20px;"><button type="submit">应用筛选</button></div>
</form>
<hr style="border-top:3px solid #d1c2b2; margin:40px 0;">
</div>
<!-- 公示卡片容器 -->
<div id="cardContainer"><h2>📋击剑申请</h2><div id="cardsList"></div></div>
<!-- 底部替换为简单图标链接行 -->
<div class="footer-simple">
<a href="https://github.com/CraftSoul/kards-duel" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/github.svg" alt="gayhub" style="filter: invert(0);"> GitHub
</a>
<a href="https://space.bilibili.com/3546775476505152" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/bilibili.svg" alt="ilidilid" style="filter: invert(0);"> BiliBili
</a>
<a href="https://www.douyin.com/user/MS4wLjABAAAAERwZXqP_VI8qTqzyV-A6aJircP4R6tiOBRCY5QCFQrAd_gZ8z-LsyNvUHuDipQ7S" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/tiktok.svg" alt="西大快乐音" style="filter: invert(0);"> 抖音
</a>
<a href="https://www.zhihu.com/people/7-97-53-5-79" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/zhihu.svg" alt="不知" style="filter: invert(0);"> 知乎
</a>
</div>
</div>
<!-- 启动公告弹窗 -->
<div id="startupModal" class="modal-overlay">
<div class="modal-card">
<h2>诚挚问候</h2>
<img src="宝马.png" alt="炸渣帅吴迪">
<p style="font-size:1.2rem; margin-bottom:-8px;">欢迎来到KARDS击剑大厅,祝好运,玩开心!</p>
<p style="font-size:0.6rem; margin-bottom:16px;">·请自觉遵守文明规范,共同维护秩序,切勿刷屏、引战、总参二局等<br>
·本站部署于github pages,访问速度间歇性流畅,能给个star吗QAQ<br>
·通过底部👇链接呼叫殖民地</p>
<button onclick="closeModal()">开始击剑</button>
</div>
</div>
<script>
// ==================== 配置 JSONBin.io ====================
const BIN_ID = '699165fa43b1c97be9803227';
const API_KEY = '$2a$10$3LnTLPNHEK/IU.4sdAXkMOdTVG3bLzFpB/EoQun9xru69bYCn1JOO'; // 请妥善保管,此处已按需填入
// ==================== 全局变量 ====================
let cards = []; // 内存中的卡片数组
let nextId = 1; // 仅用于新建卡片时生成临时id,但云端会用已有id
let selectedMajor = null; // 发布时当前选中的主国
// 筛选状态
let selectedFilterMajor = '';
let selectedFilterAlly = '';
// ==================== 工具函数:与JSONBin同步 ====================
async function loadCardsFromCloud() {
try {
const response = await fetch(`https://api.jsonbin.io/v3/b/${BIN_ID}/latest`, {
headers: { 'X-Master-Key': API_KEY }
});
if (!response.ok) throw new Error('云端读取失败');
const data = await response.json();
// 确保数据结构正确,兼容旧版本
if (data.record && Array.isArray(data.record.cards)) {
cards = data.record.cards;
} else if (Array.isArray(data.record)) {
// 万一直接存成数组
cards = data.record;
} else {
cards = [];
}
// 计算下一个可用id(保护自增)
nextId = cards.reduce((max, c) => Math.max(max, c.id || 0), 0) + 1;
} catch (e) {
console.warn('从JSONBin加载失败,使用空列表', e);
cards = [];
nextId = 1;
}
renderCards(); // 渲染界面
}
async function saveCardsToCloud() {
try {
// 发送前先过滤掉过期的卡片(云端也同步清理)
const now = Date.now();
cards = cards.filter(c => c.expiresAt > now);
const response = await fetch(`https://api.jsonbin.io/v3/b/${BIN_ID}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'X-Master-Key': API_KEY
},
body: JSON.stringify({ cards })
});
if (!response.ok) console.warn('云端保存失败');
} catch (e) {
console.error('保存到JSONBin出错', e);
}
// 保存后重新渲染一下保证过期卡片消失
renderCards();
}
// ==================== 发布相关 ====================
function selectMajor(major) {
document.querySelectorAll('.major-nav-item').forEach(el => el.classList.toggle('selected', el.dataset.major === major));
selectedMajor = major;
['allySU','allyDE','allyUK','allyUS','allyJP'].forEach(id => document.getElementById(id).style.display = 'none');
const map = {苏:'allySU',德:'allyDE',英:'allyUK',美:'allyUS',日:'allyJP'};
if (map[major]) document.getElementById(map[major]).style.display = 'block';
}
function toggleAll(m, checked) {
const prefix = {su:'su', de:'de', uk:'uk', us:'us', jp:'jp'}[m];
const container = document.getElementById(`${prefix}Allies`);
if (container) container.querySelectorAll('input[type="checkbox"]').forEach(cb => cb.checked = checked);
}
function getExcludedCombos() {
const combos = [];
const majors = ['苏','德','英','美','日'];
majors.forEach(major => {
let selector = {苏:'ally_su',德:'ally_de',英:'ally_uk',美:'ally_us',日:'ally_jp'}[major];
document.querySelectorAll(`input[name="${selector}"]:checked`).forEach(cb => combos.push({ major, ally: cb.value }));
});
return combos;
}
// 发布提交
document.getElementById('publishForm').addEventListener('submit', async (e) => {
e.preventDefault();
const code = document.querySelector('input[name="code"]').value.trim();
if (!code) return alert('战斗代码不能为空');
const desc = document.querySelector('textarea[name="desc"]').value;
const tier = document.querySelector('input[name="tier"]:checked')?.value;
const expirySec = parseInt(document.getElementById('expirySelect').value);
const excluded = getExcludedCombos();
const now = Date.now();
const newCard = {
id: nextId++,
code,
desc,
tier,
excluded,
createdAt: now,
expiresAt: now + expirySec * 1000,
expiryLabel: expirySec === 3600 ? '1小时' : (expirySec === 10800 ? '3小时' : '1天')
};
cards.push(newCard);
await saveCardsToCloud(); // 保存到云端
// 重置表单
e.target.reset();
document.querySelectorAll('.ally-box').forEach(b => b.style.display = 'none');
document.querySelectorAll('.major-nav-item').forEach(el => el.classList.remove('selected'));
selectedMajor = null;
renderCards();
});
// ==================== 删除卡片 ====================
async function deleteCard(id) {
if (!confirm('确定删除这条申请吗?')) return;
cards = cards.filter(c => c.id !== id);
await saveCardsToCloud(); // 删除后同步云端
renderCards();
}
// ==================== 筛选函数 ====================
function selectFilterMajor(major) {
selectedFilterMajor = major;
document.querySelectorAll('#filterMajorGroup .filter-major-item').forEach(el => el.classList.toggle('selected', el.dataset.major === major));
renderCards();
}
function selectFilterAlly(ally) {
selectedFilterAlly = ally;
document.querySelectorAll('#filterAllyGroup .filter-ally-item').forEach(el => el.classList.toggle('selected', el.dataset.ally === ally));
renderCards();
}
// ==================== 渲染卡片 ====================
function getTimeLeft(expiresAt) {
const diff = expiresAt - Date.now();
if (diff <= 0) return '已过期';
const min = Math.floor(diff / 60000);
if (min < 60) return `${min}分钟`;
const hour = Math.floor(min / 60);
return `${hour}小时${min % 60}分`;
}
function renderCards() {
// 先过滤内存中过期的 (但云端已经保存过有效数据)
const now = Date.now();
cards = cards.filter(c => c.expiresAt > now);
const container = document.getElementById('cardsList');
if (!container) return;
// 获取筛选条件
const filterTiers = Array.from(document.querySelectorAll('input[name="filter_tier"]:checked')).map(cb => cb.value);
const filterExpiry = document.querySelector('input[name="filter_expiry"]:checked')?.value;
let filtered = cards.filter(c => {
// 等级筛选
if (!filterTiers.includes(c.tier)) return false;
// 时效筛选
if (filterExpiry !== 'all') {
const totalHours = (c.expiresAt - c.createdAt) / 3600000;
const ageHours = (now - c.createdAt) / 3600000;
if (filterExpiry === '1h' && (totalHours > 1.1 || ageHours > 1)) return false;
if (filterExpiry === '3h' && (totalHours > 3.1 || ageHours > 3)) return false;
if (filterExpiry === 'today' && (totalHours > 24 || ageHours > 24)) return false;
}
return true;
});
// 卡组筛选逻辑 (根据主国/盟国排除)
if (selectedFilterMajor && selectedFilterAlly) {
filtered = filtered.filter(c => !c.excluded.some(ex => ex.major === selectedFilterMajor && ex.ally === selectedFilterAlly));
} else if (selectedFilterMajor && !selectedFilterAlly) {
const allAllies = ['苏','德','英','美','日','意','法','波','芬'];
filtered = filtered.filter(c => {
const excludedMajors = c.excluded.filter(ex => ex.major === selectedFilterMajor).map(ex => ex.ally);
return !allAllies.every(ally => excludedMajors.includes(ally));
});
} else if (!selectedFilterMajor && selectedFilterAlly) {
const allMajors = ['苏','德','英','美','日'];
filtered = filtered.filter(c => {
return !allMajors.every(m => c.excluded.some(ex => ex.major === m && ex.ally === selectedFilterAlly));
});
}
if (filtered.length === 0) {
container.innerHTML = '<div style="text-align:center; padding:50px; background:#ece4d9; border-radius:80px;">比我兜里还干净</div>';
return;
}
container.innerHTML = filtered.map(c => {
const tierClass = c.tier === '老逼' ? 'gold' : (c.tier === '中逼' ? 'silver' : 'bronze');
const timeLeft = getTimeLeft(c.expiresAt);
const grouped = {};
c.excluded.forEach(({ major, ally }) => {
if (!grouped[major]) grouped[major] = [];
grouped[major].push(ally);
});
const allAllies = ['苏','德','英','美','日','意','法','波','芬'];
const majorsOrder = ['苏','德','英','美','日'];
let groupsHtml = '';
for (let maj of majorsOrder) {
if (grouped[maj] && grouped[maj].length > 0) {
const allies = [...new Set(grouped[maj])].sort();
const isFull = allAllies.every(a => allies.includes(a));
if (isFull) {
groupsHtml += `<div class="major-nested-group"><span class="major-alone">${maj}</span></div>`;
} else {
const innerAlliesHtml = allies.map(ally => `<span class="banned-ally">${ally}</span>`).join('');
groupsHtml += `
<div class="major-nested-group">
<span class="outer-major-circle">${maj}
<span class="inner-ally-circle">${innerAlliesHtml}</span>
</span>
</div>`;
}
}
}
const exclusionHtml = c.excluded.length ? `
<div class="exclusion-area">
<div class="exclusion-title">🚫ban位</div>
${groupsHtml}
</div>` : '';
return `
<div class="card" data-id="${c.id}">
<div class="card-header">
<h3><strong>${c.code}</strong></h3>
<span class="tag ${tierClass}">${c.tier}</span>
<span class="expiry">${c.expiryLabel}</span>
</div>
${c.desc ? `<div class="desc">${c.desc}</div>` : ''}
${exclusionHtml}
<div class="card-footer">
<span class="time-left">⏳️剩余 ${timeLeft}</span>
<button class="delete-btn" onclick="deleteCard(${c.id})">删除</button>
</div>
</div>`;
}).join('');
}
// ==================== 事件绑定与初始化 ====================
document.getElementById('filterForm').addEventListener('submit', (e) => { e.preventDefault(); renderCards(); });
document.querySelectorAll('input[name="filter_tier"], input[name="filter_expiry"]').forEach(el => el.addEventListener('change', renderCards));
// 启动后先加载云端数据,然后再渲染
window.addEventListener('load', () => {
loadCardsFromCloud().then(() => {
// 每60秒检查一次过期并触发渲染,同时也建议定期保存(但保存已在增删时触发)
setInterval(() => {
// 检查过期并从内存过滤,然后仅重新渲染(不自动保存到云端,避免不必要的写入;但可以定期同步)
const before = cards.length;
cards = cards.filter(c => c.expiresAt > Date.now());
if (cards.length !== before) {
// 如果有过期卡片,顺便更新云端
saveCardsToCloud();
} else {
renderCards(); // 只刷新显示
}
}, 60000);
});
});
// 导出全局函数供HTML onclick调用
window.selectMajor = selectMajor;
window.toggleAll = toggleAll;
window.selectFilterMajor = selectFilterMajor;
window.selectFilterAlly = selectFilterAlly;
window.deleteCard = deleteCard;
window.closeModal = function() {
document.getElementById('startupModal').style.display = 'none';
};
// 初始化显示modal
window.closeModal = function() {
document.getElementById('startupModal').style.display = 'none';
};
</script>
</body>
</html>