31 Mei 2025
<!--Elemen countdown HARUS berada di awal agar langsung bisa diakses oleh JS-->
<br />
<div class="separator">
<span style="font-size: 48px;">
<b>Tunggu: <span id="countdown">10</span> Detik! ⏳</b>
</span>
<div id="link-container" style="margin-top: 20px;"></div> <!--tempat buat link-->
</div>
<script>
// Fungsi untuk mendapatkan nilai parameter dari URL
function getQueryParam(param) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(param);
}
// Ambil parameter dari URL
const uParam = getQueryParam('u');
const hashParam = window.location.hash.substr(1);
// Fungsi untuk membuat link tujuan
function createLink(url) {
const linkContainer = document.getElementById('link-container');
const a = document.createElement('a');
a.href = decodeURIComponent(url);
a.textContent = 'Atau Langsung ke Link Tujuan Anda (Klik di Sini) Tanpa Menunggu Waktu Hitung Mundur';
a.style.fontSize = '24px';
a.style.display = 'inline-block';
a.style.marginTop = '20px';
a.style.textDecoration = 'underline';
a.style.color = '#007bff'; // Biru kayak link biasanya
a.setAttribute('rel', 'nofollow noopener'); // Menambahkan atribut rel="nofollow noopener"
linkContainer.appendChild(a);
}
// Fungsi countdown dan redirect
function redirectWithCountdown(url) {
const countdownElement = document.getElementById('countdown');
let count = parseInt(countdownElement.textContent, 10);
const countdownTimer = setInterval(() => {
countdownElement.textContent = count;
count--;
if (count < 0) {
clearInterval(countdownTimer);
window.location.href = decodeURIComponent(url);
}
}, 1000);
// Juga buatkan link
createLink(url);
}
// Redirect ke URL dari ?u= atau #hash
if (uParam) {
redirectWithCountdown(uParam);
} else if (hashParam !== '') {
redirectWithCountdown(hashParam);
}
</script>
<br /><br /><br />