selected song UI

This commit is contained in:
Kevin Ngo
2018-07-20 23:57:18 +02:00
parent a6bf1834f6
commit 6267492eb6
2 changed files with 39 additions and 23 deletions

View File

@@ -7,9 +7,14 @@ var challengeDataStore = {};
AFRAME.registerState({
initialState: {
challenge: {
author: '',
difficulty: '',
downloads: '',
downloadsText: '',
id: AFRAME.utils.getUrlParameter('challenge'),
isLoading: false
isLoading: false,
songName: '',
songSubName: '',
},
inVR: false,
maxStreak: 0,
@@ -55,12 +60,14 @@ AFRAME.registerState({
*/
menuchallengeselect: function (state, id) {
let challengeData = challengeDataStore[id];
Object.assign(state.menuSelectedChallenge, challengeData);
state.menuSelectedChallenge.id = id;
state.menuDifficulties.length = 0;
for (let i = 0; i < challengeData.difficulties.length; i++) {
state.menuDifficulties.push(challengeData.difficulties[i]);
}
state.menuSelectedChallenge.image = utils.getS3FileUrl(id, 'image.jpg');
state.menuSelectedChallenge.downloadsText = `${challengeData.downloads} Plays`;
},
menudifficultyselect: function (state, difficulty) {