-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
154 lines (129 loc) · 5.61 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CountDown ! </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" media="screen" href="css/main.css">
<link rel="shortcut icon" type="image/ico" href="assets/images/favicon.ico">
</head>
<body>
<div class="bg"></div>
<div class="footer"></div>
<div class="conteneur">
<img src="assets/images/tshirt_final_xl_sans_texte.png" id="main" />
<div class="jaune_clair min chiffre" id="min">00</div>
<div class="jaune_fonce min unit">m</div>
<div class="jaune_clair sec chiffre" id="sec">00</div>
<div class="jaune_fonce sec unit">s</div>
<!-- Codes by HTML.am -->
<marquee behavior="scroll" direction="right" class="marquee_1">DevFest Nantes</marquee>
<marquee behavior="scroll" direction="right" class="marquee_2">DevFest Nantes</marquee>
</div>
<div id="opacity">
<div id="devfestnantes">
<img src="assets/images/logo.png" id="logo-technos">
<div class="title">DevFest Nantes<br><br>2014<br><br><span id="press" class="green"><press start></span></div>
<div id="fakemouse"></div>
<img src="assets/images/tshirt_final_xl.png" id="tour-bretagne">
</div>
<video id="iovideo" src="assets/video/keynote_devfest_v5.mp4" onended="endVideo();"></video>
<audio id="playlist" src="" style="display:none;" onended="nextSong();"></audio>
</div>
<script type="text/javascript">
var min = document.getElementById('min'),
sec = document.getElementById('sec'),
audioElt = document.getElementById('playlist'),
//cibleDate = new Date().getTime()+(20 * 1000),
cibleDate = Date.parse('2014-11-07T08:35:00Z'),
marquee_1 = document.querySelector('.marquee_1'),
marquee_2 = document.querySelector('.marquee_2'),
currentTime = new Date().getTime(),
indexPlaylist = 0,
playListSongs = [
'0-Stevie_Wonder_-_Superstition_(C2C_Remix).mp3',
'Dimie_Cat_-_AAA_(Triple_A).mp3',
'1-Bea_ Assailant_-_Run_(Official_Video).mp3',
'Dimie_Cat_-_Le_poulpe.mp3',
'Klischée_-_07_Tique_Tac.mp3',
'Say_Yes_Dog_-_A_Friend_[Official_Video].mp3'
];
marquee_1.style.display = 'none';
marquee_2.style.display = 'none';
setTimeout(function() {
marquee_1.style.display = '';
setTimeout(function() {
marquee_2.style.display = '';
}, 2500);
}, 100);
var cancelInterval = setInterval(function() {
currentTime+=100;
var deltaTime = cibleDate - currentTime;
var tmpDate = new Date(deltaTime);
min.innerHTML = tmpDate.getMinutes() < 10 ? "0"+tmpDate.getMinutes() : tmpDate.getMinutes();
sec.innerHTML = tmpDate.getSeconds() < 10 ? "0"+tmpDate.getSeconds() : tmpDate.getSeconds();
manageSoundVolume(deltaTime);
if (deltaTime <= 0 ){
endCountDown();
}
}, 100);
function endCountDown(){
min.innerHTML = "00";
sec.innerHTML = "00";
clearInterval(cancelInterval);
document.getElementById('opacity').classList.add('black');
setTimeout(afterOpacity, 4000);
}
function afterOpacity(){
document.getElementById('devfestnantes').classList.add('show');
setTimeout(mouveMouse, 3000);
}
function mouveMouse(){
var fakeMouse = document.getElementById('fakemouse');
var press = document.getElementById('press');
var rectPress = press.getBoundingClientRect();
var rectMouse = fakeMouse.getBoundingClientRect();
fakeMouse.style.left = (rectPress.left + (rectPress.width / 2))+"px";
fakeMouse.style.bottom = (window.innerHeight - rectPress.bottom - rectMouse.height)+"px";
setTimeout(mouseClicked, 3000);
}
function mouseClicked(){
var fakeMouse = document.getElementById('fakemouse');
fakeMouse.classList.add('clicked');
setTimeout(startVideo, 500);
}
function startVideo(){
var videoElt = document.getElementById('iovideo');
videoElt.classList.add('show');
var devfestElt = document.getElementById('devfestnantes');
devfestElt.classList.remove('show');
devfestElt.classList.add('hide');
videoElt.width = window.innerWidth;
videoElt.height = window.innerHeight;
videoElt.play();
}
function manageSoundVolume(delta){
if (delta < 10 * 1000){
audioElt.volume = Math.min(Math.max(0,delta / (10 * 1000)),0.5);
}
}
function playSound(url){
audioElt.pause();
audioElt.src = url;
audioElt.play();
}
function nextSong(){
try{
playSound("assets/songs/"+playListSongs[indexPlaylist]);
indexPlaylist = (indexPlaylist + 1) % playListSongs.length;
}catch(err){
console.error(err);
}
}
function endVideo(){
window.close();
}
nextSong();
</script>
</body>
</html>