forked from malaohu/MobaXterm-GenKey
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
194 lines (169 loc) · 5.04 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
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>MobaXterm GenKey</title>
<link href="https://fonts.googleapis.cnpmjs.org/css?family=Roboto:300,400,500,700" rel="stylesheet">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
form {
width: 350px; /* Set the width of the form */
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
background: #f5f5f5;
}
h1 {
color: #303F9F;
text-justify: newspaper;
text-align: justify;
margin-bottom: 20px;
}
.container {
margin-top: 10px;
margin-bottom: 10px;
}
button {
display: block;
width: 100%;
padding: 13px;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
margin: 5px 0 20px;
font-size: 15px;
}
button:hover {
background-color: #007bff;
}
.github {
text-align: center;
}
html, body {
display: flex;
justify-content: center;
font-family: Roboto, Arial, sans-serif;
font-size: 15px;
background-color: #2b2b2b;
color: #212121;
}
form {
border: 5px solid #f1f1f1;
}
input[type=text], input[type=text] {
width: 100%;
padding: 16px 8px;
margin: 10px 0 10px;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
#space {
height: 15px;
}
h1 {
text-align: center;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px 0;
text-align: left;
}
.github {
padding: 20px 0 0;
text-align: right;
}
.github span {
color: #212121;
font-size: smaller;
}
.github span a {
color: #242424;
font-weight: bold;
}
.github span a img {
height: 18px;
padding-bottom: 3px;
vertical-align: middle;
}
#btnReset {
margin-top: 15px;
background-color: #757575;
}
#btnSubmit {
background-color: #3F51B5;
}
#lblName, #lblVersion {
font-weight: bold;
}
#inputName, #inputVersion {
height: 35px;
margin-top: 10px;
border: 1px solid #ccc;
padding: 5px 5px 5px 10px;
}
#inputName {
height: 47px;
color: #333;
}
#inputVersion {
width: 334px;
height: 35px;
}
</style>
</head>
<body>
<form action="./gen" mothod="get">
<h1>MobaXterm GenKey</h1>
<div class="container">
<label for="name" id="lblName">Name</label>
<label style="width: 350px; display: block;">
<input name="name" id="inputName" placeholder="Please enter name" required type="text">
</label>
<div id="space"></div>
<label for="ver" id="lblVersion">Version</label>
<label style="width: 350px; display: block;">
<input name="ver" id="inputVersion" type="number" placeholder="Please enter version" step="0.1" min="0" />
</label>
</div>
<button id="btnReset" type="reset">Reset</button>
<button id="btnSubmit" type="submit">Generate</button>
<div class="github">
<span>
<a href="https://github.com/lzcapp/MobaXterm-GenKey" style="text-decoration: none;">
<img src="https://github.githubassets.com/favicons/favicon.svg" alt="GitHub">
MobaXterm-GenKey
</a>
<span id="forked">forked from</span>
<a href="https://github.com/malaohu/MobaXterm-GenKey" style="text-decoration: none;">
malaohu
</a>
</span>
</div>
</form>
<script>
const userLanguage = navigator.language || navigator.userLanguage;
const languageCode = userLanguage.substring(0, 2);
console.log(languageCode);
if (languageCode === "zh") {
document.documentElement.lang = "zh";
document.getElementById("lblName").innerHTML = "用户名"
document.getElementById("inputName").placeholder = "请输入用户名"
document.getElementById("lblVersion").innerHTML = "版本"
document.getElementById("inputVersion").placeholder = "请输入版本"
document.getElementById("btnReset").innerHTML = "清空"
document.getElementById("btnSubmit").innerHTML = "生成"
document.getElementById("forked").innerHTML = "分叉自"
}
</script>
</body>
</html>