responsive + mobile
This commit is contained in:
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