responsive + mobile
This commit is contained in:
@@ -7,9 +7,11 @@
|
||||
<title>Timelapse</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<link rel="stylesheet" href="../css/style_menu.css">
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<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>
|
||||
|
||||
15
js/index.js
15
js/index.js
@@ -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';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user