-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
135 lines (120 loc) · 2.85 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/sends.svg" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" id="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="screen-orientation" content="portrait">
</head>
<style>
body,
input {
font-family: fang;
}
@font-face {
font-family: 'fang';
src: url('/fonts/LXGWWenKai-Regular.woff2') format('woff2'),
url('/fonts/LXGWWenKai-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
#sendsLogo {
position: absolute;
z-index: 99;
display: flex;
justify-content: center;
width: 100%;
top: 2vw;
animation: 1.5s ease logo-animation;
}
@keyframes logo-animation {
0% {
opacity: 0;
transform: translateY(-100%);
}
100% {
opacity: 1;
transform: translate(0);
}
}
#sendsLogo img {
height: 2rem;
width: 2rem;
}
#loading {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
transition: 3s ease;
}
#loading.hide {
opacity: 0;
z-index: -1;
}
#mask {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(255, 255, 255, 0.38);
/* 设置遮罩层的层级 */
pointer-events: none;
/* 防止遮挡下方元素的交互 */
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
font-size: 2rem;
color: #522B29
}
#mask.show {
z-index: 99;
opacity: 1;
animation: .6s fadeIn ease;
}
#mask.hide {
z-index: -1;
opacity: 0;
}
</style>
<body>
<noscript>
<strong>建议开启「JavaScript」以获取更好的体验!</strong>
</noscript>
<div id="sendsLogo">
<img src="/sends.svg" alt="sendsLogo">
</div>
<div id="app"></div>
<div id="loading"></div>
<div id="mask" class="hide">开启竖屏以获得良好体验~</div>
<script type="module" src="/src/main.js"></script>
<script type="module">
const resize = () => {
const { clientHeight, clientWidth } = document.documentElement
const mask = document.querySelector('#mask')
if (clientWidth > clientHeight && !document.querySelector('#wechat')) {
mask.classList.replace('hide', 'show')
} else {
if (mask.classList.contains('show')) {
mask.classList.replace('show', 'hide')
}
}
}
window.onresize = resize
resize()
const timer = setInterval(() => { resize() }, 100)
setTimeout(() => { clearInterval(timer) }, 2000)
</script>
</body>
</html>