-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
59 lines (53 loc) · 1.95 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebVR Musical Instrument</title>
<!-- A-Frame CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/aframe/0.5.0/aframe.min.js" charset="utf-8"></script>
<!-- Tone.js CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/0.10.0/Tone.min.js" charset="utf-8"></script>
<!-- Our Synth Component -->
<script src="synth-component.js" charset="utf-8"></script>
</head>
<body>
<!-- A-Frame scene -->
<a-scene antialias="true">
<!-- plain white background -->
<a-sky color="white"></a-sky>
<!-- our scene's camera -->
<a-camera position="0 0 4" user-height="0" wasd-controls="enabled: false">
<!-- cursor with fuse enabled, allowing us to detect when it hovers over an entity -->
<a-cursor fuse="true"></a-cursor>
</a-camera>
<!-- We wrap our three rings in an entity and rotate it backwards on the X axis -->
<a-entity id="interface" rotation="-45 0 0">
<!-- The entity that will play the note -->
<a-ring
synth="note: A4"
radius-inner="0.2"
radius-outer="0.6"
color="#212121"
segments-theta="64"
>
<!-- This animation will be triggered when the cursor starts 'fusing' ( hovering ) -->
<a-animation
begin="fusing"
attribute="opacity"
dur="500"
from="0.5"
to="1"
></a-animation>
</a-ring>
<!-- Ring 2 -->
<a-ring synth="note: E4" radius-inner="0.8" radius-outer="1.2" color="#212121" segments-theta="64">
<a-animation begin="fusing" attribute="opacity" dur="500" from="0.5" to="1"></a-animation>
</a-ring>
<!-- Ring 3 -->
<a-ring synth="note: F3" radius-inner="1.4" radius-outer="1.8" color="#212121" segments-theta="64">
<a-animation begin="fusing" attribute="opacity" dur="500" from="0.5" to="1"></a-animation>
</a-ring>
<a-entity>
</a-scene>
</body>
</html>