Private
Public Access
1
0

fix view port rendering to include
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s

This commit is contained in:
Sebastian Unterschütz
2026-03-24 09:25:55 +01:00
parent bf2609e2a9
commit fc7cef4989
3 changed files with 38 additions and 0 deletions

View File

@@ -856,6 +856,41 @@ function restartGame() {
console.log('✅ Game restarted - ready to play again');
}
// ===== FULLSCREEN =====
function toggleFullscreen() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(() => {});
} else {
document.exitFullscreen().catch(() => {});
}
}
function updateFullscreenBtn() {
const btn = document.getElementById('fullscreen-btn');
if (!btn) return;
btn.textContent = document.fullscreenElement ? '✕' : '⛶';
btn.title = document.fullscreenElement ? 'Vollbild beenden' : 'Vollbild';
}
document.addEventListener('fullscreenchange', updateFullscreenBtn);
// Auto-Fullscreen beim ersten Nutzer-Klick
let autoFullscreenDone = false;
document.addEventListener('click', function requestAutoFullscreen() {
if (!autoFullscreenDone && !document.fullscreenElement) {
autoFullscreenDone = true;
document.documentElement.requestFullscreen().catch(() => {});
}
}, { once: false, capture: true });
document.addEventListener('touchstart', function requestAutoFullscreenTouch() {
if (!autoFullscreenDone && !document.fullscreenElement) {
autoFullscreenDone = true;
document.documentElement.requestFullscreen().catch(() => {});
}
}, { once: false, capture: true });
// Export functions for WASM to call
window.showMenu = showMenu;
window.hideMenu = hideMenu;