klik untuk menyalin
👇
<script>
(function() {
const desktopURL = "https://contoh-desktop.com"; // ganti dengan URL desktop
const mobileURL = "https://contoh-mobile.com"; // ganti dengan URL mobile
const longPressDuration = 800; // lama tekan lama di mobile (ms)
// Deteksi mobile
const isMobile = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (isMobile) {
let pressTimer;
document.addEventListener("touchstart", function(e) {
pressTimer = setTimeout(function() {
window.location.href = mobileURL;
}, longPressDuration);
}, false);
document.addEventListener("touchend", function(e) {
clearTimeout(pressTimer);
}, false);
} else {
// Desktop klik kanan
document.addEventListener("contextmenu", function(e) {
e.preventDefault(); // mencegah menu default klik kanan muncul
window.location.href = desktopURL;
}, false);
}
})();
</script>
Komentar untuk Script redirect jika layar di tekan
Posting Komentar