-
Notifications
You must be signed in to change notification settings - Fork 1
/
countdown.html
94 lines (94 loc) · 3.26 KB
/
countdown.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, shrink-to-fit=no">
<title>Coming Soon</title>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon"/>
<script type="text/javascript" src="rs/js/jquery.min.js"></script>
<script type="text/javascript" src="rs/js/jquery.countdown.min.js"></script>
<script type="text/javascript" src="rs/js/anime.min.js"></script>
<link rel="stylesheet" href="rs/css/bootstrap.min.css">
<link rel="stylesheet" href="rs/css/countdown.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col hcenter">
<div class="ht2 ani-txt we">WE</div>
<div class="ht2 af-txt"> ARE</div>
</div>
</div>
<div class="row">
<div class="col hcenter">
<div class="ht1">COMING SOON</div>
</div>
</div>
<div class="row countdown">
<div class="col hcenter">
<div class="ct">
<span class="days"></span><span class="sdown">days</span>
</div>
<div class="ct">
<span class="hrs"></span><span class="sdown">hrs</span>
</div>
<div class="ct">
<span class="min"></span><span class="sdown">min</span>
</div>
<div class="ct">
<span class="sec"></span><span class="sdown">sec</span>
</div>
</div>
</div>
</div>
<div class="footer">
Powered by <a href="https://nutzam.com">Nutz</a>
</div>
</body>
<script type="text/javascript">
$(function () {
// 开始倒计时
var endDate = "2017-11-22 18:00:00";
var $cd = $('.countdown');
var $days = $cd.find('.days');
var $hrs = $cd.find('.hrs');
var $min = $cd.find('.min');
var $sec = $cd.find('.sec');
$cd.countdown({
date: endDate,
render: function (data) {
$days.html(this.leadingZeros(data.days, 2));
$hrs.html(this.leadingZeros(data.hours, 2));
$min.html(this.leadingZeros(data.min, 2));
$sec.html(this.leadingZeros(data.sec, 2));
}
});
// 开始切换WE、NB
var $antxt = $('.ani-txt');
var $aftxt = $('.af-txt');
var isOut = false;
setTimeout(function () {
var changeIn = setInterval(function () {
console.log('change txt');
anime({
targets: '.ani-txt.we',
translateY: isOut ? 0 : -300
});
isOut = !isOut;
if (isOut) {
setTimeout(function () {
$antxt.addClass('nb').html("<span class='n'>N</span><span class='b'>B</span>");
}, 1000)
} else {
window.clearInterval(changeIn);
setTimeout(function () {
$aftxt.html(" IS");
}, 1000)
}
}, 1200);
}, 1800)
});
</script>
</html>