-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (83 loc) · 2.01 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>До дембеля брат</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
h1 {
text-align: center
}
body {
background: #eee
}
#slider {
width: 800px;
height: 400px;
border: 1px solid #fff;
margin: 20px auto;
display: block;
box-shadow: 0 0 1px 3px #000;
}
#buttons {
margin: auto;
width: 210px;
}
#buttons li {
width: 100px;
text-align: center;
display: inline-block;
border: 1px solid #888;
margin: 0;
}
</style>
</head>
<body>
<h1>1 декабря 2015 года</h1>
<div style="margin:auto;border:1px solid #888;text-align:center;width: 400px;">
<ul>
<h2 style='color: #222;text-shadow: 0 1px 0 #fff'>Стасу до дома осталось</h2>
<h3 id='days'></h3>
<h3 id='hours'></h3>
<h3 id='minute'></h3>
<h3 id='time'></h3>
<h3 id='procent'></h3>
</ul>
</div>
<img id='slider' src='img/9.jpg'></div>
<ul id='buttons'>
<li>toLeft</li>
<li>toRight</li>
</ul>
<script type="text/javascript">
window.setInterval(init, 100);
function init () {
var time = document.getElementById('time');
var minute = document.getElementById('minute');
var days = document.getElementById('days');
var procentt = document.getElementById('procent');
var hours = document.getElementById('hours');
var lastTime = new Date('12 1 2015');
var dateNowIs = new Date();
var years = 365;
var procent = years/100;
var lostTime = lastTime - dateNowIs;
time.innerText = Math.floor(lostTime/1000) + ' Секунд';
days.innerText = Math.floor(lostTime/60/60000/24) + ' Дней';
minute.innerText = Math.floor(lostTime/1000/60) + ' Минут';
procentt.innerText = 100 - lostTime/60/60000/24/procent + ' %';
hours.innerText = Math.floor(lostTime/1000/60/60) + ' часов';
}
setInterval(function () {
var slider = document.getElementById('slider');
var rand = Math.floor(Math.random(1,14)*12)+1;
console.log(rand);
slider.src = 'img/' + rand + '.jpg';
slider
},3000);
</script>
</body>
</html>