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

This commit is contained in:
Sebastian Unterschütz committed 2026-03-24 09:25:55 +01:00
1 parent bf2609e2a9
commit fc7cef4989
3 files changed
+38

No files matched your search

+35
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;