MatteoScript commited on
Commit
ce5b623
·
verified ·
1 Parent(s): fb79f88

Update play.html

Browse files
Files changed (1) hide show
  1. play.html +28 -1
play.html CHANGED
@@ -116,7 +116,34 @@
116
  </div>
117
 
118
  <script>
119
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  /**
121
  * ==========================================================================================
122
  * ⚙️ CONFIGURAZIONE DI GIOCO - MATTEO INNOVATION LAB EDITION
 
116
  </div>
117
 
118
  <script>
119
+ document.addEventListener('DOMContentLoaded', () => {
120
+
121
+ // 1. Previene il "Pinch to Zoom" (Pizzico con due dita) su tutto il documento
122
+ document.addEventListener('touchmove', function (event) {
123
+ if (event.touches.length > 1) {
124
+ event.preventDefault(); // Blocca se ci sono più di 1 dito
125
+ }
126
+ }, { passive: false });
127
+
128
+ // 2. Previene il doppio tap veloce (Zoom) su tutto il documento
129
+ let lastTouchEnd = 0;
130
+ document.addEventListener('touchend', function (event) {
131
+ const now = (new Date()).getTime();
132
+ if (now - lastTouchEnd <= 300) {
133
+ event.preventDefault();
134
+ }
135
+ lastTouchEnd = now;
136
+ }, false);
137
+
138
+ // 3. Gestione specifica per il contenitore del gioco (Massima priorità)
139
+ const gameContainer = document.querySelector('.game-zoom-container');
140
+ if (gameContainer) {
141
+ gameContainer.addEventListener('touchmove', function(e) {
142
+ // Impedisce qualsiasi movimento della pagina mentre si gioca
143
+ e.preventDefault();
144
+ }, { passive: false });
145
+ }
146
+ });
147
  /**
148
  * ==========================================================================================
149
  * ⚙️ CONFIGURAZIONE DI GIOCO - MATTEO INNOVATION LAB EDITION