Compare commits

..

3 Commits

2 changed files with 15 additions and 15 deletions

View File

@@ -186,7 +186,6 @@
<div class="side-btn-group">
<button class="btn btn-g btn-full" id="mod-round-btn" onclick="toggleRound()">▶ OPEN ROUND</button>
<button class="btn btn-ghost btn-full" id="mod-resume-btn" style="display:none;" onclick="resumeRound()">▶ RESUME ROUND</button>
<button class="btn btn-yellow btn-full" onclick="resetBuzzer()">↺ RESET BUZZER</button>
</div>
</div>

View File

@@ -86,8 +86,8 @@ function handle(msg){
break;
case 'round_closed':
room=msg.room;
if(role==='mod'){renderMod();renderRoundButtons();}
else{renderPlayerBuzzer();stopPlayerTimer();toast('ROUND CLOSED','warn');}
if(role==='mod'){renderMod();renderRoundButtons();toast('ROUND CLOSED','warn');}
else{renderPlayerBuzzer();stopPlayerTimer();}
break;
case 'buzzer_reset':
room=msg.room;
@@ -342,11 +342,12 @@ function broadcastTimerToPlayers(sec,running){
// MOD ROUND CONTROL
// ══════════════════════════════════════════════════════
function toggleRound(){
if(room.buzzerState.roundOpen){
ws_send({type:'close_round'});
} else {
// Reset buzzer and open round
ws_send({type:'open_round'});
}
// Change button to pause state
const btn=document.getElementById('mod-round-btn');
btn.innerHTML='■ PAUSE ROUND';
btn.className='btn btn-red btn-full';
}
function resumeRound(){
@@ -354,17 +355,17 @@ function resumeRound(){
}
function renderRoundButtons(){
const openBtn=document.getElementById('mod-round-btn');
const btn=document.getElementById('mod-round-btn');
const resumeBtn=document.getElementById('mod-resume-btn');
if(room.buzzerState.roundOpen){
openBtn.innerHTML='■ CLOSE ROUND';
openBtn.className='btn btn-red btn-full';
resumeBtn.style.display='block';
} else {
openBtn.innerHTML='▶ OPEN ROUND';
openBtn.className='btn btn-g btn-full';
btn.innerHTML='■ PAUSE ROUND';
btn.className='btn btn-red btn-full';
resumeBtn.style.display='none';
} else {
btn.innerHTML='▶ OPEN ROUND';
btn.className='btn btn-g btn-full';
resumeBtn.style.display='block';
}
}