forked from j15e/ultimate-countdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
38 lines (38 loc) · 1.08 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
<link href='http://fonts.googleapis.com/css?family=Iceland' rel='stylesheet' type='text/css'>
<style type="text/css">
body
{
font-family: 'Iceland', cursive;
font-size:400px;
text-align:center;
background:url('conan.gif');
color:white;
padding: 0;
margin: 0;
}
#progress
{
position: absolute;
bottom: -300px;
left: 0;
height:300px;
background:#000 url('fire.gif') repeat-x 50% 100%;
width: 100%;
}
#message {
display: none;
color: red;
}
</style>
<div id="timer"></div>
<div id="progress"><div id="message">OVER!</div></div>
<script>
var timer = document.getElementById('timer'), start
timer.innerText = (start = (window.location.hash.replace(/^#/, "") || "900"))
setInterval(function(){
timer.innerText = parseInt(timer.innerText)-1
progress = parseFloat((timer.innerText/start))
if (progress > 0) { document.getElementById('progress').style.bottom = (-300 * progress)+"px" }
else { document.getElementById('progress').style.height = "100%"; document.getElementById("message").style.display = "block" }
}, 1000)
</script>