Skip to content

Commit

Permalink
some small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebakerio authored Nov 2, 2022
1 parent 87f1cd4 commit 17b72a7
Showing 1 changed file with 49 additions and 10 deletions.
59 changes: 49 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
maxCanvasWidth: 1920;
maxCanvasHeight: 1920;">
<a-assets>
<!-- 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>

<!-- 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="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>
Expand All @@ -35,19 +33,29 @@
<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>
<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="zero" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/00060.png?v=1663837786871" filesize="463465"></a-asset-item>
<a-asset-item id="four" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/00019.png?v=1663840381284" filesize="580435"></a-asset-item>
<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="vid1" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/quest2-controllers.mp4?v=1665004789482"></a-asset-item>
<a-asset-item id="vid2" src="https://cdn.glitch.global/4912face-eb4d-4b46-a196-56ed20bce8b6/a-console-promo.mp4?v=1665004797730"></a-asset-item>
<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 -->
Expand All @@ -73,7 +81,7 @@

<!-- 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 */
Expand Down Expand Up @@ -159,7 +167,38 @@
</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>
</html>

0 comments on commit 17b72a7

Please sign in to comment.