From eefebb9b0286658901319f3f2fc8d5bc77eec30f Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Fri, 12 Oct 2018 18:09:04 -0700 Subject: [PATCH] initial loading indicator (ring) --- src/components/song.js | 5 ++++- src/templates/score.html | 2 +- src/templates/stage.html | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/song.js b/src/components/song.js index 8a90ccf..c00a9c4 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -19,6 +19,7 @@ AFRAME.registerComponent('song', { this.analyserSetter = {buffer: true}; this.audioAnalyser = this.data.analyserEl.components.audioanalyser; this.context = this.audioAnalyser.context; + this.songLoadingIndicator = document.getElementById('songLoadingIndicator'); this.victory = this.victory.bind(this); @@ -118,6 +119,8 @@ AFRAME.registerComponent('song', { }, onFetchProgress: function (evt) { - + const progress = evt.loaded / evt.total; + this.songLoadingIndicator.setAttribute( + 'geometry', 'thetaLength', progress * 360); } }); diff --git a/src/templates/score.html b/src/templates/score.html index 3f2dc1c..a892857 100644 --- a/src/templates/score.html +++ b/src/templates/score.html @@ -1,6 +1,6 @@ + bind__visible="isPlaying || isPaused"> + + +