forked from Testanki1/testanki1.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
442 lines (399 loc) · 17.7 KB
/
main.html
File metadata and controls
442 lines (399 loc) · 17.7 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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>3D坦克服务器列表</title>
<link rel="shortcut icon" href="https://tankionline.com/favicon.ico" />
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;700&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=M+PLUS+1p&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Rubik', 'M PLUS 1p';
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
background: radial-gradient(rgb(32, 48, 64) 0%, rgb(3, 8, 13) 100%);
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
#modal-root {
pointer-events: none;
}
img {
pointer-events: none;
}
#modal-root > div {
pointer-events: auto;
}
.container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#mainContent .table, #partnersContent .table { /* Common table parent styles */
width: 80%;
max-width: 800px;
gap: 20px;
padding: 20px;
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
}
#mainContent .table {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
}
#mainContent .cell {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
/* Removed padding, background, border-radius as buttons will fill more */
}
#mainContent .cell p {
width: 100%; /* Allow p to guide button width */
margin: 5px 0;
}
#partnersContent .table {
max-height: 90vh;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive columns */
justify-content: center;
grid-auto-rows: min-content;
overflow-y: auto;
}
#partnersContent .cell {
display: flex;
flex-direction: column;
justify-content: flex-start; /* Align items to the top for potentially varying text lengths */
align-items: center;
text-align: center;
/* Removed padding, background, border-radius as buttons will fill more */
}
#partnersContent .cell p {
width: 100%; /* Allow p to guide button width */
margin: 5px 0; /* Space between multiple buttons/text in a cell */
}
#partnersContent .cell .info-text { /* For text like (暂不支持全屏) */
color: #FFFFFF;
font-size: 14px;
margin-top: 0px;
}
a { /* General link styles, not for styled-link-buttons */
text-decoration: none;
color: #BFD5FF;
transition: color 0.3s;
}
a:hover, a:active { /* General link hover/active, will be overridden by button specific active if applicable */
color: #76ff33 !important;
}
a.no-color-change {
color: rgba(191, 213, 255, 0.5) !important;
}
a.no-color-change:hover, a.no-color-change:active {
color: rgba(191, 213, 255, 0.5) !important;
}
/* a:hover span,
a:active span {
color: inherit !important;
} */ /* This might be too general, handled by .styled-link-button span */
/* Common Button Styles (for top/bottom utility buttons) */
.common-button {
position: absolute;
background-color: #76ff33;
padding: 10px;
border: none;
color: #001926;
font-size: 16px;
cursor: pointer;
border-radius: 10px;
transition: background-color 0.3s;
text-decoration: none;
text-align: center;
}
.common-button:hover {
background-color: #4CAF50;
}
#mainServerStatusButton { top: 10px; left: 10px; }
#mainAboutButton { top: 10px; right: 10px; }
#mainSettingsButton { bottom: 10px; right: 10px; }
#partnersBackButton { top: 10px; left: 10px; display: none; }
#partnersMobileButton { top: 10px; right: 10px; display: none; }
/* Popups */
.popup-container {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #001926;
color: #BFD5FF;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.popup-container a { /* Links inside popups */
display: block;
margin: 10px 0;
color: #BFD5FF;
}
.popup-container a:hover {
color: #76ff33;
}
.popup-container button, .popup-container .popup-close-button {
margin-top: 10px;
background-color: #76ff33;
border: none;
color: #001926;
padding: 5px 10px;
cursor: pointer;
border-radius: 5px;
}
.popup-container button:hover, .popup-container .popup-close-button:hover {
background-color: #4CAF50;
}
.popup-container .popup-close-button {
position: absolute; top: 5px; right: 10px; background: none;
color: #BFD5FF; font-size: 20px; padding: 0; margin:0;
}
.popup-container .popup-close-button:hover { color: #76ff33; background: none; }
/* Style for links that should look like main content buttons */
.styled-link-button {
display: block;
width: 100%;
padding: 15px 10px;
margin: 0; /* Paragraphs will handle spacing */
border: 2px solid #BFD5FF;
border-radius: 8px;
color: #BFD5FF;
background-color: rgba(255, 255, 255, 0.05);
font-size: 26px;
text-align: center;
text-decoration: none;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
cursor: pointer;
line-height: 1.3;
}
.styled-link-button span { /* For text within <a> that is wrapped in <span> */
color: inherit !important; /* Ensure span inherits color from <a> */
font-size: inherit !important; /* Ensure span inherits font-size from <a> */
/* No need to set color/font-size on span directly anymore */
}
.styled-link-button:hover {
color: #76FF33;
border-color: #76FF33;
background-color: rgba(118, 255, 51, 0.1);
}
.styled-link-button:active {
color: #76FF33 !important;
border-color: #76FF33 !important;
background-color: rgba(118, 255, 51, 0.2);
}
</style>
</head>
<body>
<!-- Buttons for Main View -->
<a href="/status" id="mainServerStatusButton" class="common-button">查看服务器状态</a>
<a href="/about" id="mainAboutButton" class="common-button">关于</a>
<button id="mainSettingsButton" class="common-button">设置</button>
<!-- Buttons for Partners View -->
<button id="partnersBackButton" class="common-button">返回</button>
<button id="partnersMobileButton" class="common-button">移动版平台</button>
<!-- Settings Popup (for Main View) -->
<div id="settingsPopup" class="popup-container">
<span class="popup-close-button" id="closeSettingsPopup">×</span>
<label for="customUrl">自定义网址:</label>
<input type="text" id="customUrl" placeholder="输入网址" />
<button id="redirectButton">跳转</button>
<div>
<input type="checkbox" id="chineseCheckbox" />
<label for="chineseCheckbox">外服锁定中文</label>
</div>
</div>
<!-- Mobile Platforms Popup (for Partners View) -->
<div id="mobilePlatformsPopup" class="popup-container">
<span class="popup-close-button" id="closeMobilePopup">×</span>
<a href="https://appgallery.huawei.com/app/C101972055">华为</a>
<a href="https://h5coml.vivo.com.cn/h5coml/appdetail_h5/browser_v2/index.html?appId=2900145">vivo</a>
<a href="https://app.mi.com/details?id=com.tankionline.mi">小米</a>
<a href="https://store.oppomobile.com/">OPPO</a>
<a href="https://appmarket-h5.cloud.honor.com/h5/share/latest/index.html?shareId=1818327235548016640">荣耀</a>
<a href="https://www.ldmnq.com/app/8762.html">雷电模拟器</a>
<button class="popup-close-button" onclick="document.getElementById('mobilePlatformsPopup').style.display = 'none';">关闭</button>
</div>
<div id="modal-root"></div>
<!-- Main Content Area -->
<div id="mainContent" class="container">
<div class="table">
<div class="cell">
<p><a href="https://3dtank.com/play" class="styled-link-button" id="guofuLink">国服</a></p>
</div>
<div class="cell">
<p><a href="https://tankionline.com/play?resources=https://s-de.eu.tankionline.com" class="styled-link-button" id="waifuLink">外服</a></p>
</div>
<div class="cell">
<p><a href="/test" class="styled-link-button" id="testServerLink">测试服</a></p>
</div>
<div class="cell">
<p><a href="#" id="navigateToPartners" class="styled-link-button">国服联运服</a></p>
</div>
</div>
</div>
<!-- Partners Content Area (initially hidden) -->
<div id="partnersContent" class="container" style="display: none;">
<div class="table">
<div class="cell">
<p><a href="https://my.4399.com/yxtk/" class="styled-link-button"><span>4399</span></a></p>
<p><a href="https://my.4399.com/yxtk/play?sid=1" class="styled-link-button"><span>-->自动登录>--</span></a></p>
</div>
<div class="cell">
<p><a href="http://web.7k7k.com/stat/game.php?target=3dtk" class="styled-link-button"><span>7k7k</span></a></p>
<p class="info-text">(暂不支持全屏)</p>
</div>
<div class="cell">
<p><a href="https://udblogin.yy.com/login.do?game=TKRJ&webyygame&hideNav=1&server=s1" class="styled-link-button"><span>YY</span></a></p>
</div>
<div class="cell">
<p><a href="http://wan.baidu.com/game?gameId=23699359" class="styled-link-button"><span>百度</span></a></p>
<p class="info-text">(暂不支持全屏)</p>
</div>
<div class="cell">
<p><a href="http://web.gamersky.com/Games/236.html" class="styled-link-button"><span>游民星空</span></a></p>
<p class="info-text">(暂不支持全屏)</p>
</div>
<div class="cell">
<p><a href="https://wans.ixinyou.com/games/tank/" class="styled-link-button"><span>心游</span></a></p>
<p class="info-text">(暂不支持全屏)</p>
</div>
<div class="cell">
<p><a href="https://game.qzone.qq.com/1102530450" class="styled-link-button"><span>QQ空间</span></a></p>
<p class="info-text">(需要桌面版网站)</p>
</div>
<div class="cell">
<p><a href="https://wan.ludashi.com/yeyou/tk3d?s=1" class="styled-link-button"><span>鲁大师</span></a></p>
<p class="info-text">(暂不支持全屏)</p>
</div>
</div>
</div>
<script>
const mainContent = document.getElementById('mainContent');
const partnersContent = document.getElementById('partnersContent');
const mainServerStatusButton = document.getElementById('mainServerStatusButton');
const mainAboutButton = document.getElementById('mainAboutButton');
const mainSettingsButton = document.getElementById('mainSettingsButton');
const partnersBackButton = document.getElementById('partnersBackButton');
const partnersMobileButton = document.getElementById('partnersMobileButton');
const settingsPopup = document.getElementById('settingsPopup');
const mobilePlatformsPopup = document.getElementById('mobilePlatformsPopup');
// --- Navigation Logic ---
document.getElementById('navigateToPartners').addEventListener('click', function(e) {
e.preventDefault();
mainContent.style.display = 'none';
partnersContent.style.display = 'flex';
document.title = "3D坦克服务器列表 联运服";
mainServerStatusButton.style.display = 'none';
mainAboutButton.style.display = 'none';
mainSettingsButton.style.display = 'none';
partnersBackButton.style.display = 'block';
partnersMobileButton.style.display = 'block';
});
partnersBackButton.addEventListener('click', function() {
partnersContent.style.display = 'none';
mainContent.style.display = 'flex';
document.title = "3D坦克服务器列表";
mainServerStatusButton.style.display = 'block';
mainAboutButton.style.display = 'block';
mainSettingsButton.style.display = 'block';
partnersBackButton.style.display = 'none';
partnersMobileButton.style.display = 'none';
});
// --- Settings Popup Logic ---
mainSettingsButton.addEventListener('click', function() {
settingsPopup.style.display = 'block';
});
document.getElementById('closeSettingsPopup').addEventListener('click', function() {
settingsPopup.style.display = 'none';
});
document.getElementById('redirectButton').addEventListener('click', function() {
var customUrl = document.getElementById('customUrl').value;
if (customUrl.trim() !== '') {
if (!customUrl.startsWith('http://') && !customUrl.startsWith('https://')) {
customUrl = 'http://' + customUrl;
}
window.location.href = customUrl;
}
});
window.addEventListener('click', function(event) {
if (event.target === settingsPopup) {
settingsPopup.style.display = 'none';
}
if (event.target === mobilePlatformsPopup) {
mobilePlatformsPopup.style.display = 'none';
}
});
// --- Chinese Mode Logic ---
const waifuLink = document.getElementById('waifuLink');
const originalWaifuHref = waifuLink.href;
function updateWaifuLink(chineseModeEnabled) {
const baseLink = originalWaifuHref.split('?')[0];
const existingParams = originalWaifuHref.split('?')[1] ? new URLSearchParams(originalWaifuHref.split('?')[1]) : new URLSearchParams();
if (chineseModeEnabled) {
existingParams.set('locale', 'zh');
} else {
existingParams.delete('locale');
}
let newHref = baseLink;
if (existingParams.toString()) {
newHref += '?' + existingParams.toString();
}
waifuLink.href = newHref;
}
window.addEventListener('DOMContentLoaded', function() {
var chineseCheckbox = document.getElementById('chineseCheckbox');
var chineseModeEnabled = localStorage.getItem('chineseModeEnabled') === 'true';
chineseCheckbox.checked = chineseModeEnabled;
updateWaifuLink(chineseModeEnabled);
// Mobile Guofu Link
var guofuLink = document.getElementById('guofuLink');
if (isMobileDevice()) {
if (guofuLink.href.includes('?')) {
guofuLink.href += '&distribution=generic_mobile_china';
} else {
guofuLink.href += '?distribution=generic_mobile_china';
}
}
});
document.getElementById('chineseCheckbox').addEventListener('change', function() {
var chineseModeEnabled = this.checked;
updateWaifuLink(chineseModeEnabled);
localStorage.setItem('chineseModeEnabled', chineseModeEnabled);
});
// --- Mobile Device Detection ---
function isMobileDevice() {
return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
}
// --- Mobile Platforms Popup Logic ---
partnersMobileButton.addEventListener('click', function() {
mobilePlatformsPopup.style.display = 'block';
});
document.getElementById('closeMobilePopup').addEventListener('click', function() {
mobilePlatformsPopup.style.display = 'none';
});
</script>
</body>
</html>