Add voice reading, hide questions from players

This commit is contained in:
2026-01-20 23:17:44 -06:00
parent e4f1e17edb
commit 9969978fd6
3 changed files with 73 additions and 10 deletions

View File

@@ -33,9 +33,15 @@ database.ref('gameState').on('value', (snapshot) => {
playerScore.textContent = state.scores[`player${playerId}`];
}
// Update question
if (state.currentQuestion) {
questionDisplay.textContent = state.currentQuestion.tossup_question;
// Hide question text - players only hear it
if (state.isReading) {
questionDisplay.textContent = '🔊 Listen to the question...';
questionDisplay.style.display = 'block';
} else if (state.currentQuestion) {
questionDisplay.textContent = 'Question loaded. Waiting for moderator to read...';
questionDisplay.style.display = 'block';
} else {
questionDisplay.style.display = 'none';
}
// Update buzzer state
@@ -58,7 +64,8 @@ database.ref('gameState').on('value', (snapshot) => {
answerContainer.style.display = 'block';
answerInput.focus();
} else if (state.buzzer && state.buzzer.playerId) {
statusMessage.textContent = `${state.buzzer.playerId} buzzed in`;
const buzzedPlayerNum = state.buzzer.playerId.replace('player', '');
statusMessage.textContent = `Player ${buzzedPlayerNum} buzzed in`;
buzzer.classList.add('locked');
}
});