Skip to content

Commit 35b273d

Browse files
committed
add play now button
1 parent 60a99a5 commit 35b273d

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

frontend/src/i18n/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@
330330
"settings-desc": "Manage user name, class and view game history.",
331331
"tutorial": "Tutorial",
332332
"tutorial-desc": "Checkup the game mechanics with an tutorial.",
333-
"versions": "Versions"
333+
"versions": "Versions",
334+
"play-now": "Play now"
334335
},
335336
"tutorial": {
336337
"1-battletris": {

frontend/src/lib/versions.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ const versions: Record<string, VersionInterface> = {
9393
title: 'Custom Controls & Hold',
9494
},
9595
'1.4.1': {
96-
bugs: [],
97-
classes: [],
98-
features: [
96+
bugs: [
9997
'disable controls in initial game counter loop',
10098
'load last session in laboratory',
10199
'broken game state',
102100
],
103-
title: 'Bug Fix Round',
101+
classes: [],
102+
features: [
103+
'play now button on start page',
104+
],
105+
title: 'Feedback & Bug Fixes',
104106
},
105107
};
106108

frontend/src/views/MultiPlayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { getRequest } from '../lib/request';
3535
ViewWrapper,
3636
Loading,
3737
},
38-
setup(props) {
38+
setup() {
3939
const loading = ref(true);
4040
const rooms = ref<any[] | null>(null);
4141

frontend/src/views/StartPage.vue

+22
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
</a>
2828
</div>
2929

30+
<div class="text-center">
31+
<router-link class="button" :to="`/multi-player/${rooms[0].id}`">
32+
{{ $t('start-page.play-now') }}
33+
</router-link>
34+
</div>
35+
3036
<div class="mt-12 text-center cursor-pointer">
3137
<router-link to="/mode">
3238
<font-awesome-icon class="text-4xl bounce" icon="chevron-down" />
@@ -40,16 +46,32 @@
4046
<script lang="ts">
4147
import { Component, Vue } from 'vue-property-decorator';
4248
49+
import { ref } from '@vue/composition-api';
4350
import BattletrisIcon from '../icons/battletris.vue';
4451
import Tooltip from '../components/Tooltip.vue';
4552
import QuickLinks from '../components/QuickLinks.vue';
53+
import { getRequest } from '../lib/request';
4654
4755
@Component({
4856
components: {
4957
BattletrisIcon,
5058
QuickLinks,
5159
Tooltip,
5260
},
61+
setup() {
62+
const loading = ref(true);
63+
const rooms = ref<any[] | null>(null);
64+
65+
(async () => {
66+
rooms.value = await getRequest('rooms');
67+
loading.value = false;
68+
})();
69+
70+
return {
71+
loading,
72+
rooms,
73+
};
74+
},
5375
})
5476
export default class Tutorial extends Vue {}
5577
</script>

0 commit comments

Comments
 (0)