diff options
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,4 +1,9 @@ let btn = document.querySelector(".neon-button"); +const isMobile = window.matchMedia("only screen and (max-width: 760px)").matches; + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) btn.setAttribute("href", "rannak/noMobiles"); + +if (isMobile) + btn.setAttribute("href", "rannak/noMobiles"); |