-
Notifications
You must be signed in to change notification settings - Fork 3
/
404.html
executable file
·134 lines (119 loc) · 3.1 KB
/
404.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404</title>
<script src="/analytics.js"></script>
</head>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
height: 100vh;
background: #121212;
padding: 1em;
overflow: hidden;
}
.background-wrapper {
position: relative;
width: 100%;
height: 100%;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.background-wrapper h1 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(-45deg);
font-family: Arial, Helvetica, sans-serif;
font-size: 60vmax;
color: #282828;
letter-spacing: 0.025em;
margin: 0;
transition: 750ms ease-in-out;
}
a {
border: 2px solid #555;
padding: 0.5em 0.8em;
position: fixed;
z-index: 1;
color: #555;
text-decoration: none;
display: flex;
align-items: center;
transition: 150ms;
}
a svg>polyline {
transition: 150ms;
}
a:hover {
color: #333;
background: #dadada;
border-color: transparent;
}
a:hover svg>polyline {
stroke: #000;
}
a:hover+.background-wrapper>h1 {
color: #dadada;
}
p {
color: #dadada;
font-size: calc(1em + 3vmin);
position: fixed;
bottom: 1rem;
right: 1.5rem;
margin: 0;
text-align: right;
text-shadow: -1px -1px 0 #121212, 1px 1px 0 #121212, -1px 1px 0 #121212, 1px -1px 0 #121212;
}
@media screen and (min-width: 340px) {
p {
width: 70%;
}
}
/*
@media screen and (min-width: 560px) {
p {
width: 50%;
}
}
@media screen and (min-width: 940px) {
p {
width: 30%;
}
}
@media screen and (min-width: 1300px) {
p {
width: 25%;
}
} */
</style>
<body>
<a href="https://wangyifang.com">
<svg height="0.8em" width="0.8em" viewBox="0 0 2 1" preserveAspectRatio="none">
<polyline fill="none" stroke="#777777" stroke-width="0.1" points="0.9,0.1 0.1,0.5 0.9,0.9" />
</svg> WANGYIFANG.COM
</a>
<div class="background-wrapper">
<h1 id="visual">404</h1>
</div>
<p>你访问的这个页面已经不见了。</p>
<script>
const visual = document.getElementById("visual")
const events = ['resize', 'load']
events.forEach(function (e) {
window.addEventListener(e, function () {
const width = window.innerWidth
const height = window.innerHeight
const ratio = 45 / (width / height)
visual.style.transform = "translate(-50%, -50%) rotate(-" + ratio + "deg)"
});
});
</script>
</body>
</html>