fix responsive for IPA & APK
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
||||
<title>OpenPlanetsMaps</title>
|
||||
<link rel="icon" href="IMG/IMP_Gen_logo-removebg-preview.png" type="image/png">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
|
||||
+10
-1
@@ -361,19 +361,28 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const isMobile = window.innerWidth <= 768 || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
const isElectron = navigator.userAgent.toLowerCase().includes('electron');
|
||||
const isCapacitor = window.Capacitor !== undefined; // Détecte l'application mobile native
|
||||
|
||||
if (isMobile || isElectron) {
|
||||
if (isMobile || isElectron || isCapacitor) {
|
||||
const iframes = document.querySelectorAll('iframe');
|
||||
iframes.forEach(iframe => {
|
||||
const fallback = document.createElement('div');
|
||||
if (isElectron) {
|
||||
fallback.textContent = "3D models are not compatible on the desktop app";
|
||||
} else if (isCapacitor) {
|
||||
fallback.textContent = "3D models are not compatible on the mobile app";
|
||||
} else {
|
||||
fallback.textContent = "functionality not available on mobile devices";
|
||||
}
|
||||
fallback.style.display = "flex";
|
||||
fallback.style.alignItems = "center";
|
||||
fallback.style.justifyContent = "center";
|
||||
|
||||
// Correction du responsive : on empêche la boîte de déborder de l'écran
|
||||
fallback.style.width = "100%";
|
||||
fallback.style.maxWidth = "100%";
|
||||
fallback.style.boxSizing = "border-box";
|
||||
|
||||
fallback.style.minHeight = "200px";
|
||||
fallback.style.backgroundColor = "#1e293b";
|
||||
fallback.style.color = "#f87171";
|
||||
|
||||
Reference in New Issue
Block a user