I think aframe 8 will have a built in loading screen. In the meantime here's how I currently tackle it for aframe scenes exported from Ottifox:
First before the a-scene
tag and after the start of the body I have this markup:
<div id="splash">
<div class="loading"></div>
</div>
Then in a css file:
#splash {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 200px;
height: 200px;
margin: auto;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.loading {
width: 24px;
height: 24px;
border-radius: 50%;
border: 0.25rem solid rgba(255, 255, 255, 0.2);
border-top-color: white;
animation: spin 1s infinite linear;
}
Finally in main.js
document.addEventListener('DOMContentLoaded', function() {
var scene = document.querySelector('a-scene');
var splash = document.querySelector('#splash');
scene.addEventListener('loaded', function (e) {
splash.style.display = 'none';
});
});
You can view source on the example here, to see it all together:
http://ottifox.com/examples/space/index.html