xxxxxxxxxx
// Get the viewport width and height
var viewportWidth = window.innerWidth || document.documentElement.clientWidth;
var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
// Log the viewport width and height
console.log("Viewport width: " + viewportWidth);
console.log("Viewport height: " + viewportHeight);
// Check if the viewport width is below a certain threshold to identify mobile devices
if (viewportWidth < 768) {
console.log("Mobile device detected!");
} else {
console.log("Not a mobile device.");
}