diff --git a/src/state/index.js b/src/state/index.js index 5beddfc..bac4366 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -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) { diff --git a/src/templates/menu.html b/src/templates/menu.html index a9c4d1f..2018e0f 100644 --- a/src/templates/menu.html +++ b/src/templates/menu.html @@ -27,29 +27,13 @@ {% endraw %} {% endmacro %} - + + position="0 0 -0.005"> - - - - - + {{ searchResults() }} @@ -58,7 +42,7 @@ bind__visible="!!menuSelectedChallenge.id" menu-difficulty-select layout="type: box; columns: 1; marginRow: -0.1" - position="0.455 1.078 0"> + position="0.455 .3 0"> {% raw %}