Added real frontend
Made hostname global and easy to change in docker
This commit is contained in:
BIN
cmd/frontend/public/characters/Aloy.png
Normal file
BIN
cmd/frontend/public/characters/Aloy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
BIN
cmd/frontend/public/characters/Kratos.png
Normal file
BIN
cmd/frontend/public/characters/Kratos.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 129 KiB |
BIN
cmd/frontend/public/characters/PaperMario.png
Normal file
BIN
cmd/frontend/public/characters/PaperMario.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
BIN
cmd/frontend/public/characters/Raiden.png
Normal file
BIN
cmd/frontend/public/characters/Raiden.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 185 KiB |
BIN
cmd/frontend/public/characters/Sora.png
Normal file
BIN
cmd/frontend/public/characters/Sora.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import arne from '../../arne.js'
|
import arne from '../../arne.js'
|
||||||
|
import {mapState} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -25,6 +26,17 @@ export default {
|
|||||||
scrollDown: true,
|
scrollDown: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["reloadGamesList"]),
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
reloadGamesList(newValue) {
|
||||||
|
if (newValue) {
|
||||||
|
this.reloadGames();
|
||||||
|
this.$store.dispatch("reloadGamesList", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scrollInspiration() {
|
scrollInspiration() {
|
||||||
let inspirationListDOM = document.querySelector(".inspirationList");
|
let inspirationListDOM = document.querySelector(".inspirationList");
|
||||||
@@ -40,22 +52,25 @@ export default {
|
|||||||
this.scrollDown = !this.scrollDown;
|
this.scrollDown = !this.scrollDown;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
reloadGames() {
|
||||||
|
this.axios({
|
||||||
|
method: "get",
|
||||||
|
url: `${arne.hostname}/music/all`,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.allGamesList = response.data;
|
||||||
|
this.$store.dispatch("updateHowManyGames", this.allGamesList.length);
|
||||||
|
})
|
||||||
|
.catch(function(error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.axios({
|
this.reloadGames();
|
||||||
method: "get",
|
window.setInterval(() => {
|
||||||
url: `${arne.hostname}/music/all`,
|
this.scrollInspiration();
|
||||||
})
|
}, 40);
|
||||||
.then((response) => {
|
|
||||||
this.allGamesList = response.data;
|
|
||||||
this.$store.dispatch("updateHowManyGames", this.allGamesList.length);
|
|
||||||
})
|
|
||||||
.catch(function(error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
window.setInterval(() => {
|
|
||||||
this.scrollInspiration();
|
|
||||||
}, 40);
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,6 +43,26 @@
|
|||||||
<img src="characters/Samus.png" alt="samus" />
|
<img src="characters/Samus.png" alt="samus" />
|
||||||
<p>Samus</p>
|
<p>Samus</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="fighter" @click="chooseFighter('Kratos')">
|
||||||
|
<img src="characters/Kratos.png" alt="kratos" />
|
||||||
|
<p>Kratos</p>
|
||||||
|
</div>
|
||||||
|
<div class="fighter" @click="chooseFighter('Aloy')">
|
||||||
|
<img src="characters/Aloy.png" alt="aloy" />
|
||||||
|
<p>Aloy</p>
|
||||||
|
</div>
|
||||||
|
<div class="fighter" @click="chooseFighter('Sora')">
|
||||||
|
<img src="characters/Sora.png" alt="sora" />
|
||||||
|
<p>Sora</p>
|
||||||
|
</div>
|
||||||
|
<div class="fighter" @click="chooseFighter('Raiden')">
|
||||||
|
<img src="characters/Raiden.png" alt="raiden" />
|
||||||
|
<p>Raiden</p>
|
||||||
|
</div>
|
||||||
|
<div class="fighter" @click="chooseFighter('PaperMario')">
|
||||||
|
<img src="characters/PaperMario.png" alt="paper mario" />
|
||||||
|
<p>Paper Mario</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div class="extraButtonsDiv">
|
<div class="extraButtonsDiv">
|
||||||
<button @click="resetPlaylist">Reset playlist</button>
|
<button @click="resetPlaylist">Reset playlist</button>
|
||||||
<button @click="resetPoints">Reset points</button>
|
<button @click="resetPoints">Reset points</button>
|
||||||
|
<button @click="syncGames">Sync games</button>
|
||||||
<button @click="startSoundTest">Sound test</button>
|
<button @click="startSoundTest">Sound test</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -16,7 +17,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async resetPoints() {
|
async resetPoints() {
|
||||||
/* await this.APIresetPlaylist(); */
|
|
||||||
this.$store.dispatch("resetPlayerScore");
|
this.$store.dispatch("resetPlayerScore");
|
||||||
this.$store.dispatch("resetPlayerWelcomed");
|
this.$store.dispatch("resetPlayerWelcomed");
|
||||||
this.$store.dispatch("setRoundStarted", false);
|
this.$store.dispatch("setRoundStarted", false);
|
||||||
@@ -27,6 +27,17 @@ export default {
|
|||||||
this.$store.dispatch("setCurrentlyLoadingTrack", "N/A");
|
this.$store.dispatch("setCurrentlyLoadingTrack", "N/A");
|
||||||
this.$store.dispatch("setCurrentTrackHidden", false);
|
this.$store.dispatch("setCurrentTrackHidden", false);
|
||||||
},
|
},
|
||||||
|
async syncGames() {
|
||||||
|
await this.APIsyncGames();
|
||||||
|
await this.APIresetPlaylist();
|
||||||
|
this.$store.dispatch("resetPlayerScore");
|
||||||
|
this.$store.dispatch("resetPlayerWelcomed");
|
||||||
|
this.$store.dispatch("setRoundStarted", false);
|
||||||
|
this.$store.dispatch("updatePlaylistHistory", this.emptyPlaylist);
|
||||||
|
this.$store.dispatch("setCurrentlyLoadingTrack", "N/A");
|
||||||
|
this.$store.dispatch("setCurrentTrackHidden", false);
|
||||||
|
this.$store.dispatch("reloadGamesList", true);
|
||||||
|
},
|
||||||
startSoundTest() {
|
startSoundTest() {
|
||||||
this.$emit("start-sound-test");
|
this.$emit("start-sound-test");
|
||||||
},
|
},
|
||||||
@@ -45,6 +56,21 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
APIsyncGames() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.axios({
|
||||||
|
method: "get",
|
||||||
|
url: `${arne.hostname}/sync`,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
|
.catch(function(error) {
|
||||||
|
console.log(error);
|
||||||
|
reject();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const store = createStore({
|
|||||||
someoneHasWon: false,
|
someoneHasWon: false,
|
||||||
winningScore: 20,
|
winningScore: 20,
|
||||||
roundStarted: false,
|
roundStarted: false,
|
||||||
|
reloadGamesList: false,
|
||||||
listOfPlayers: [],
|
listOfPlayers: [],
|
||||||
localPlaylist: [],
|
localPlaylist: [],
|
||||||
playlistHistory: [
|
playlistHistory: [
|
||||||
@@ -83,6 +84,9 @@ const store = createStore({
|
|||||||
updateHowManyGames(state, payload) {
|
updateHowManyGames(state, payload) {
|
||||||
state.howManyGames = payload;
|
state.howManyGames = payload;
|
||||||
},
|
},
|
||||||
|
reloadGamesList(state, payload) {
|
||||||
|
state.reloadGamesList = payload;
|
||||||
|
},
|
||||||
updateStopAfterCurrent(state, payload) {
|
updateStopAfterCurrent(state, payload) {
|
||||||
state.stopAfterCurrent = payload;
|
state.stopAfterCurrent = payload;
|
||||||
},
|
},
|
||||||
@@ -190,6 +194,9 @@ const store = createStore({
|
|||||||
updateHowManyGames(context, payload) {
|
updateHowManyGames(context, payload) {
|
||||||
context.commit("updateHowManyGames", payload);
|
context.commit("updateHowManyGames", payload);
|
||||||
},
|
},
|
||||||
|
reloadGamesList(context, payload) {
|
||||||
|
context.commit("reloadGamesList", payload);
|
||||||
|
},
|
||||||
updateStopAfterCurrent(context, payload) {
|
updateStopAfterCurrent(context, payload) {
|
||||||
context.commit("updateStopAfterCurrent", payload);
|
context.commit("updateStopAfterCurrent", payload);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user