This commit is contained in:
2025-02-05 15:50:04 +05:30
parent 7f15dbfc08
commit 55448e34c6
38 changed files with 449 additions and 663 deletions

View File

@@ -1,4 +1,3 @@
// Countdown logic
let countdown = 10;
let countdownInterval;
const timerElement = document.getElementById("timer");
@@ -10,15 +9,15 @@ function updateCountdown() {
timerElement.textContent = countdown;
}
if (countdown <= 0) {
button.disabled = false; // Enable the button when countdown ends
button.classList.add("active"); // Optional, if you use active class for style
button.style.cursor = "pointer"; // Enable cursor
setTimeout(function () {
button.textContent = "Getting links..."; // Change text before enabling
}, 300); // 0.3 seconds delay
setTimeout(function () {
button.textContent = "Get link"; // Final button text
}, 600); // After another 0.3 seconds
button.disabled = false;
button.classList.add("active");
button.style.cursor = "pointer";
setTimeout(() => {
button.textContent = "Getting links...";
}, 300);
setTimeout(() => {
button.textContent = "Get link";
}, 600);
clearInterval(countdownInterval);
}
}
@@ -32,14 +31,12 @@ function stopCountdown() {
}
function init() {
// Initialize countdown value and button state
countdown = 10;
timerElement.textContent = countdown;
button.disabled = true;
button.classList.remove("active");
button.style.cursor = "not-allowed";
button.textContent = "PLEASE WAIT...";
startCountdown();
}
@@ -52,11 +49,11 @@ document.addEventListener("visibilitychange", () => {
});
window.addEventListener("beforeunload", () => {
init(); // Reset state when the page is about to be unloaded
init();
});
init(); // Call init to initialize the countdown when the page loads
init();
function redirect() {
window.location.href = redirectUrl; // Redirect to the full URL
window.location.href = redirectUrl;
}