-
Notifications
You must be signed in to change notification settings - Fork 0
/
countdown.html
239 lines (212 loc) · 7.57 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="en">
<header>
<title>reunião familiar</title>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" type="text/css">
<style>
/* resets and general styles */
*{
margin: 0 auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
::-moz-selection{
color: #FFFFFF;
background: #FF5722;
}
::selection{
color: #FFFFFF;
background: #FF5722;
}
body{
font: normal 16px 'Roboto', sans-serif;
position: absolute;
height: 100%;
width: 100%;
}
div.wrapper{
width: calc(4*225px);
margin: 0 auto;
}
span, a, strong{font-weight: 700;}
a{transition: .2s; text-decoration: none; color: #787878; border-bottom: 1px solid #607D8B;}
a:hover{transition: .2s; color: #FF5722;}
/* page layout */
/* header */
header{
width: 100%;
height: 50%;
background: #607D8B;
}
/* section */
section{
width: 100%;
height: 50%;
}
section h1, section p.meta{
color: #FFFFFF;
margin-bottom: 15px;
}
section hgroup{margin-top: -360px;}
section p.numbers{font-size: 6em;}
section p.meta,section p.strings{font-size: 1.5em;}
section h1{font-size: 4.5em;}
/* countdown styles */
div#countdown{color: #353535;}
div#countdown p{
width: 100%;
display: inline-block;
text-align: center;
}
p.numbers{
width: 100%;
height: 85%;
background: #FFFFFF;
margin-top: -25px;
padding-top: 100px;
}
p.strings{
width: 100%;
height: auto;
padding: 30px 0;
background: #FF5722;
color: #FFFFFF;
}
div.cd-box{
width: 210px;
height: 360px;
background: #FFFFFF;
float: left;
padding: 25px 0 0 0;
margin: 30px 15px 0 0;
-webkit-box-shadow: 5px 6px 9px 1px rgba(53, 53, 53, 0.5);
-moz-box-shadow: 5px 6px 9px 1px rgba(53, 53, 53, 0.5);
box-shadow: 5px 6px 9px 1px rgba(53, 53, 53, 0.5);
}
/* footer */
footer{
position: relative;
top: 60px;
}
footer p{
color: #787878;
}
</style>
</header>
<section>
<div class="wrapper">
<hgroup>
<h1>CONTAGEM REGRESSIVA</h1>
<p class="meta">Contagem regressiva pra galera mais doidera se reunir em Portugal</p>
</hgroup>
<div id="countdown">
<div class="cd-box">
<p class="numbers days">00</p><br>
<p class="strings timeRefDays">Dias</p>
</div>
<div class="cd-box">
<p class="numbers hours">00</p><br>
<p class="strings timeRefHours">Horas</p>
</div>
<div class="cd-box">
<p class="numbers minutes">00</p><br>
<p class="strings timeRefMinutes">Minutos</p>
</div>
<div class="cd-box">
<p class="numbers seconds">00</p><br>
<p class="strings timeRefSeconds">Segundos</p>
</div>
</div>
<!-- end div#countdown -->
<footer>
<p>Finalmente está chegando o dia em que a familia mais irada do Brasil vai se reencontrar.<br/> Todos sobreviventes da pandemia e do caos e destruição do país. Tá cheganndooooo...</p>
<br>
</footer>
</div>
<!-- end div.wrapper -->
</section>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script>
$(document).ready(function(){
//
(function(e){
e.fn.countdown = function (t, n){
function i(){
eventDate = Date.parse(r.date) / 1e3;
currentDate = Math.floor(e.now() / 1e3);
//
if(eventDate <= currentDate){
n.call(this);
clearInterval(interval)
}
//
seconds = eventDate - currentDate;
days = Math.floor(seconds / 86400);
seconds -= days * 60 * 60 * 24;
hours = Math.floor(seconds / 3600);
seconds -= hours * 60 * 60;
minutes = Math.floor(seconds / 60);
seconds -= minutes * 60;
//
days == 1 ? thisEl.find(".timeRefDays").text("Dias") : thisEl.find(".timeRefDays").text("Dias");
hours == 1 ? thisEl.find(".timeRefHours").text("Horas") : thisEl.find(".timeRefHours").text("Horas");
minutes == 1 ? thisEl.find(".timeRefMinutes").text("Minutos") : thisEl.find(".timeRefMinutes").text("Minutos");
seconds == 1 ? thisEl.find(".timeRefSeconds").text("Segundos") : thisEl.find(".timeRefSeconds").text("Segundos");
//
if(r["format"] == "on"){
days = String(days).length >= 2 ? days : "0" + days;
hours = String(hours).length >= 2 ? hours : "0" + hours;
minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
seconds = String(seconds).length >= 2 ? seconds : "0" + seconds
}
//
if(!isNaN(eventDate)){
thisEl.find(".days").text(days);
thisEl.find(".hours").text(hours);
thisEl.find(".minutes").text(minutes);
thisEl.find(".seconds").text(seconds)
}
else{
errorMessage = "Invalid date. Example: 27 March 2015 17:00:00";
alert(errorMessage);
console.log(errorMessage);
clearInterval(interval)
}
}
//
var thisEl = e(this);
var r = {
date: null,
format: null
};
//
t && e.extend(r, t);
i();
interval = setInterval(i, 1e3)
}
})(jQuery);
//
$(document).ready(function(){
function e(){
var e = new Date;
e.setDate(e.getDate() + 60);
dd = e.getDate();
mm = e.getMonth() + 1;
y = e.getFullYear();
futureFormattedDate = mm + "/" + dd + "/" + y;
return futureFormattedDate
}
//
$("#countdown").countdown({
date: "17 May 2022 22:20:00", // change date/time here - do not change the format!
format: "on"
});
});
});
</script>