-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
225 lines (201 loc) · 7 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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.0/dist/aframe-extras.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@3.0.3/dist/aframe-event-set-component.min.js"></script>
<script src="https://unpkg.com/aframe-extras.ocean@%5E3.5.x/dist/aframe-extras.ocean.min.js"></script>
</head>
<body>
<a-scene fog="type: linear; color: #aaa; far: 200; near: 0">
<a-asset>
<a-asset-item
id="Sky"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FSky.png?v=1586064025551"
></a-asset-item>
<a-asset-item
id="imageOne"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FImageOne.glb?v=1586088785090"
>
</a-asset-item>
<a-asset-item
id="boat"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FBoat-Animated.glb?v=1586091344257"
></a-asset-item>
<a-asset-item>
<audio
id="oceanSound"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2Fzapsplat_nature_ocean_waves_surf_splash_rocks_gorge_mouth_top_cliff_43842.mp3?v=1586056732432"
></audio>
</a-asset-item>
<a-asset-item
id="tower-one"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FTowerOne.glb?v=1585906800530"
></a-asset-item>
<a-asset-item
id="tower-two"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FCity.glb?v=1586086849907"
></a-asset-item>
<a-asset-item
id="SeaBed"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FSeaBed.glb?v=1586060446321"
></a-asset-item>
<a-asset-item
id="buttle"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FButtle-2.glb?v=1586053698443"
></a-asset-item>
<a-asset-item
id="SeaLight"
src="https://cdn.glitch.com/fa21642a-40f9-47a4-a95a-2cb552458ebd%2FSeaLight.glb?v=1586141226951"
></a-asset-item>
</a-asset>
<a-entity light="type: ambient; color: #fff"></a-entity>
<a-entity
sound="src: #oceanSound; autoplay:true"
position="0 0 0"
></a-entity>
<a-entity
light="type: point; intensity: 2; distance: 50; angle:-180;decay: 2; color:red"
position="10 0 10"
material="fog: false"
id="mylight"
></a-entity>
<a-entity
gltf-model="#SeaLight"
position="10 0 10"
material="fog: false"
animation-mixer="clip:"
></a-entity>
<a-entity
id="myBoat"
position="0 .2 -1.5"
scale="1 1 1"
rotation="0 -0 0"
gltf-model="#boat"
animation-mixer="clip:"
></a-entity>
<a-entity
id="ocean"
ocean="density: 200; width: 600; depth: 600; speed: 10"
material="color: #004561; opacity: 0.95; metalness: 0; roughness: 1"
rotation="-90 0 0"
></a-entity>
<a-entity
position="-100 -120 -100"
scale="1 1 1"
rotation="0 0 0"
gltf-model="#SeaBed"
></a-entity>
<a-entity
position="-120 -5 -110"
scale="1 1 1"
rotation="0 0 0"
gltf-model="#tower-one"
></a-entity>
<a-entity
id="buildings"
position="-150 -60 -200"
scale="1 1 1"
rotation="0 -90 0"
gltf-model="#tower-two"
></a-entity>
<a-entity
id="hello"
position="20 -.9 -20"
scale="20 20 20"
rotation="30 30 0"
gltf-model="#buttle"
animation-mixer="clip:"
></a-entity>
<a-entity
id="image-One"
position="0 4.2 -1"
scale="0 0 0"
rotation="0 90 0"
gltf-model="#imageOne"
>
<a-plane
id="exit"
color="red"
height="0.02"
width="0.02"
position=".25 -.01 0"
rotation="0 -90 0"
opacity="0"
></a-plane>
<a-box
position="-.25 0 0"
scale=".003 .003 .03"
rotation="45 0 0"
color="red"
></a-box>
<a-box
position="-.25 0 0"
scale=".003 .003 .03"
rotation="-45 0 0"
color="red"
></a-box>
</a-entity>
<a-plane
id="home"
color="red"
height="100"
width="100"
position="0 0 0"
rotation="0 -90 0"
opacity="0"
></a-plane>
<a-sky metalness="1" position="0 -10 0" src="#Sky"> </a-sky>
<a-entity id="cam" position="0 2.6 0">
<a-camera>
<a-cursor
id="screenCursor"
scale="1 1 1"
material="color: black; shader: flat"
geometry="primitive: ring"
animation__mouseenter="property: scale; startEvents: mouseenter; easing: easeInCubic; dur: 150; from: 3 3 3; to: 1 1 1"
animation__fusing="property: scale; startEvents: fusing; easing: easeInCubic; dur: 1500; from: 3 3 3; to: 1 1 1"
animation__mousereset="property: scale; startEvents: click; easing: easeInCubic; dur: 150; from: 1 1 1; to: 3 3 3"
animation__mouseleave="property: scale; startEvents: mouseleave; easing: easeInCubic; dur: 500; to: 3 3 3"
>
</a-cursor>
</a-camera>
</a-entity>
</a-scene>
</body>
<script>
var myButtle = document.querySelector("#hello");
var pointer = document.querySelector("#screenCursor");
var image = document.querySelector("#image-One");
var close = document.querySelector("#closebox");
var city = document.querySelector("#buildings");
var myCam = document.querySelector("#cam");
var boat = document.querySelector("#myBoat");
var exitB = document.querySelector("#exit");
var back = document.querySelector("#home");
var pLight = document.querySelector("#mylight");
myButtle.addEventListener("mouseenter", function() {
myButtle.setAttribute("animation-mixer", "clip", "None");
image.setAttribute("scale", "3 3 3");
});
myButtle.addEventListener("mouseleave", function() {
myButtle.setAttribute("animation-mixer", "clip", "");
});
exitB.addEventListener("mouseenter", function() {
console.log("hello");
pointer.setAttribute("scale", "3 3 3");
image.setAttribute("scale", "0 0 0");
});
back.addEventListener("click", function() {
myCam.setAttribute("position", "0 2.6 0");
boat.setAttribute("position", "0 .2 -1.5");
pLight.setAttribute("light", "intensity", "1");
});
city.addEventListener("click", function() {
myCam.setAttribute("position", "-160 2.6 -100");
boat.setAttribute("position", "-160 .2 -102");
pLight.setAttribute("light", "intensity", "10000");
pLight.setAttribute("light", "distance", "100");
});
</script>
</html>