This commit is contained in:
make
2025-05-07 11:25:47 +08:00
parent e404014c66
commit 5563b1da1f
6 changed files with 50 additions and 12 deletions

View File

@@ -62,17 +62,16 @@
countdownElement.textContent = countdown;
if (countdown <= 0) {
clearInterval(interval);
// Check if there is a previous page in history
if (document.referrer) {
window.history.back();
} else {
window.location.href = '/'; // Redirect to home if no previous page
window.location.href = '/';
}
}
}, 1000);
}
// Start the countdown when the script loads
window.onload = startCountdown;
</script>
</head>