responsive + mobile

This commit is contained in:
arussac
2025-03-24 20:44:21 +01:00
parent b56e9b629d
commit ac88828c34
2 changed files with 17 additions and 8 deletions

View File

@@ -7,9 +7,11 @@
<title>Timelapse</title>
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/style_menu.css">
</head>
<body>
</head>
<body id="body">
<button class="default-button" id="download"><span>Download App</span></button>
<button class="default-button" id="show-form-button"><span>+</span></button>
<div id="customAlert" class="modal">
<div class="modal-content">
<p id="alertMessage">This is a custom alert!</p>
@@ -38,8 +40,6 @@
</div>
<div>
<div>
<button class="default-button" id="download"><span>Download App</span></button>
<button class="default-button" id="show-form-button"><span>+</span></button>
</div>
<div>
<h1 id="global_title">Caméra Timelapse</h1>

View File

@@ -217,6 +217,15 @@ function isMobileDevice() {
return /Mobi|Android/i.test(navigator.userAgent);
}
if (isMobileDevice()) {
console.log("You are on a mobile device.");
}
window.addEventListener('DOMContentLoaded', (event) => {
if (isMobileDevice()) {
const body = document.body;
const downloadApp = document.getElementById('download');
// Apply hidden to all children of body except the downloadApp element
body.childNodes.forEach((child) => {
if (child.nodeType === 1 && child !== downloadApp) { // Check if the child is an element node
child.style.display = 'none';
}
});
}
});