fix view port rendering to include
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m3s
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user