Skip to content

Commit

Permalink
display countdown on answer submission screen
Browse files Browse the repository at this point in the history
  • Loading branch information
OtherwiseJunk committed Apr 30, 2024
1 parent da35f48 commit add2f63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Yak/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ const phase = ref(0)
const animationComplete = ref(false);
const acronym = ref("");
const playerCount = ref(1);
const roundTimeRemaining = ref(0);
let submissions: Map<number, UserSubmission>;
cable.$subscribe((_, state) => {
phase.value = state.gameState.game_phase
acronym.value = state.gameState.current_acronym
submissions = state.gameState.submissions
playerCount.value = state.gameState.players.length
roundTimeRemaining.value = state.gameState.round_time_remaining;
})
function onComplete() {
Expand All @@ -44,7 +45,7 @@ function onNextRound(){
<div class="yaag-root">
<SplashScreen v-if="phase === 0 || !animationComplete" @animation-complete="onComplete()" @start="onStart()">
</SplashScreen>
<AnswerSubmission :acronym="acronym" v-if="phase === 1 && animationComplete" @submit="(answer) => onSubmit(answer)">
<AnswerSubmission :timeRemaining="roundTimeRemaining" :acronym="acronym" v-if="phase === 1 && animationComplete" @submit="(answer) => onSubmit(answer)">
</AnswerSubmission>
<VotingScreen
:submissionsByUserId="submissions"
Expand Down
3 changes: 2 additions & 1 deletion Yak/src/components/AnswerSubmissionScreen.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div v-if="allowSubmission" >
<h1 class="font">{{ props.timeRemaining }}</h1>
<Acronym :letterArray="letterArray" :colors="colors.acronymPallette"></Acronym>
<br>
<div class="input-container">
Expand Down Expand Up @@ -57,7 +58,7 @@ import { computed, ref } from 'vue';
import WaitingForOtherPlayersComponent from './WaitingForOtherPlayersComponent.vue'
import Acronym from './Acronym.vue';
import { usePalletteStore } from '../stores/palletteStore';
const props = defineProps(['acronym', 'colorPallette'])
const props = defineProps(['acronym', 'colorPallette', 'timeRemaining'])
const emits = defineEmits({
submit(answer: string) {
if (answer) return true;
Expand Down
3 changes: 0 additions & 3 deletions YakBak/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ GEM
websocket-client-simple (>= 0.3.0)
discordrb-webhooks (3.5.0)
rest-client (>= 2.0.0)
dockerfile-rails (1.6.9)
rails (>= 3.0.0)
domain_name (0.6.20240107)
dotenv (3.1.0)
drb (2.2.1)
Expand Down Expand Up @@ -250,7 +248,6 @@ DEPENDENCIES
bootsnap
debug
discordrb
dockerfile-rails (>= 1.6)
dotenv
httparty
puma (>= 5.0)
Expand Down

0 comments on commit add2f63

Please sign in to comment.