-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisland.html
177 lines (162 loc) · 11.2 KB
/
island.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src=" https://cdnjs.cloudflare.com/ajax/libs/three.js/r124/three.min.js"></script>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<!-- <script src="https://unpkg.com/aframe-animation-component@^4.1.2/dist/aframe-animation-component.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous"></script>
<script src="https://unpkg.com/aframe-event-set-component@3.0.3/dist/aframe-event-set-component.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.1/dist/aframe-extras.min.js"></script>
<script src="https://unpkg.com/aframe-orbit-controls@1.2.0/dist/aframe-orbit-controls.min.js"></script>
<script
src="https://rawgit.com/mayognaise/aframe-mouse-cursor-component/master/dist/aframe-mouse-cursor-component.min.js">
</script>
<script src="https://cdn.jsdelivr.net/gh/n5ro/aframe-physics-system@v4.0.1/dist/aframe-physics-system.min.js">
</script>
<script src="https://unpkg.com/super-hands@^3.0.1/dist/super-hands.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three-orbitcontrols@2.110.3/OrbitControls.min.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link
href="https://fonts.googleapis.com/css2?family=Ubuntu&family=Maven+Pro&family=Mulish&family=Noto+Sans+JP&family=Roboto:wght@300&family=Tajawal&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="stats/stats.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="island/island.css">
<title>island</title>
</head>
<body>
<div class="nav"> </div>
<div class="landingPage"></div>
<div class="island">
<svg id="mute" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 38.05">
<path id="Line_1" data-name="Line 1"
d="M0.91,15L0.78,15A1,1,0,0,0,0,16v6a1,1,0,1,0,2,0s0,0,0,0V16a1,1,0,0,0-1-1H0.91Z" />
<path id="Line_2" data-name="Line 2"
d="M6.91,9L6.78,9A1,1,0,0,0,6,10V28a1,1,0,1,0,2,0s0,0,0,0V10A1,1,0,0,0,7,9H6.91Z" />
<path id="Line_3" data-name="Line 3"
d="M12.91,0L12.78,0A1,1,0,0,0,12,1V37a1,1,0,1,0,2,0s0,0,0,0V1a1,1,0,0,0-1-1H12.91Z" />
<path id="Line_4" data-name="Line 4"
d="M18.91,10l-0.12,0A1,1,0,0,0,18,11V27a1,1,0,1,0,2,0s0,0,0,0V11a1,1,0,0,0-1-1H18.91Z" />
<path id="Line_5" data-name="Line 5"
d="M24.91,15l-0.12,0A1,1,0,0,0,24,16v6a1,1,0,0,0,2,0s0,0,0,0V16a1,1,0,0,0-1-1H24.91Z" />
<path id="Line_6" data-name="Line 6"
d="M30.91,10l-0.12,0A1,1,0,0,0,30,11V27a1,1,0,1,0,2,0s0,0,0,0V11a1,1,0,0,0-1-1H30.91Z" />
<path id="Line_7" data-name="Line 7"
d="M36.91,0L36.78,0A1,1,0,0,0,36,1V37a1,1,0,1,0,2,0s0,0,0,0V1a1,1,0,0,0-1-1H36.91Z" />
<path id="Line_8" data-name="Line 8"
d="M42.91,9L42.78,9A1,1,0,0,0,42,10V28a1,1,0,1,0,2,0s0,0,0,0V10a1,1,0,0,0-1-1H42.91Z" />
<path id="Line_9" data-name="Line 9"
d="M48.91,15l-0.12,0A1,1,0,0,0,48,16v6a1,1,0,1,0,2,0s0,0,0,0V16a1,1,0,0,0-1-1H48.91Z" />
</svg>
<button class="stats">Performance Stats</button>
<a-scene embedded cursor="rayOrigin:mouse; fuseTimeout: 0" class="scene" vr-mode-ui="enabled: true"
physics="gravity: 0.1; restitution: 0.7" stats>
<a-entity progressive-controls></a-entity>
<!-- Asset Management System -->
<a-assets>
<a-asset-item id="microwave" src="island/assets/3D/microwave/scene.gltf"></a-asset-item>
<a-asset-item id="vacation" src="island/assets/3D/vacation/scene.gltf"></a-asset-item>
<a-asset-item id="room" src="island/assets/3D/animationRoom/scene.gltf"></a-asset-item>
</a-assets>
<a-entity gltf-model="#room" play-all-model-animations modify-room light="type: point; intensity: 4;"
id="roomAnimation" rotation="0 -90 0" material="shader:standard"
animation="property: position; easing: easeInOutQuad; dir: alternate; dur: 3000; to:-0.5 0 -0.10; loop: true; pauseEvents:animation-pause; resumeEvents: animation-resume"
muter static-body shadow="receive:true">
<!-- zigzag animation -->
<a-sphere class="light" scale="0.05 0.05 0.05" position="1.36 1.25 1" grabbable shadow="cast:true"
animation="property: position; easing: easeInOutQuad; dur: 3200; to:1.2 1.9 -0.4; loop: 1; startEvents:light-start; pauseEvents:light-pause; resumeEvents: light-resume">
<a-entity class="castLight"
light="type:spot; angle: 52; distance:5; penumbra: 2.5; color:red; castShadow: true; intensity: 7; target:#microwaveAnimation"
visible="false">
</a-entity>
</a-sphere>
<a-sphere class="light" scale="0.07 0.07 0.07" position="1.36 1.375 0.835" grabbable shadow="cast:true"
animation="property: position; easing: easeInOutQuad; dur: 3500; to:1 2 -0.1; loop: 1;startEvents:light-start; pauseEvents:light-pause; resumeEvents: light-resume">
<a-entity class="castLight"
light="type: spot; angle: 51; distance:3; penumbra: 0.25; color:yellow; castShadow: true; intensity: 3; target:#vacationAnimation"
visible="false">
</a-entity>
</a-sphere>
<a-sphere class="light" scale="0.05 0.05 0.05" position="1.36 1.25 0.66" grabbable shadow="cast:true"
animation="property: position; easing: easeInOutQuad; dur: 3300; to:1.7 1.8 0.1; loop: 1; startEvents:light-start; pauseEvents:light-pause; resumeEvents: light-resume">
<a-entity class="castLight"
light="type: spot; angle: 50; distance:5; penumbra: 2.5; color:blue; castShadow: true; intensity: 7; target:#microwaveAnimation"
visible="false">
</a-entity>
</a-sphere>
<a-entity gltf-model="#microwave" modify-microwave id="microwaveAnimation" scale="0.2 0.2 0.2"
position="2.5 0 0"
sound="src: url(island/assets/3D/sounds/microwaveOpen.mp3); autoplay: false; volume:0.8; preload:auto;"
muter static-body shadow="cast:true">
</a-entity>
<a-entity gltf-model="#vacation" modify-vacation id="vacationAnimation" scale="0.05 0.07 0.05"
position="2.5 0.2 0.06" animation-mixer
animation="property: rotation; to: 0 360 0; dur: 20000; easing: linear; loop: true"
sound="src: url(island/assets/3D/sounds/bell.wav); autoplay: false; volume:0.08; preload:auto;"
muter shadow="cast:true">
</a-entity>
<a-box id="recipe" position="2.35 0.38 0.2" color="#4b778d" depth="0.15" height="0.4" width="0.6"
scale="0.5 0.5 0.5" rotation="0 90 0" visible="false" shadow="cast:true"
animation="property: scale; from: 0.1 0.1 0.1; to:0.5 0.5 0.5; dur: 3000; easing: linear; loop:2">
<a-text id="recipeText" class="recipeText" position="-0.2 0.08 0.1" color="#ffffff"
value="Welcome to" width="0.76" scale="1.7 1.7 1.7"
font="https://cdn.aframe.io/fonts/mozillavr.fnt">
</a-text>
<a-text id="recipeText" class="recipeText" position="-0.2 -0.02 0.1" color="#ffffff"
value="Island 09" width="0.76" scale="1.7 1.7 1.7"
font="https://cdn.aframe.io/fonts/mozillavr.fnt">
</a-text>
</a-box>
</a-entity>
<a-box id="instruction" position="-2.68 2 3.45" color="#4b778d" depth="0.045" height="2.15" width="3.5"
scale="0.5 0.5 0.5" rotation="0 0 0" side="double"
animation="property: position; to:-30 -9 -20; dur: 18500; easing: easeInOutQuad; startEvents:instruction-start">
<a-text class=" text" position="-1.335 0.6 0.1" color="#ffffff"
value="This is a basic demo to experiment with integrating 3D animations into websites using A-frame and Three.js."
width="3">
</a-text>
<a-text class="text" position="-1.335 0.18 0.1" color="#ffffff"
value="Click somewhere in the room to see the animations for the kangaroo." width="3"></a-text>
</a-text>
<a-text class="text" position="-1.335 -0.1 0.1" value="Click the microwave to open it." color="#ffffff"
width="3">
</a-text>
<a-text class="text" position="-1.335 -0.4 0.1" color="#ffffff"
value="DOUBLE CLICK somewhere else (e.g., the white background) to go back to the original perspective."
width="3">
</a-text>
<a-text class="text" position="-1.335 -0.75 0.1" color="#ffffff"
value="Hover and click on the lights to see more animations." width="3">
</a-text>
</a-box>
<!-- <a-entity id="ocean" ocean="density: 20; width: 50; depth: 50; speed: 4" position="0 -0.2 0" -->
<a-entity id="ocean" ocean="density: 20; width: 50; depth: 50; speed: 4" position="0 -0.325 0"
material="color: #b2deec; opacity: 0.75; metalness: 0; roughness: 1" rotation="-90 0 0" shader="ocean"
sound="src: url(island/assets/3D/sounds/sea.mp3); autoplay: true; loop: true; volume:0.5; preload:auto;"
muter static-body>
</a-entity>
<a-entity id="light" light="type: ambient; color: #f4f4f2;"></a-entity>
<!-- <a-entity id="cameraWrapper" position="0 -0.25 6"> -->
<!-- <a-camera id="camera" look-controls orbit-controls="target: 0 1.25 0.5; initialPosition: 0 -0.35 6"> -->
<!-- <a-entity id="cameraWrapper" position="0 0 0" orbit-controls="target:0 1.35 0; initialPosition: 0 1.35 6"> -->
<a-entity id="cameraWrapper" position="0 0 0"
orbit-controls="target:0 1.35 0; initialPosition: 0 1.35 6; maxPolarAngle: 180;">
<a-camera id="camera">
</a-camera>
<!-- <a-entity sphere-collider="objects: a-box" super-hands hand-controls="hand: left"></a-entity>
<a-entity sphere-collider="objects: a-box" super-hands hand-controls="hand: right"></a-entity> -->
</a-entity>
<a-sky shadow="receive: true"></a-sky>
</a-scene>
<section class="softClock"> </section>
</div>
<script src="nav/nav.js"></script>
<script src="stats/stats.js"></script>
<script src="island/island.js"></script>
</body>
</html>