-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.html
48 lines (47 loc) · 1.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimum-scale=1.0">
<title>知识体系</title>
<style>
#buildTime {
color: black;
font-weight: 600;
}
body[theme=dark] #buildTime {
color: white;
}
</style>
</head>
<body>
<header id="staticHeader" style="display: none;">
{summary}
</header>
<div id="app"></div>
<div style="position: fixed; bottom: 10px; right: 10px" id="buildTime"></div>
<script type="module" src="/src/main.ts"></script>
</body>
<script>
/*build-time*/const buildTime = "" /*build-time*/
document.getElementById("buildTime").innerHTML = `${new Date(buildTime).toLocaleString()}`
</script>
<script>
// 切回页面时检查js资源是否有效
// document.addEventListener('visibilitychange', async () => {
// if (document.hidden) {
// return
// }
// const data = await (await fetch("/", {cache: 'no-cache'})).text()
// const remoteMainScript = new DOMParser().parseFromString(data, 'text/html').querySelectorAll("script")[0].getAttribute("src")
// const localMainScript = document.querySelectorAll("script")[0].getAttribute("src")
// if (remoteMainScript != localMainScript) {
// console.log('refresh')
// location.reload()
// }
// })
</script>
<!-- <script src="node_modules/eruda/eruda.js"></script>
<script>eruda.init();</script> -->
</html>