-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (43 loc) · 1.15 KB
/
index.html
File metadata and controls
47 lines (43 loc) · 1.15 KB
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
<head>
<script rel="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
body {
background-color: #404040;
}
h1 {
color: red;
text-align: center;
font-size: 5em;
}
img {
display: block;
margin-left: auto;
margin-right: auto
}
</style>
<script>
var formatTime = function(timePiece) {
if (timePiece.length < 2) {
return "0" + timePiece;
} else {
return timePiece;
}
}
var go = function() {
var millisUntil = new Date("2012/05/19 00:00:00 CST") - new Date();
var differenceDate = new Date(millisUntil);
var seconds = differenceDate.getSeconds() + "";
var minutes = differenceDate.getMinutes() + "";
var hours = 23 - new Date().getHours() + "";
var days = 365 + parseInt(millisUntil/1000/60/60/24) + "";
$(".timer").text(formatTime(days) + ":" + formatTime(hours) + ":" + formatTime(minutes) + ":" + formatTime(seconds));
}
window.setInterval(go, 1000);
</script>
</head>
<body>
<div>
<h1 class="timer">
</h1>
<img src="lobster.png"></img>
</body>