load() instead of event listeners

This commit is contained in:
Diego F. Goberna
2018-11-16 16:57:29 +01:00
parent 46ebe3b574
commit 13d0305272
4 changed files with 7 additions and 12 deletions

View File

@@ -1,10 +0,0 @@
AFRAME.registerComponent('assets-loaded', {
init: function () {
this.el.addEventListener('loaded', this.onLoad.bind(this));
this.el.addEventListener('timeout', this.onLoad.bind(this));
},
onLoad: function (ev) {
document.getElementById('tutorial2d').style.display = 'none';
}
});

View File

@@ -0,0 +1,5 @@
AFRAME.registerComponent('tutorial-2d', {
play: function () {
document.getElementById('tutorial2d').style.display = 'none';
}
});

View File

@@ -58,4 +58,4 @@ html {
width: 80%;
left: 10%;
}
}
}

View File

@@ -47,7 +47,7 @@
stage-colors="color: blue"
fog="color: #a00; density: 0.035; type: exponential"
vr-mode-ui="enterVRButton: #vrButton"
assets-loaded>
tutorial-2d>
<a-assets timeout="10000">
{% include './assets.html' %}