forked from Spectrollay/minecraft_repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
165 lines (143 loc) · 4.85 KB
/
home.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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta content="3;url=./" http-equiv="refresh">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<style>
.redirect_title, .redirect_message {
color: #FFFFFF;
}
.message {
margin: 10px 0;
}
</style>
<script>
const loadingMaskStyle = document.createElement('style');
loadingMaskStyle.textContent = `
.loading_mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #48494A;
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
opacity: 1;
transition: opacity 0.6s;
}
.spinner {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50px;
}
#spinner_img {
width: 50px;
height: 50px;
}
.spinner_text {
color: #FFFFFF;
font-size: 20px;
}
`;
document.head.appendChild(loadingMaskStyle);
const root_path = '/' + (window.location.pathname.split('/').filter(Boolean).length > 0 ? window.location.pathname.split('/').filter(Boolean)[0] + '/' : '');
</script>
<link href="./images/Logo.jpg" rel="icon">
<title>Minecraft版本库</title>
</head>
<body>
<div class="loading_mask" id="loading_mask">
<div>
<div class="spinner"><img alt="" id="spinner_img" src=""/></div>
<div class="spinner">
<div class="spinner"><span class="spinner_text">载入中</span></div>
</div>
</div>
</div>
<header>
<div class="header_item header_item_left" id="back" onclick="clickedBack();">
<img alt="Back" class="back_icon" id="back_icon" src=""/>
</div>
<div class="header_logo" onclick="scrollToTop();">
<img alt="Title Icon" class="title_icon" src="./images/Logo.jpg"/>
<span class="header_title">Repository</span>
</div>
<div class="header_item header_item_right header_right_blank"></div>
</header>
<scroll-container>
<main class="main_content_center main_scroll_container" id="main">
<div>
<h2 class="redirect_title">页面已迁移至新地址</h2>
<h4 class="message redirect_message"><span id="second">3</span>秒后将自动重定向</h4>
<h4 class="message redirect_message">没有成功重定向?<a onclick="jumpToPage('./');">点此前往</a></h4>
</div>
</main>
</scroll-container>
<custom-scrollbar>
<custom-scrollbar-track></custom-scrollbar-track>
<custom-scrollbar-thumb></custom-scrollbar-thumb>
</custom-scrollbar>
<!--遮罩-->
<!--除了顶栏-->
<div class="overlay_main" id="overlay_main" onclick="clickedOverlay();"></div>
</body>
<script>
const custom_elements_js = document.createElement('script');
const public_script = document.createElement('script');
const public_define = document.createElement('script');
custom_elements_js.src = root_path + 'javascript/custom_elements.js';
public_script.src = root_path + 'javascript/public_script.js';
public_define.src = root_path + 'javascript/public_define.js';
document.head.appendChild(custom_elements_js);
document.head.appendChild(public_script);
document.head.appendChild(public_define);
const menu_icon = document.getElementById('menu_icon');
const back_icon = document.getElementById('back_icon');
if (back_icon) {
back_icon.src = root_path + 'images/arrowLeft.png';
}
if (menu_icon) {
menu_icon.src = root_path + 'images/menu.png';
}
const loading_img = document.getElementById('spinner_img');
loading_img.src = root_path + 'images/Loading_white.gif';
const loading_mask = document.getElementById('loading_mask');
// 监听页面加载完成事件
window.addEventListener('load', function () {
// 延时600ms后隐藏蒙版
loading_mask.style.opacity = '0';
setTimeout(function () {
loading_mask.style.display = 'none';
}, 600);
});
const secondElement = document.getElementById('second');
if (secondElement) {
let count = parseInt(secondElement.textContent);
const secondInterval = setInterval(function () {
count--;
secondElement.textContent = count.toString();
if (count <= 0) {
clearInterval(secondInterval);
}
}, 1000);
}
</script>
<style>
main {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
h2 {
margin: 10px 0;
}
</style>
</html>