Spaces:
Running
Running
Update fullscreen_playcanvas.js
Browse files- fullscreen_playcanvas.js +16 -16
fullscreen_playcanvas.js
CHANGED
|
@@ -301,23 +301,23 @@
|
|
| 301 |
});
|
| 302 |
|
| 303 |
// βββ 16. Resize / orientation ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 304 |
-
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
wrapper.style.width = '100vw';
|
| 307 |
-
// Utilise dvh si disponible, sinon vh
|
| 308 |
const heightUnit = (isIOS && CSS.supports('height', '1dvh')) ? '100dvh' : '100vh';
|
| 309 |
wrapper.style.height = heightUnit;
|
| 310 |
wrapper.style.maxHeight = heightUnit;
|
| 311 |
-
}
|
| 312 |
-
}
|
| 313 |
-
|
| 314 |
-
window.addEventListener('orientationchange', function () {
|
| 315 |
-
if (isFullscreen) {
|
| 316 |
-
setTimeout(function () {
|
| 317 |
-
wrapper.style.width = '100vw';
|
| 318 |
-
const heightUnit = (isIOS && CSS.supports('height', '1dvh')) ? '100dvh' : '100vh';
|
| 319 |
-
wrapper.style.height = heightUnit;
|
| 320 |
-
wrapper.style.maxHeight = heightUnit;
|
| 321 |
-
}, 200);
|
| 322 |
-
}
|
| 323 |
-
});
|
|
|
|
| 301 |
});
|
| 302 |
|
| 303 |
// βββ 16. Resize / orientation ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 304 |
+
window.addEventListener('resize', function () {
|
| 305 |
+
if (isFullscreen) {
|
| 306 |
+
wrapper.style.width = '100vw';
|
| 307 |
+
// Utilise dvh si disponible, sinon vh
|
| 308 |
+
const heightUnit = (isIOS && CSS.supports('height', '1dvh')) ? '100dvh' : '100vh';
|
| 309 |
+
wrapper.style.height = heightUnit;
|
| 310 |
+
wrapper.style.maxHeight = heightUnit;
|
| 311 |
+
}
|
| 312 |
+
});
|
| 313 |
+
|
| 314 |
+
window.addEventListener('orientationchange', function () {
|
| 315 |
+
if (isFullscreen) {
|
| 316 |
+
setTimeout(function () {
|
| 317 |
wrapper.style.width = '100vw';
|
|
|
|
| 318 |
const heightUnit = (isIOS && CSS.supports('height', '1dvh')) ? '100dvh' : '100vh';
|
| 319 |
wrapper.style.height = heightUnit;
|
| 320 |
wrapper.style.maxHeight = heightUnit;
|
| 321 |
+
}, 200);
|
| 322 |
+
}
|
| 323 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|