-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path404.html
More file actions
157 lines (142 loc) · 4.54 KB
/
Copy path404.html
File metadata and controls
157 lines (142 loc) · 4.54 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<title>Asterinas - Not Found</title>
<link rel="stylesheet" href="/css/contributors.css" media="screen and (min-width: 769px)">
<link rel="stylesheet" href="/css/contributors-mobile.css" media="screen and (max-width: 768px)">
<style type="text/css" media="screen">
body {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
</style>
</head>
<body style="background: linear-gradient(to top, rgb(35,50,155), rgb(8,8,28));;">
<!-- 头部 -->
<div class="header">
<div class="hdImgBox">
<a href="/">
<img src="/assets/images/homeIcon.png" alt="img">
</a>
</div>
<div class="hdLink">
<div data-tab="1" class="tab" style="color:#fff">Home<div class="dot"> </div>
</div>
<div data-tab="2" class="tab">Blog
</div>
<div data-tab="3" class="tab">Docs</div>
</div>
<div class="hdLinks">
<div>
<img src="/assets/images/navigation.jpg" alt="img">
</div>
<div class="tabItem" flot="false">
<div data-tab="1" class="tab">Home</div>
<div class="line"></div>
<div data-tab="2" class="tab">Blog
</div>
<div class="line"></div>
<div data-tab="3" class="tab">Docs</div>
</div>
</div>
</div>
<!-- 中心具体内容框 -->
<div class="not-fond">
<div class="content-container">
<div class="maskwrap"></div>
<div class="overlay">
<div class="left"></div>
<div class="right"></div>
</div>
</div>
<div class="fond-text">
404
</div>
<div class="fond-textone">
Not Found
</div>
<div class="fond-texttwo">
Sorry, we can't find the page you are looking for.
</div>
</div>
</div>
<script>
var tabs = document.querySelectorAll('.tab');
tabs.forEach(function (tab) {
tab.addEventListener('click', function () {
var tabId = this.getAttribute('data-tab');
if (tabId === '1') {
window.location.href = '/index.html';
} else if (tabId === '2') {
window.location.href = '/blog.html';
} else if (tabId === '3') {
window.location.href = 'https://asterinas.github.io/book';
}
});
})
window.addEventListener('DOMContentLoaded', function () {
const screenWidth = window.innerWidth;
const overlay = document.querySelector('.overlay');
if (screenWidth > 1920) {
overlay.style.display = 'block';
} else {
overlay.style.display = 'none';
}
// 监听窗口大小变化事件
window.addEventListener('resize', function () {
const currentScreenWidth = window.innerWidth;
if (currentScreenWidth > 1920) {
overlay.style.display = 'block';
} else {
overlay.style.display = 'none';
}
})
})
window.addEventListener('DOMContentLoaded', function () {
const screenWidth = window.innerWidth;
const hdLink = document.querySelectorAll('.hdLink');
const hdLinks = document.querySelectorAll('.hdLinks');
console.log(screenWidth)
if (screenWidth > 768) {
console.log(111)
hdLink[0].style.display = 'flex';
hdLinks[0].style.display = 'none';
} else {
console.log(222)
hdLink[0].style.display = 'none';
hdLinks[0].style.display = 'block';
}
// 监听窗口大小变化事件
window.addEventListener('resize', function () {
const currentScreenWidth = window.innerWidth;
if (currentScreenWidth > 768) {
hdLink[0].style.display = 'flex';
hdLinks[0].style.display = 'none';
} else {
hdLink[0].style.display = 'none';
hdLinks[0].style.display = 'block';
}
})
});
const hdLinks = document.querySelectorAll('.hdLinks');
const tabItem = document.querySelectorAll('.tabItem');
hdLinks[0].addEventListener('click', function () {
if (tabItem[0].getAttribute('flot') === 'false') {
tabItem[0].style.display = 'block';
tabItem[0].setAttribute('flot', true);
} else {
tabItem[0].style.display = 'none';
tabItem[0].setAttribute('flot', 'false');
}
});
window.onclick = (event) => {
if (event.target !== tabItem[0] && event.target !== hdLinks[0].children[0].children[0]) {
tabItem[0].style.display = 'none';
tabItem[0].setAttribute('flot', 'false');
}
}
</script>
</body>
</html>