-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.html
70 lines (62 loc) · 1.85 KB
/
animation.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
<!doctype HTML>
<html>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<script src="js/aframe.min.js"></script>
<script src="js/aframe-ar.js"></script>
<body style="margin: 0px; overflow: hidden;">
<script>
window.onload = function () {
document
.querySelector(".say-hi-button")
.addEventListener("click", function () {
// here you can change also a-scene or a-entity properties, like
// changing your 3D model source, size, position and so on
// or you can just open links, trigger actions...
alert("Hi there!");
});
};
</script>
<style>
.buttons {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 4em;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
}
.say-hi-button {
padding: 0.25em;
border-radius: 4px;
border: none;
background: white;
color: black;
width: 10em;
height: 4em;
}
</style>
<div class="buttons">
<button class="say-hi-button">SAY HI!</button>
</div>
<a-scene embedded vr-mode-ui="enabled: false;" arjs="debugUIEnabled: true;">
<a-assets>
<img id="earth-sphere" src="images/earth-sphere.jpg" />
</a-assets>
<!--
for more info, see: https://aframe.io/docs/1.0.0/components/animation.html
for more examples: https://stemkoski.github.io/A-Frame-Examples/animation.html
-->
<a-marker type="pattern" url="data/kanji.patt">
<a-sphere position="0 5 0"
scale="3 3 3"
material="src: #earth-sphere; transparent: true; opacity: 0.95;"
animation__rotate = "property: rotation; dur: 8000; easing: linear; dir: normal; from:0 0 0; to: 0 360 0; loop: true;">
</a-sphere>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>