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

@@ -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';
}
});
}
});