-
Notifications
You must be signed in to change notification settings - Fork 412
/
index.html
90 lines (76 loc) · 1.66 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
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>CSS Tricks has been migrated</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
p {
margin: 0;
color: #333;
text-align: center;
}
body {
display: flex;
justify-content: center;
}
article {
margin-top: 15%;
}
article p {
font-size: 22px;
}
a {
color: #00adb5;
}
section {
margin-top: 30px;
}
section p {
font-size: 18px;
}
</style>
</head>
<body>
<article>
<p>CSS Tricks 已经迁移至<a
href="http://css-tricks.neatbang.com/">这里</a>,如果你已收藏当前网址,请在跳转后更新
</p>
<p>CSS Tricks has been migrated <a
href="http://css-tricks.neatbang.com/">here</a>, please update after the jump if you have a favorite current url
</p>
<section>
<p>
页面会在 <span class="second"></span> 秒后跳转
</p>
<p>
The page will jump after <span
class="second"></span> seconds
</p>
</section>
</article>
</body>
<script>
const secondSpans = document.querySelectorAll('.second')
countdown(8, secondSpans, () => {
window.location.href = 'http://css-tricks.neatbang.com/'
})
function countdown(second, doms, callback) {
doms.forEach((dom) => {
dom.innerText = second
})
if (second == 0) {
return callback && callback()
}
setTimeout(() => {
countdown(second - 1, doms, callback)
}, 1000)
}
</script>
</html>