-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
204 lines (179 loc) · 11.1 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
<!DOCTYPE html>
<html>
<head>
<title>A-LOAD-SCREEN</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/loadingio/[email protected]/dist/loading-bar.min.css"/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/loadingio/[email protected]/dist/loading-bar.js"></script>
<script src="a-load-screen.js"></script>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
</head>
<body>
<button onclick="location.href='/random-config.html'" style="position:absolute; left:40px; top:40px; z-index:1001">show random load screen</button>
<a-scene loading-screen="enabled:false;"
renderer="antialias: true;
colorManagement: true;
sortObjects: true;
physicallyCorrectLights: true;
maxCanvasWidth: 1920;
maxCanvasHeight: 1920;">
<a-assets>
<!-- lots of random models with CC from sketchfab so the load takes a while -->
<a-asset-item id="nakna" src="https://cdn.glitch.me/4912face-eb4d-4b46-a196-56ed20bce8b6/nakna_gallery.glb?v=1663837524202" filesize="22543324"></a-asset-item>
<a-asset-item id="japan-room" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/japanese_traditional_room%20(1).glb?v=1663837554844" filesize="18942516"></a-asset-item>
<a-asset-item id="cinema" src="https://cdn.glitch.me/4912face-eb4d-4b46-a196-56ed20bce8b6/passage_-_cinema_art_in_the_day.glb?v=1663837588261" filesize="48135112"></a-asset-item>
<a-asset-item id="goban" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/black_to_play.glb?v=1663843111766" filesize="1918252"></a-asset-item>
<!-- <a-asset-item id="swan" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/nude_woman_with_swan_statue.glb?v=1663843165629" filesize="3041292"></a-asset-item>
<a-asset-item id="resting" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/resting_nude__1923.glb?v=1663843210918" filesize="1456352"></a-asset-item>
<a-asset-item id="basement" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/ricks_basement.glb?v=1663843212347" filesize="1748096"></a-asset-item>
<a-asset-item id="psych" src="https://cdn.glitch.me/4912face-eb4d-4b46-a196-56ed20bce8b6/the_vr_gallery_shows__vr_cyberdelics.glb?v=1663843242951" filesize="21808288"></a-asset-item>
<a-asset-item id="space" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/need_some_space.glb?v=1663844941833" filesize="1401564"></a-asset-item>
<a-asset-item id="porsche" src="https://cdn.glitch.me/4912face-eb4d-4b46-a196-56ed20bce8b6/free_1975_porsche_911_930_turbo.glb?v=1663845074654" filesize="21969080"></a-asset-item>
<a-asset-item id="lu-yu" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/lu_yu_figurine_derivative.glb?v=1663844969664" filesize="9838168"></a-asset-item>
<a-asset-item id="thinker" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/vr_thinker.glb?v=1663844994941" filesize="1139080"></a-asset-item>
<a-asset-item id="wrestler" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/two_wrestlers_in_combat_repost.glb?v=1663845037241" filesize="13257596"></a-asset-item>
<a-asset-item id="abandoned" src="https://cdn.glitch.me/4912face-eb4d-4b46-a196-56ed20bce8b6/abandoned_house_interior.glb?v=1663845201004" filesize="26925828"></a-asset-item> -->
<!-- broken link to force an error and show how error handling works -->
<a-asset-item id="space-break" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/need_some_space-badlink.glb?v=1663844941833" filesize="7000000"></a-asset-item>
<!-- some images -->
<a-asset-item id="a-png" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/00060.png?v=1663837786871" filesize="463465"></a-asset-item>
<!-- some videos -->
<a-asset-item id="a-vid" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/naf-rotation-problem.webm?v=1666050948057"></a-asset-item>
<!-- some audio -->
<a-asset-item id="some-wav-file" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/mixkit-training-with-punching-bag-2113.wav?v=1665004869136"></a-asset-item>
<a-asset-item id="some-mp3-file" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/Y2Mate.is%20-%20NO%20COPYRIGHT%20BOXING%20BELL%20SOUND%20EFFECT-tNul812L9Fg-160k-1660122858747.mp3?v=1665004889892"></a-asset-item>
<!-- video tag -->
<video preload="auto" crossorigin="anonymous" id="mp4-as-video" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/quest2-controllers.mp4?v=1665004789482"></video>
<!-- image tag -->
<img preload="auto" crossorigin="anonymous" id="png-as-img" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/00019.png?v=1663840381284" filesize="580435">
<!-- audio tag -->
<audio preload="auto" crossorigin="anonymous" id="mp3-as-audio" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/fatman-1.mp3?v=1666049832533"></audio>
</a-assets>
<!-- there is a current bug in a-frame where the camera must be declared early in the scene, or it can accidentally be set as secondary to an auto-injected camera -->
<a-camera wasd-controls></a-camera>
<script>
// run the loader here, right after assets, for best performance;
// before this and it won't work;
// after this and we have to wait for HTML to parse,
// which we would rather have happing in the background while the loader is visible anyways.
window.initALoadScreen();
</script>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-entity position="0 0.1 -4" random-model></a-entity>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
<!-- github octo-cat overlay -->
<a style="z-index:100000;" href="https://github.com/kylebakerio/a-load-screen" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="z-index: 100000; fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<!-- REMIX BUTTON -->
<style>
/* Import fonts */
@font-face {
font-family: HK Grotesk;
src: url("https://cdn.glitch.me/605e2a51-d45f-4d87-a285-9410ad350515%2FHKGrotesk-Regular.otf?v=1603136326027")
format("opentype");
}
@font-face {
font-family: HK Grotesk;
font-weight: bold;
src: url("https://cdn.glitch.me/605e2a51-d45f-4d87-a285-9410ad350515%2FHKGrotesk-Bold.otf?v=1603136323437")
format("opentype");
}
/* Our remix on glitch button */
.btn--remix {
font-family: HK Grotesk;
padding: 0.75rem 1rem;
font-size: 1.1rem;
line-height: 1rem;
font-weight: 500;
height: 2.75rem;
align-items: center;
cursor: pointer;
background: #FFFFFF;
border: 1px solid #000000;
box-sizing: border-box;
border-radius: 4px;
text-decoration: none;
color: #000;
white-space: nowrap;
margin-left: auto;
}
.btn--remix img {
margin-right: 0.5rem;
}
.btn--remix:hover {
background-color: #D0FFF1;
}
/* Navigation grid */
.footer {
display: flex;
justify-content: space-between;
margin: 1rem auto 0;
padding: 1rem 0 0.75rem 0;
width: 100%;
flex-wrap: wrap;
}
.footer a:not(.btn--remix):link,
a:not(.btn--remix):visited {
font-family: HK Grotesk;
font-style: normal;
font-weight: normal;
font-size: 1.1rem;
color: #000;
text-decoration: none;
border-style: none;
}
.footer a:hover {
background: var(--color-primary);
}
.footer .links {
padding: 0.5rem 1rem 1.5rem;
white-space: nowrap;
}
</style>
<footer class="footer" style="z-index:10000;bottom:20px;left:20px;position:fixed;width:200px;">
<a
class="btn--remix"
target="_top"
href="https://glitch.com/edit/#!/a-load-screen?path=index.html"
>
<img
src="https://cdn.glitch.com/605e2a51-d45f-4d87-a285-9410ad350515%2FLogo_Color.svg?v=1618199565140"
alt=""
/>
Remix on Glitch
</a>
</footer>
<!-- /REMIX BUTTON -->
<script>
AFRAME.registerComponent("random-model", {
models: [
"#nakna",
"#japan-room",
// "#cinema", // seems to not work right now
// "#scene", // not sure that's a thing?
"#goban",
"#swan",
"#resting",
"#basement",
"#psych",
// "#space", // too bad, this model is amazing
"#porsche", // half works?
"#lu-yu",
"#thinker",
"#wrestler",
"#abandoned",
],
init() {
let randomModel = document.createElement('a-entity');
let modelId = this.models[Math.floor(Math.random() * this.models.length)];
console.log("will try model",modelId)
this.el.setAttribute('gltf-model',modelId)
this.el.id = "random-model"
// this.el.appendChild(randomModel);
}
})
</script>
</body>
</html>