This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.html
43 lines (43 loc) · 1.6 KB
/
app.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
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
<script>
const onresize = () => {
const pathname = window.location.pathname;
const search = window.location.search;
const isPcMode = window.outerWidth > 500;
const path =
pathname.split("/").pop() ||
pathname.split("/")[pathname.split("/").length - 2];
const pagename =
pathname.match(/\/(item|wiki)\//) &&
pathname.match(/\/(item|wiki)\//)[0];
if (!pagename) return;
const isPreFetchBot =
window.URLSearchParams &&
!!(new window.URLSearchParams(search).get("bot") === "1");
if (!isPreFetchBot) {
if (pagename === "/item/" && !isPcMode) {
window.location.replace("/wiki/" + path + search);
} else if (pagename === "/wiki/" && isPcMode) {
window.location.replace("/item/" + path + search);
}
}
};
onresize();
window.addEventListener("resize", onresize);
</script>
<link rel="dns-prefetch" href="https://wikioss.xhemj.work" />
<link rel="dns-prefetch" href="https://wiki.xhemj.work" />
<link rel="dns-prefetch" href="https://fonts.googleapis.cn" />
<link rel="dns-prefetch" href="https://fonts.gstatic.cn" />
<link rel="preconnect" href="https://wikioss.xhemj.work" />
<link rel="preconnect" href="https://wiki.xhemj.work" />
<link rel="preconnect" href="https://fonts.googleapis.cn" />
<link rel="preconnect" href="https://fonts.gstatic.cn" />
{{ HEAD }}
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>