-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
180 lines (177 loc) · 8.94 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
<!-- Made by Penguin -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Index Page</title>
<link rel="stylesheet" href="./assets/styles/styles.css">
</head>
<body class="pg-app withoutHeader" id="pg-app">
<nav class="nav-head">
<div class="container" id="pg-app-head">
<div class="nav-description" id="top-description"><span>地铁族APP</span></div>
<div class="nav-inputModel">
<div contenteditable="true" onclick="this.innerText=''"></div>
</div>
<div id="ResultDisplay"></div>
</div>
</nav>
<div class="pg-app-wrap" id="pg-app-wrap">
<img src="./assets/media/images/ditiezuads.png" id="DitiezuAds" alt="dtzAds" onclick="system.loadDitiezu()">
<div id="fixedAdsWrap"></div>
<p class="ads" onclick="system.loadDitiezu()">点击图片或者点击本文字以加载全新风格的论坛。</p>
<p class="ads">若要修改主题样式等设置,请前往设置页面。</p>
<p class="ads">若要查看鲜网图、站点情报,请点击下方导航栏。</p>
<div id="copyright">
Powered by Penguin. Made with Passion and Love.
</div>
</div>
<nav class="nav-bottom" id="pg-app-bottom">
<ul>
<li pg-target="home" onclick="loadPage.require('index')"><span class="active">home</span><span
class="description">Home</span>
</li>
<li pg-target="info" onclick="loadPage.require('stationList')"><span>info</span><span
class="description">Info</span>
</li>
<li pg-target="map" onclick="window.location.href='routeMap.html'"><span>map</span><span class="description">Routemap</span>
</li>
<li pg-target="settings" onclick="loadPage.require('account')"><span>settings</span><span class="description">Settings</span>
</li>
</ul>
</nav>
<div id="bg-animation">
<span>LOADING...</span>
</div>
</body>
<script src="./assets/strings/string.js"></script>
<script src="./assets/scripts/require.lib.js"></script>
<script src="./assets/scripts/execPage.js"></script>
<script>
let LocalHistory = [], si = -1, se = [-1, -1], loadingTime = 0;
window.onpopstate = () => {
if (!(GetPara("stationid") === null || GetPara("stationid") === "")) {
if (GetPara("type") === "stationinfo")
loadPage.require("stationinfo", GetPara("stationid"));
} else if (!(GetPara("start") === null || GetPara("start") === "")) {
if (GetPara("type") === "makeRoute")
loadPage.require("stationinfo", GetPara("stationid"));
} else if (GetPara("type") === null || GetPara("type") === "null") {
loadPage.require("index");
} else {
loadPage.require(GetPara("type"));
}
// if (GetPara("type") === "index" || GetPara("stationid") === null || GetPara("stationid") === "") $("#Sentence")[0].innerHTML = sentences[Math.floor(Math.random() * sentences.length)][cL].replace(new RegExp("\\[icon]", "g"), " <span class='").replace(new RegExp("\\[/icon]", "g"), "'></span>");
};
window.onload = () => {
loadRequire();
if (!(GetPara("stationid") === null || GetPara("stationid") === "")) {
if (GetPara("type") === "stationinfo")
loadPage.require("stationinfo", GetPara("stationid"));
} else if (!(GetPara("start") === null || GetPara("start") === "")) {
if (GetPara("type") === "makeRoute")
loadPage.require("stationinfo", GetPara("stationid"));
} else if (GetPara("type") === null || GetPara("type") === "null") {
loadPage.require("index");
} else {
loadPage.require(GetPara("type"));
}
// if (GetPara("type") === "index" || !(GetPara("stationid") === null || GetPara("stationid") === "")) $("#Sentence")[0].innerHTML = sentences[Math.floor(Math.random() * sentences.length)][cL].replace(new RegExp("\\[icon]", "g"), " <span class='").replace(new RegExp("\\[/icon]", "g"), "'></span>");
};
window.loadPage = {
data: eval("pg.index"),
init: () => {
loadPage.require("index");
},
require: (name, num) => {
if ($("#ResultDisplay")[0].classList.contains("show"))
$("#ResultDisplay")[0].classList.remove("show");
if (typeof (name) !== "undefined") {
if (name === "index") {
history.pushState(history.length, "index", "?type=index");
pg.index.init();
return 0;
}
if (name === "stationinfo") {
si = num;
history.pushState(history.length, name, "?type=" + name + "&stationid=" + num + "&referer=" + GetPara("referer" + "&lineid=" + GetPara("lineid")));
} else if (name === "makeRoute") {
se = num;
history.pushState(history.length, name, "?type=" + name + "&start=" + se[0] + "&end=" + se[1]);
} else {
LocalHistory.push(name);
history.pushState(history.length, name, "?type=" + name + "&lineid=" + GetPara("lineid"));
}
}
if (typeof (name) !== "undefined") {
loadPage.data = eval("pg." + name);
loadPage.required = 0;
let wrap = $("#bg-animation")[0];
wrap.classList.add("loading");
wrap.children[0].innerText = string.loading[cL];
loadingTime = new Date().getTime();
}
if (loadPage.required === loadPage.data.requireLib.length || loadPage.required > loadPage.data.requireLib.length) {
if (si !== -1) {
loadPage.comp(si);
} else
loadPage.comp();
} else if ($("#" + loadPage.data.requireLib[loadPage.required].substr(loadPage.data.requireLib[loadPage.required].length - 7)).length === 0) {
let a = cE({
type: "script",
attr: [["src", loadPage.data.requireLib[loadPage.required].includes("http") ? loadPage.data.requireLib[loadPage.required] : ("./assets/data/" + loadPage.data.requireLib[loadPage.required] + ".js")], ["id", loadPage.data.requireLib[loadPage.required].substr(loadPage.data.requireLib[loadPage.required].length - 7)]]
});
document.body.appendChild(a);
a.onreadystatechange = a.onload = function () {
loadPage.required++;
loadPage.require();
};
} else {
loadPage.required++;
loadPage.require();
}
},
comp: (d) => {
let head = $("#pg-app-head")[0];
let inner = $("#pg-app-wrap")[0];
let bottom = $("#pg-app-bottom")[0];
let inf = loadPage.data.data;
inner.innerHTML = "";
$("#top-description")[0].children[0].innerText = inf.title[cL];
if (inf.topNav) {
if (inf.topInput) {
$("[contenteditable='true']")[0].innerHTML = inf.topInputContent[cL];
document.body.classList.contains("hasSearchBar") ? void (0) : document.body.classList.add("hasSearchBar");
} else {
document.body.classList.contains("hasSearchBar") ? document.body.classList.remove("hasSearchBar") : void (0);
}
head.classList.contains("show") ? void (0) : head.classList.add("show");
document.body.classList.contains("withoutHeader") ? document.body.classList.remove("withoutHeader") : void (0);
} else {
document.body.classList.contains("hasSearchBar") ? document.body.classList.remove("hasSearchBar") : void (0);
head.classList.contains("show") ? head.classList.remove("show") : void (0);
document.body.classList.contains("withoutHeader") ? void (0) : document.body.classList.add("withoutHeader");
}
loadPage.data.init(d);
$("#pg-app-bottom li>span.active").forEach(e => {
e.classList.remove("active")
});
if (loadingTime - new Date().getTime() < -1000)
$("#bg-animation")[0].classList.remove("loading");
else setTimeout(() => {
$("#bg-animation")[0].classList.remove("loading");
}, loadingTime - new Date().getTime() + 1000);
bottom.children[0].children[inf.navBottom].children[0].classList.add("active");
}
};
window.saveSE = (a) => {
if (a[0] === "start") se[0] = a[1];
else se[1] = a[1];
if (se[1] !== -1 && se[0] !== -1)
window.location.href = "makeRoute.html?start=" + se[0] + "&end=" + se[1];
}
</script>
</html>