Skip to content

Commit 1e47fec

Browse files
authored
Implement countdown timer in index.html
Added countdown timer logic to the HTML file.
1 parent 1b29bcf commit 1e47fec

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

index.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ <h2 class="text-4xl md:text-5xl font-extrabold mb-4 text-slate-900 leading-tight
111111
<span class="absolute -top-2 -right-2 h-4 w-4 bg-red-500 rounded-full pulse-dot"></span>
112112
<i class="fas fa-video mr-2"></i> Join Weekly Call
113113
</a>
114+
<!-- Countdown Section -->
114115
<div class="text-xs font-bold text-red-600 mt-2 flex items-center gap-1">
115-
<i class="fas fa-clock"></i> Starts in 30 mins • <span class="underline decoration-dotted cursor-help" title="Limited time offer">Free Limited Offer</span>
116+
<i class="fas fa-clock animate-pulse"></i> Free for next <span id="countdown" class="font-mono text-sm ml-1 bg-red-50 px-1 rounded text-red-700 border border-red-100">30:00</span>
116117
</div>
117118
</div>
118119
</div>
@@ -193,6 +194,29 @@ <h4 class="text-white font-semibold text-lg mb-2">Decoding Data Science</h4>
193194

194195
<!-- JavaScript Data & Logic -->
195196
<script>
197+
// Countdown Timer Logic
198+
function startCountdown(durationInMinutes) {
199+
let timer = durationInMinutes * 60;
200+
const display = document.querySelector('#countdown');
201+
202+
const interval = setInterval(function () {
203+
const minutes = parseInt(timer / 60, 10);
204+
const seconds = parseInt(timer % 60, 10);
205+
206+
display.textContent =
207+
(minutes < 10 ? "0" + minutes : minutes) + ":" +
208+
(seconds < 10 ? "0" + seconds : seconds);
209+
210+
if (--timer < 0) {
211+
// Reset loop for demo purposes (or handle expiry)
212+
timer = durationInMinutes * 60;
213+
}
214+
}, 1000);
215+
}
216+
217+
// Start countdown on load (30 minutes)
218+
startCountdown(30);
219+
196220
// Social Share Logic
197221
function shareSocial(platform) {
198222
const url = window.location.href;

0 commit comments

Comments
 (0)