File size: 2,729 Bytes
52dd20d 0d9b14b 8b5f9f3 0d9b14b 8508261 0d9b14b 8508261 52dd20d 8508261 52dd20d 8508261 52dd20d 8b5f9f3 52dd20d 8b5f9f3 52dd20d 8508261 52dd20d 8508261 52dd20d 8508261 8b5f9f3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
// Countdown to July 12, 2027
function updateCountdown() {
const targetDate = new Date('July 12, 2027 00:00:00').getTime();
const now = new Date().getTime();
const distance = targetDate - now;
if (distance < 0) {
document.getElementById('countdown-days').textContent = '00';
document.getElementById('countdown-hours').textContent = '00';
document.getElementById('countdown-minutes').textContent = '00';
document.getElementById('countdown-seconds').textContent = '00';
return;
}
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById('countdown-days').textContent = days.toString().padStart(2, '0');
document.getElementById('countdown-hours').textContent = hours.toString().padStart(2, '0');
document.getElementById('countdown-minutes').textContent = minutes.toString().padStart(2, '0');
document.getElementById('countdown-seconds').textContent = seconds.toString().padStart(2, '0');
}
document.addEventListener('DOMContentLoaded', () => {
// Update countdown every second
updateCountdown();
setInterval(updateCountdown, 1000);
// Video optimization
const video = document.querySelector('video');
if (video) {
// Preload entire video
video.preload = 'auto';
video.autoplay = false;
video.muted = true; // Keep muted for user-initiated playback
// Load video when page is ready
video.load();
// Store if video has been played to prevent reloading
let hasPlayed = false;
video.addEventListener('play', () => {
hasPlayed = true;
});
// Handle buffering - don't reload if already played
video.addEventListener('waiting', () => {
if (!hasPlayed) {
video.load();
}
});
// Handle errors
video.addEventListener('error', () => {
if (!hasPlayed) {
video.load();
}
});
}
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
});
// Feather icons replacement for dynamic content
document.addEventListener('DOMContentLoaded', () => {
feather.replace();
}); |