I recently made a javascript game, however, it refuses to work with phones and iPads...
Is there some way to know that whether the user is with a PC or not, so that I can prevent mobile users from trying it?
I recently made a javascript game, however, it refuses to work with phones and iPads...
Is there some way to know that whether the user is with a PC or not, so that I can prevent mobile users from trying it?
You can use media query for the responsive UI and see the below code:
// For Smartphone
if (window.innerWidth < 600)
{
// TODO-- for the SmartPhone
}
// For Tablet
else if(window.innerWidth > 600 && window.innerWidth < 768)
{
//TODO-- for the Tablet.
}
// For Desktop
else if(window.innerWidth > 768)
{
//TODO -- for the Desktop.
}