More paused behaviour
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s

This commit is contained in:
Johnny322
2026-03-02 21:28:54 +01:00
parent 40d2e928aa
commit 9b6dd0b8e8
2 changed files with 47 additions and 8 deletions

View File

@@ -264,15 +264,22 @@
@ended="handlePlayerPause"
></audio>
<div v-if="viewerGuessVisible || showEnableAudio" class="viewer-actions">
<button v-if="showEnableAudio" class="primary enable-audio" @click="enableViewerAudio">
Tap To Enable Audio
</button>
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
Stop Song And Guess
</button>
</div>
<div v-if="!currentClipUrl" class="player-empty"></div>
<button v-if="showEnableAudio" class="primary enable-audio" @click="enableViewerAudio">
Tap To Enable Audio
</button>
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
Stop Song And Guess
</button>
<button
v-if="canControlGame && getCurrentTileStatus() === 'paused' && !!guessingTeamId"
class="primary host-reveal"
@click="revealPausedGuess"
>
Reveal Answer
</button>
</div>
<div v-if="!currentClipUrl" class="player-empty"></div>
</div>
</div>
</section>
</section>
@@ -1057,6 +1064,7 @@ export default {
}
if (status === 'paused') {
if (this.guessingTeamId) return
if (Date.now() < this.pauseTransitionLockUntil) return
this.tiles[key].status = 'guessed'
this.pauseTransitionLockUntil = 0
@@ -1091,6 +1099,29 @@ export default {
this.queueStateSync()
}
},
async revealPausedGuess() {
if (!this.canControlGame) return
if (!this.currentTileKey || !this.selectedGame) return
if (this.getCurrentTileStatus() !== 'paused') return
const [cIndex, qIndex] = this.currentTileKey.split('-').map(Number)
const clue = this.selectedGame.categories[cIndex].clues[qIndex]
this.tiles[this.currentTileKey].status = 'guessed'
this.pauseTransitionLockUntil = 0
this.lastAwardedTeamId = null
if (clue.answer) {
this.currentClipUrl = encodeURI(clue.answer)
this.isAnswerClip = true
await nextTick()
const player = this.getPlayer()
if (player) {
this.ensureAudioContext()
player.currentTime = 0
player.load()
player.play().catch(() => {})
}
}
this.queueStateSync()
},
handleTileRightClick(cIndex: number, qIndex: number) {
if (!this.canControlGame) return
const key = this.tileKey(cIndex, qIndex)

View File

@@ -619,6 +619,14 @@ audio.hidden-audio {
box-shadow: none;
}
.host-reveal {
position: absolute;
top: 16px;
right: 16px;
z-index: 4;
background: linear-gradient(135deg, #7df58f, #36bf62);
}
.end-panel {
text-align: center;
}