-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
55 lines (45 loc) · 1.74 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
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html dir="ltr" lang="en-US" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Pony Express: OpenPlans Coder Sounds</title>
<meta name="description" content="OpenPlans Coder Sounds">
<meta name="author" content="OpenPlans">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Mobile Viewport Fix -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style type="text/css">
body {
background: url(static/octocat_unicorn.png) transparent center top no-repeat fixed;
background-size: contain;
}
</style>
</head>
<body>
<audio id="coder-sound"></audio>
<audio id="commit-msg"></audio>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://openplans-ponyexpress.herokuapp.com'),
coderSound = document.getElementById('coder-sound'),
commitMsg = document.getElementById('commit-msg');
socket.on('commit', function (data) {
play(data);
});
coderSound.addEventListener('ended', function(){
this.currentTime = 0;
this.pause();
commitMsg.play();
}, false);
var play = function(data) {
coderSound.src = data.coderSoundUrl;
coderSound.play();
commitMsg.src = data.messageUrl;
};
</script>
</body>
</html>