-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.html
125 lines (114 loc) · 2.87 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
<!DOCTYPE html>
<html lang="zh-CN" data-app-version="%APP_VERSION%">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="none">
<title>%VITE_TITLE%</title>
<style>
html {
width: 100dvw;
height: 100dvh;
overflow: hidden;
cursor: url('/icons/GensinMouse.svg') 0 0, auto;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, #app {
width: 100%;
height: 100%;
overflow: hidden;
}
@keyframes app-init {
from {
transform: translate(-50%, -50%) rotate(0deg);
}
to {
transform: translate(-50%, -50%) rotate(360deg);
}
}
#preloading {
position: fixed;
width: 100%;
height: 100%;
z-index: 1;
overflow: hidden;
display: grid;
place-items: center;
place-content: center;
color: #ECE5D8;
background-color: #25313F;
line-height: 2em;
&.is-end {
opacity: 0;
transition: opacity ease 300ms;
&::before {
clip-path: xywh(0 0 100% 100%);
animation-play-state: paused;
}
}
h1 {
font-size: 24px;
font-weight: bolder;
}
&::before {
content: '';
position: absolute;
box-sizing: border-box;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 4px solid #ECE5D8F0;
clip-path: xywh(0 0 50% 50%);
width: 256px;
height: 256px;
border-radius: 128px;
pointer-events: none;
animation: app-init linear 2s infinite;
}
&::after {
content: '';
position: absolute;
box-sizing: border-box;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 2px dashed #ECE5D860;
width: 254px;
height: 254px;
border-radius: 128px;
pointer-events: none;
}
}
</style>
</head>
<body>
<div id="preloading">
<h1>初始化应用</h1>
<div>前面的区域,马上就能探索~</div>
</div>
<div id="app"></div>
<script type="module" async defer>
const text = (() => {
if (!window.isSecureContext)
return '网站处于非安全上下文中,Web 应用无法正常运行。'
return ''
})()
const app = document.getElementById('app')
const preloading = document.getElementById('preloading')
preloading.addEventListener('transitionend', () => {
preloading.remove()
}, { once: true })
Reflect.set(globalThis, 'preloading', preloading)
if (text) {
app.innerText = text
}
else {
import('./src/main.ts')
}
</script>
</body>
</html>