-
Notifications
You must be signed in to change notification settings - Fork 1
/
index_for_Firefox&safari.html
355 lines (325 loc) · 9.2 KB
/
index_for_Firefox&safari.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
<!DOCTYPE html>
<!-- This HTML page programed by Jerry114514@github; About this project's Github page: https://github.com/Jerry114514/bf1-web-tool-HTML-Template -->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>bf1网页管理工具</title>
<!-- 从百度cdn引用JQ -->
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<style type="text/css">
body {
display: flex;
flex-direction: column;
align-items: center;
}
h2,
h3,
span {
transition: background-color, 1s;
}
a {
transition: color, 1s;
}
.info,
.info2 {
border-radius: 20px;
}
/* 标题 */
.bigti {
color: aqua;
}
#circle {
display: flex;
position: absolute;
top: 95.5%;
left: 96%;
width: 30px;
height: 30px;
border-radius: 50%;
background: linear-gradient(to right, black, white);
cursor: pointer;
z-index: 9;
}
#circFunction {
display: flex;
position: absolute;
top: 95.8%;
left: 87.5%;
border-radius: 20px;
font-weight: 1000;
font-family: "SDK_SC_Web";
}
/* 信息输入区域与(此处插入模块3)背景 */
#mainArea {
display: flex;
flex-direction: row;
align-items: center;
}
.info {
display: flex;
/*透明度0.6*/
background-color: rgba(255, 255, 255, 0.6);
/*长宽*/
width: 400px;
height: 85vh;
/*高斯模糊*/
backdrop-filter: blur(20px);
/* 竖轴居中 */
flex-direction: column;
align-items: center;
text-align: center;
transition: background-color, 1s;
}
/* 输入表单 */
.idipt {
/*长宽*/
width: 350px;
height: 50px;
/*透明背景色*/
background-color: rgba(255, 255, 255, 0);
/*只保留底部边框*/
border-top: none;
border-left: none;
border-right: none;
transition: background-color, 1s;
}
::placeholder {
font-size: 20px;
}
input:focus {
/* 去除outline */
outline: none;
}
.btn {
width: 250px;
height: 50px;
border-radius: 50px;
border: none;
cursor: pointer;
font-size: 15px;
transition: background-color, 1s;
}
#gameSearch {
background-color: rgb(76, 183, 255);
}
/*-------------------------------------------------------------------*/
/*战局信息模块背景*/
.info2 {
display: flex;
/*透明度0.6*/
background-color: rgba(255, 255, 255, 0.6);
/*外边距*/
margin-left: 2%;
/*长宽*/
width: 950px;
height: 85vh;
/*高斯模糊*/
backdrop-filter: blur(10px);
/* 竖轴居中 */
flex-direction: column;
align-items: center;
text-align: center;
transition: background-color, 1s;
}
#operator {
margin-left: 2%;
transition: background-color, 1s;
}
#checkPlayer {
margin-top: 20px;
background-color: rgb(93, 255, 78);
}
#changeSide {
margin-top: 20px;
background-color: aquamarine;
}
#kickPlayer {
margin-top: 20px;
background-color: rgb(255, 208, 0);
}
#banPlayer {
margin-top: 20px;
background-color: red;
}
</style>
<script type="text/javascript"></script>
</head>
<body background=".\图包\nightTower.jpg">
<!-- 主题切换 -->
<div id="circle"></div>
<div id="circFunction">更换至夜间主题==></div>
<h1 class="bigti">战地1网页管理工具</h1>
<div id="mainArea">
<!--在此输入gameid,remid和sid-->
<!-- 信息输入板块 -->
<div class="info" id="serverInfo">
<h3>请先填写您的服务器的信息</h3>
<br />
<br />
<!-- 输入remid -->
<form class="remid" method="post">
<input
type="text"
name="remid"
placeholder="输入remid"
oninvalid="setCustomValidity('必须输入remid!')"
oninput="setCustomValidity"
required
class="idipt"
/>
<br />
<span>
<a href=".\remid-help.html">如何获取remid?点击这里查看</a>
</span>
</form>
<br />
<br />
<br />
<br />
<br />
<br />
<!-- 输入sid -->
<form class="sid" method="post">
<input
type="text"
name="remid"
placeholder="输入sid"
oninvalid="setCustomValidity('必须输入sid!')"
oninput="setCustomValidity"
required
class="idipt"
/>
<br />
<span>
<a href=".\sid-help.html">如何获取sid?点击这里查看</a>
</span>
</form>
<br />
<br />
<br />
<br />
<br />
<br />
<!-- 输入gameid -->
<form class="gameid" method="post">
<input
type="text"
name="remid"
placeholder="输入gameid"
oninvalid="setCustomValidity('必须输入gameid!')"
oninput="setCustomValidity"
required
class="idipt"
/>
</form>
<br />
<button type="button" class="btn" id="gameidSearch">
不知道GameID?点此搜索
</button>
</div>
<!-- 服务器主要模块 -->
<div class="info2">
<div>
<h2>服务器名称</h2>
<h2>
<span>服务器人数:</span>
<span>当前游玩地图:</span>
</h2>
</div>
</div>
<!-- 操作模块 -->
<div class="info" id="operator">
<br />
<button type="button" class="btn" id="checkPlayer">
查询该玩家战绩
</button>
<button type="button" class="btn" id="changeSide">
更换玩家所属阵营(换边)
</button>
<button type="button" class="btn" id="kickPlayer">踢出该玩家</button>
<button type="button" class="btn" id="banPlayer">
在此服务器中封禁该玩家
</button>
</div>
</div>
<script>
let dayNight = document.querySelector("#circle");
let msg1 = document.querySelectorAll(".info");
let msg2 = document.querySelectorAll(".info2");
let bw = false;
/* 通过i是否能被2整除判定点击次数以调整主题 */
dayNight.addEventListener("click", function () {
if (bw) {
/* 切换至暗色主题 */
for (let j = 0; j < msg1.length; j++) {
msg1[j].style.backgroundColor = "rgba(255, 255, 255, 0.6)";
}
for (let j = 0; j < msg2.length; j++) {
msg2[j].style.backgroundColor = "rgba(255, 255, 255, 0.6)";
}
/* 已经...变成jq的形状了... */
$("h2").css({
color: "black",
});
$("h3").css({
color: "black",
});
$("span").css({
color: "black",
});
$("a").css({
color: "blue",
});
bw = true;
} else {
/* 切换回明色主题 */
for (let j = 0; j < msg1.length; j++) {
msg1[j].style.backgroundColor = "rgba(0, 0, 0, 0.6)";
}
for (let j = 0; j < msg2.length; j++) {
msg2[j].style.backgroundColor = "rgba(0, 0, 0, 0.6)";
}
$("h2").css({
color: "white",
});
$("h3").css({
color: "white",
});
$("span").css({
color: "white",
});
$("a").css({
color: "#58ff00",
});
}
bw = !bw; // 反转bw的值
let browserFlag = {};
let uaFlag = navigator.userAgent.toLowerCase();
// 检测是否为Firefox
let isFirefox = /firefox/.test(uaFlag);
if (isFirefox) {
browserFlag.firefox = true;
}
// 检测是否为Firefox for Android
let isFirefoxAndroid = /android|firefox\s+android/i.test(uaFlag);
if (isFirefoxAndroid) {
browserFlag.firefoxAndroid = true;
}
// 检测是否为Safari
let isSafari = /safari/.test(uaFlag) && !/(chrome|crios)/i.test(uaFlag);
if (isSafari) {
browserFlag.safari = true;
}
// 检测是否为Safari for iOS
let isSafariIOS =
/iphone|ipad|ipod/i.test(uaFlag) && /safari/i.test(uaFlag);
if (isSafariIOS) {
browserFlag.safariIOS = true;
}
console.log(browserFlag); // 输出检测结果
});
</script>
</body>
</html>