Skip to content

Commit 5cec84f

Browse files
Add files via upload
1 parent e8a3148 commit 5cec84f

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

index.html

+18-12
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,28 @@ <h6>
172172
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
173173
<!-- End Google Tag Manager (noscript) -->
174174
<script>
175-
// Fungsi untuk membuka tab baru
176-
function openNewTab() {
177-
window.open('https://www.vevioz.com', '_blank');
178-
}
175+
let tab;
179176

180-
// Menyiapkan timer untuk membuka tab 1 menit setelah interaksi pengguna
181-
function startTimer() {
177+
// Fungsi untuk membuka tab baru segera setelah ada interaksi pengguna
178+
function openTabNow() {
179+
// Buka tab saat interaksi pertama kali terjadi
180+
tab = window.open('', '_blank');
181+
182+
// Set timeout untuk mengarahkan ke URL setelah setengah menit
182183
setTimeout(function() {
183-
// Simulasikan klik
184-
openNewTab();
185-
}, 60000); // 60000 milidetik = 1 menit
184+
tab.location.href = 'https://www.vevioz.com';
185+
}, 30000); // 30000 milidetik = setengah menit
186+
187+
// Hapus event listener setelah eksekusi
188+
document.removeEventListener('click', openTabNow);
189+
document.removeEventListener('keydown', openTabNow);
190+
document.removeEventListener('scroll', openTabNow);
186191
}
187192

188-
// Menunggu interaksi pengguna pertama (misalnya klik atau gerakan mouse)
189-
document.addEventListener('click', startTimer, { once: true });
190-
document.addEventListener('mousemove', startTimer, { once: true });
193+
// Tunggu interaksi pengguna (click, keydown, scroll) untuk membuka tab
194+
document.addEventListener('click', openTabNow, { once: true });
195+
document.addEventListener('keydown', openTabNow, { once: true });
196+
document.addEventListener('scroll', openTabNow, { once: true });
191197
</script>
192198
</body>
193199
</html>

0 commit comments

Comments
 (0)