-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
250 lines (227 loc) · 7.21 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
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
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hitman sampler</title>
<link rel="icon" href="favicon.ico"/>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div id="load" style="display:center;">
<div class="row">
<div class="col-sm-4 col-sm-push-4 text-center" style="margin-top:10%;">
<p id="loading">Chargement en cours ... (<span id="imgLoaded"></span>/<span id="nbImage"></span>)</p>
<button id="askNextStep" onclick="nextStep()" style="display:none;">Etape suivante</button>
</div>
</div>
</div>
<div class="container">
<br />
<div id="sampler" style="display:none;">
<div class="jumbotron">
<div class="container text-center">
<h1>Hitman Sampler</h1>
<p><a href="http://www.youtube.com/watch?v=M9_V9Alp0f8">http://www.youtube.com/watch?v=M9_V9Alp0f8</a></p>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part3" data-speed="1000">
<img src="img/hum.png" class="first img-responsive center-block img-thumbnail">
<img src="img/hum1.png" class="second img-responsive center-block img-thumbnail" style="display:none;">
</span>
</div>
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part4" data-speed="140">
<img src="img/PhiFerme.png" class="first img-responsive img-thumbnail">
<img src="img/PhiOuvert.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part45" data-speed="110">
<img src="img/PhiFerme.png" class="first img-responsive img-thumbnail">
<img src="img/PhiOuvert.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part5" data-speed="105">
<img src="img/PhiFerme.png" class="first img-responsive img-thumbnail">
<img src="img/PhiOuvert.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part65" data-speed="130">
<img src="img/TaGueuleOuv.png" class="first img-responsive img-thumbnail">
<img src="img/TaGueuleOuvGrd.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part7" data-speed="150">
<img src="img/SalaudFer.png" class="first img-responsive img-thumbnail">
<img src="img/SalaudOuv.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part8" data-speed="175">
<img src="img/Vazy1.png" class="first img-responsive img-thumbnail">
<img src="img/Vazy2.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
<div class="col-sm-4 col-sm-push-2">
<span class="content" data-sound="part6" data-speed="175">
<img src="img/TaGueuleOuv.png" class="first img-responsive img-thumbnail">
<img src="img/TaGueuleOuvGrd.png" class="second img-responsive img-thumbnail" style="display:none;">
</span>
</div>
</div>
<hr>
<div class="footer">
<p>© Felgines & Mieulet</p>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="buzz.min.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="imagesLoaded.pkgd.min.js"></script>
<script type="text/javascript">
var sounds = {}; // contains all instance of music
/**
* Loading pictures
*/
var el = {
'0' : {
id: 'intro',
url: '01.ogg'
},
'1' : {
id: 'music',
url: '02.ogg'
},
'2' : {
id: 'part45',
url: '04-5.ogg'
},
'3' : {
id: 'part3',
url: '03.ogg'
},
'4' : {
id: 'part4',
url: '04.ogg'
},
'5' : {
id: 'part5',
url: '05.ogg'
},
'6' : {
id: 'part6',
url: '06.ogg'
},
'7' : {
id: 'part7',
url: '07.ogg'
},
'8' : {
id: 'part8',
url: '08.ogg'
},
'9' : {
id: 'part65',
url: '06-5.ogg'
},
}
for( var i in el ) {
sounds[el[i]['id']] = new buzz.sound(el[i]['url']).bind("loadeddata", function(e) {
elementLoaded();
});
}
var nbContentSound = parseInt(i)+1, nbContent,nbContentLoaded = 0;
$('body').imagesLoaded().progress(function(instance,image){
nbContent = nbContentSound + instance.images.length;
elementLoaded();
});
function elementLoaded(){
nbContentLoaded++;
$('#load #imgLoaded').html(nbContentLoaded);
$('#load #nbImage').html(nbContent);
if(nbContentLoaded == nbContent){
$('#load #askNextStep').show();
$('#load #loading').hide();
}
}
function nextStep(){
$('#load').hide();
$('#sampler').show();
}
/**
* Launch music
*/
sounds['intro'].play().bind("ended", function(e) {
sounds['music'].loop();
sounds['music'].play();
})
/**
* Bind
*/
var pictures = {};
$(function() {
$('.content').each(function(){
$(this).mouseenter(function() {
bindPic($(this));
}).click(function(){
bindPic($(this));
});
})
});
function play(i){
sounds['music'].pause();
var l;
if(sounds[i].getPercent() != 100 && sounds[i].getPercent() != 0){
l = Object.keys(sounds).length;
sounds[l] = new buzz.sound(sounds[i].sound.currentSrc);
}else{
l = i;
}
sounds[l].play();
return sounds[l].getDuration() * 1000;
}
function bindPic(el){
var end = play(el.attr('data-sound'));
if(typeof pictures[el.attr('data-sound')] == 'undefined'){
pictures[el.attr('data-sound')] = {};
pictures[el.attr('data-sound')]['duration'] = end;
}
if(pictures[el.attr('data-sound')]['f'] == null){
pictures[el.attr('data-sound')]['f'] = setInterval("togglePic('"+el.attr('data-sound')+"')",el.attr('data-speed'));
}
pictures[el.attr('data-sound')]['end'] = pictures[el.attr('data-sound')]['duration'] + new Date().getTime();
}
function togglePic(rel){
el = $('span[data-sound='+rel+']')
el.find('.first').toggle();
el.find('.second').toggle();
if(new Date().getTime() > pictures[el.attr('data-sound')]['end'] && el.find('.first').is(':visible')){
clearInterval(pictures[el.attr('data-sound')]['f']);
pictures[el.attr('data-sound')]['f'] = null;
}
}
</script>
</head>
<body>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
</body>
</html>