Skip to content

Commit be60c2b

Browse files
m.buchhorn-rothclaude
andcommitted
fix: show winner overlay and confetti in fullscreen presenter view
The presenter view goes fullscreen on the presMode element, but the winner overlay and confetti were appended to document.body — siblings of presMode — so browsers did not render them in fullscreen. Append them inside presMode while presenting, and restore the overlay to the body on exit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6d949be commit be60c2b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@ <h2 id="joinTicketName"></h2>
660660
function showWinner(name) {
661661
document.querySelector('.winner-emoji').textContent = emojiFor(name);
662662
winnerNameEl.textContent = emojiFor(name) + ' ' + name;
663+
// In fullscreen presenter mode only descendants of presMode render,
664+
// so move the overlay inside presMode to keep the winner visible.
665+
(inPres ? presMode : document.body).appendChild(winnerOverlay);
663666
winnerOverlay.classList.add('show');
664667
rainConfetti();
665668
// Broadcast winner to mobile clients via Firebase
@@ -677,7 +680,7 @@ <h2 id="joinTicketName"></h2>
677680
+ ';width:' + (6+Math.random()*10) + 'px;height:' + (6+Math.random()*10)
678681
+ 'px;border-radius:' + (Math.random()>.5?'50%':'2px')
679682
+ ';animation-delay:' + Math.random()*.9 + 's;animation-duration:' + (2.5+Math.random()*2) + 's;';
680-
document.body.appendChild(el);
683+
(inPres ? presMode : document.body).appendChild(el);
681684
setTimeout(() => el.remove(), 5500);
682685
}
683686
}
@@ -795,6 +798,8 @@ <h2 id="joinTicketName"></h2>
795798
inPres = false; presMode.classList.remove('active');
796799
document.body.style.overflow = '';
797800
document.exitFullscreen?.().catch(() => {});
801+
// Restore the winner overlay to the body for normal (non-presenter) mode.
802+
document.body.appendChild(winnerOverlay);
798803
}
799804
presClose.addEventListener('click', exitPres);
800805
document.addEventListener('fullscreenchange', () => { if (!document.fullscreenElement && inPres) exitPres(); });

0 commit comments

Comments
 (0)