Skip to content

Commit

Permalink
responsive message
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhiscoding committed Jan 28, 2024
1 parent 2a6c097 commit 7d6c013
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ let artistname = document.querySelector('.artistname');
const artisturl = document.querySelector('.artisturl');
const search_btn = document.querySelector('.search_btn');
const logo = document.querySelector('.logo');
setTimeout(function(){
if (isMobileDevice()) {
// Code to run if the user is on a mobile device
window.alert("Use Desktop for better experience.");
} else {
// Code to run if the user is not on a mobile device
console.log("Not a mobile device.");
}
}, 1000);

logo.querySelector('span').addEventListener('click', function(){
window.open(location.href, '_blank');
});
Expand Down Expand Up @@ -394,4 +404,8 @@ function makegraph(arr){
}
}
});
}
}
function isMobileDevice() {
return 'ontouchstart' in window || navigator.maxTouchPoints;
}

0 comments on commit 7d6c013

Please sign in to comment.