forked from jiin/dancing-cube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
64 lines (56 loc) · 1.55 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
<!DOCTYPE html>
<html>
<head>
<title>Dancing Cube - Another three.js and Web Audio API experiment</title>
<meta charset="utf-8">
<style>
body {
margin: 0;
}
canvas {
width: 100%;
height: 100%
}
div#player {
display: none;
}
div#footer {
position: fixed;
bottom: 0;
left: 0;
height: 18px;
width: 100%;
padding: 5px 0;
background-color: #ecf0f1;
font-family: monospace;
text-align: center;
}
div#footer span {
font-size: 12px;
text-decoration: underline;
}
</style>
</head>
<body>
<div id="player"></div>
<div id="footer">
<span>SPACE</span> for start/pause music |
<span>DRAG</span> to rotate the cube
<input id="file" type="file" />
<button onClick="dance()">DANCE!</button>
</div>
<script src="bower_components/three.js/three.min.js"></script>
<script src="bower_components/threex.keyboardstate/threex.keyboardstate.js"></script>
<script>
var objectUrl;
(function () {
function onChange(event) {
var file = event.currentTarget.files[0];
objectUrl = URL.createObjectURL(file);
}
document.getElementById('file').addEventListener('change', onChange);
}());
</script>
<script src="script.js"></script>
</body>
</html>