-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy path404.php
99 lines (89 loc) · 2.26 KB
/
404.php
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
<?php get_header(); ?>
<style type="text/css">
:root{
--width: 800px;
--height: 600px;
}
body{
background: rgba(218, 223, 225);
font-family: 'Lato', sans-serif;
}
.explorer{
width: var(--width);
height: var(--height);
background: #ffffff;
border-radius: 10px;
box-shadow: 0px 0px 25px rgba(0, 0, 0, .1);
position: relative;
overflow: hidden;
margin: 50px auto;
}
.explorer:before{
content: attr(data-url);
border-top: 30px solid #ebebeb;
border-right: 60px solid #ebebeb;
border-bottom: 15px solid #ebebeb;
border-left: 10px solid #ebebeb;
color: rgba(0, 0, 0, .7);
padding: 5px;
width: 100%;
border-radius: 10px 10px 0 0;
position: absolute;
box-sizing: border-box;
}
.explorer:after{
content: '';
width: 14px;
height: 14px;
border-radius: 50%;
background: rgba(239, 72, 54, 1);
box-shadow: 20px 0 0 0 rgba(249, 191, 59, 1), 40px 0 0 0 rgba(38, 194, 129);
top: 8px; left: 10px;
position: absolute;
}
.explorer span{
font-size: 3em;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
animation-fill-mode: forwards;
}
.explorer span:before{
content: '404';
font-size: 3em;
display: block;
}
@keyframes loading {
from{ box-shadow: calc(-1 * var(--width)) 3px 1px -1px rgba(89, 171, 227, .5); }
to{ box-shadow: 0 3px 1px -1px rgba(89, 171, 227, .7); }
}
@keyframes error {
from{ opacity: 0; }
to{ opacity: 1; }
}
</style>
<?php global $wp; $current_url = home_url(add_query_arg(array(),$wp->request)); ?>
<section class="container">
<div class="explorer" data-url="<?php echo $current_url; ?>">
<span>没有内容</span>
</div>
</section>
<script type="text/javascript">
const explorer = document.querySelector(".explorer");
let i = 0, data = "", url = explorer.getAttribute("data-url");
let typing = setInterval(() => {
if(i == url.length){
clearInterval(typing);
document.styleSheets[0].insertRule('.explorer:before{ animation: loading 1s .5s; }', 0);
document.styleSheets[0].insertRule('.explorer span{ animation: error 2s 1.5s; }', 0);
}else{
data += url[i];
explorer.setAttribute("data-url", data);
i++;
}
}, 100);
</script>
<?php get_footer(); ?>