Skip to content

Commit 41199fa

Browse files
authored
添加“验证 HMCL 文件”页面 (#476)
1 parent 8442d41 commit 41199fa

3 files changed

Lines changed: 507 additions & 0 deletions

File tree

_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ docs:
4949
url: /changelog/dev.html
5050
- title: 其他
5151
children:
52+
- title: 验证 HMCL
53+
url: /verify.html
5254
- title: 用户协议
5355
url: /eula/hmcl.html
5456
- title: 贡献指南

_pages/verify.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: 验证 HMCL 文件
3+
permalink: /verify.html
4+
toc: false
5+
---
6+
7+
<div class="hmcl-verify">
8+
<p>检查 HMCL 文件是否是官方构建。</p>
9+
10+
<div class="hmcl-verify__actions">
11+
<label class="hmcl-verify__button" for="hmcl-verify-file">选择文件</label>
12+
<span id="hmcl-verify-selected-file" class="hmcl-verify__file">未选择文件</span>
13+
<input id="hmcl-verify-file" class="hmcl-verify__input" type="file" accept=".jar,.exe,.sh">
14+
</div>
15+
16+
<div id="hmcl-verify-result" class="hmcl-verify__result" role="status" aria-live="polite" hidden></div>
17+
</div>
18+
19+
<style>
20+
.hmcl-verify {
21+
max-width: 42rem;
22+
font-size: 1rem;
23+
line-height: 1.65;
24+
}
25+
26+
.hmcl-verify p {
27+
margin-bottom: 1rem;
28+
}
29+
30+
.hmcl-verify__actions {
31+
display: flex;
32+
align-items: center;
33+
gap: .75rem;
34+
flex-wrap: wrap;
35+
margin: 1rem 0;
36+
}
37+
38+
.hmcl-verify__button {
39+
display: inline-flex;
40+
align-items: center;
41+
justify-content: center;
42+
min-height: 2.25rem;
43+
padding: .35rem .8rem;
44+
border: 1px solid rgba(127, 127, 127, .45);
45+
border-radius: 4px;
46+
background: rgba(127, 127, 127, .12);
47+
color: inherit;
48+
font-size: .9rem;
49+
line-height: 1.2;
50+
cursor: pointer;
51+
}
52+
53+
.hmcl-verify__button:hover {
54+
filter: brightness(.95);
55+
}
56+
57+
.hmcl-verify__file {
58+
min-width: 0;
59+
max-width: 100%;
60+
opacity: .72;
61+
font-size: .9rem;
62+
overflow-wrap: anywhere;
63+
}
64+
65+
.hmcl-verify__input {
66+
position: absolute;
67+
width: 1px;
68+
height: 1px;
69+
overflow: hidden;
70+
clip: rect(0, 0, 0, 0);
71+
}
72+
73+
.hmcl-verify__result {
74+
margin-top: 1rem;
75+
padding: .75rem .9rem;
76+
border: 1px solid rgba(127, 127, 127, .35);
77+
border-left-width: 4px;
78+
border-radius: 4px;
79+
background: rgba(127, 127, 127, .08);
80+
font-size: .95rem;
81+
line-height: 1.6;
82+
white-space: pre-wrap;
83+
}
84+
85+
.hmcl-verify__result[hidden] {
86+
display: none;
87+
}
88+
89+
.hmcl-verify__result[data-state="ok"] {
90+
border-color: #2e7d32;
91+
}
92+
93+
.hmcl-verify__result[data-state="error"] {
94+
border-color: #c62828;
95+
}
96+
</style>
97+
98+
<script src="{{ '/assets/js/hmcl-signature-verify.js' | relative_url }}"></script>

0 commit comments

Comments
 (0)