Spaces:
Running
Running
Update index.html
Browse files36 unmodified lines37383940414243506 unmodified lines55055155255255355455455555655755855956056156256356456556656756856957055657157257357455855956056156256356456556656756856957057557657757157857958036 unmodified lines overflow-x: hidden; -webkit-font-smoothing: antialiased; cursor: default; touch-action: manipulation; }
/* Typography */506 unmodified lines iframe.contentWindow.focus(); } // --- FIX DOPPIO TAP ZOOM --- document.addEventListener('DOMContentLoaded', () => { const gameContainer = document.querySelector('.game-zoom-container'); // 1. Previene il "Pinch to Zoom" (Pizzico con due dita) su tutto il documento document.addEventListener('touchmove', function (event) { if (event.touches.length > 1) { event.preventDefault(); // Blocca se ci sono più di 1 dito } }, { passive: false });
// 2. Previene il doppio tap veloce (Zoom) su tutto il documento let lastTouchEnd = 0; document.addEventListener('touchend', function (event) { const now = (new Date()).getTime(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false);
// 3. Gestione specifica per il contenitore del gioco (Massima priorità) const gameContainer = document.querySelector('.game-zoom-container'); if (gameContainer) { // 1. Previeni doppio tap veloce (zoom) gameContainer.addEventListener('touchend', function (event) { const now = (new Date()).getTime(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false);
// 2. Previeni pinch-to-zoom manuale gameContainer.addEventListener('touchmove', function (event) { if (event.scale && event.scale !== 1) { event.preventDefault(); gameContainer.addEventListener('touchmove', function(e) { // Impedisce qualsiasi movimento della pagina mentre si gioca e.preventDefault(); } }, { passive: false }); } });index.html+23-17