-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
67 lines (63 loc) · 2.79 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>智龙急速阵型</title>
<link rel="shortcut icon" href="images/icon.png" type="image/x-png" />
<link rel="manifest" href="manifest.webmanifest">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="style-monsterimages.css" rel="stylesheet" type="text/css">
<link id="language-css" href="languages/en.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="languages/language-list.js"></script>
<script type="text/javascript">
if (/d(?:ata)?=/ig.test(location.search)) //如果存在怪物数据
{
if (confirm("Multiplayer page has changed path, need to jump?"))
location.href = "multi.html" + location.search; //跳到多人模式
}
let browser_i18n = (navigator.language||navigator.userLanguage); //获取浏览器语言
let currentLanguage = languageList.find(lang => { //筛选出符合的语言
if (lang.i18n_RegExp)
{
return lang.i18n_RegExp.test(browser_i18n); //匹配正则表达式
}else
{
return browser_i18n.includes(lang.i18n); //文字上的搜索包含
}
}) || languageList[0]; //没有找到指定语言的情况下,自动用第一个语言(英语)
document.head.querySelector("#language-css").href = "languages/"+currentLanguage.i18n+".css";
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js', {scope: './'})
.then(function(registration) {
console.debug('service worker 注册成功',registration);
}).catch(function(error) {
console.error('servcie worker 注册失败',error);
});
} else {
console.error('浏览器不支持 servcie worker');
}
</script>
<style type="text/css">
.title,.control-box{
text-align: center;
}
.control-box a{
font-size: 1.5em;
}
</style>
</head>
<body>
<noscript>您的浏览器不支持 JavaScript!<br/>Your browser does not support JavaScript!</noscript>
<h1 class="title">智龙急速阵型<br>Puzzle & Dragons Dash Formation</h1>
<ul class="control-box">
<li><a href="solo.html"><!--单人模式--><label for="player-number-1"></label></a></li>
<li><a href="multi.html"><!--多人模式--><label for="player-number-2"></label></a></li>
<li><a href="triple.html"><!--三人模式--><label for="player-number-3"></label></a></li>
<li><br></li>
<li><a class="btn-guide-link" href="solo.html?guide=1"><!--图鉴模式--> - パズル&ドラゴンズ</a></li>
<li><a class="btn-guide-link" href="solo.html?guide=1&s=en"><!--图鉴模式--> - Puzzle & Dragons</a></li>
<li><a class="btn-guide-link" href="solo.html?guide=1&s=ko"><!--图鉴模式--> - 퍼즐앤드래곤</a></li>
</ul>
</body>
</html>