Spaces:
Running
Running
File size: 1,933 Bytes
36a4617 |
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 |
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Countdown timer to festival
function updateCountdown() {
const festivalDate = new Date('July 15, 2023 16:00:00').getTime();
const now = new Date().getTime();
const distance = festivalDate - now;
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').innerHTML = `
<div class="countdown-item">
<span class="countdown-number">${days}</span>
<span class="countdown-label">Days</span>
</div>
<div class="countdown-item">
<span class="countdown-number">${hours}</span>
<span class="countdown-label">Hours</span>
</div>
<div class="countdown-item">
<span class="countdown-number">${minutes}</span>
<span class="countdown-label">Minutes</span>
</div>
<div class="countdown-item">
<span class="countdown-number">${seconds}</span>
<span class="countdown-label">Seconds</span>
</div>
`;
}
// Initialize countdown
updateCountdown();
setInterval(updateCountdown, 1000);
// Ticket hover effect
document.querySelectorAll('.ticket-card').forEach(card => {
card.addEventListener('mouseenter', () => {
card.style.transform = 'translateY(-10px)';
});
card.addEventListener('mouseleave', () => {
card.style.transform = 'translateY(0)';
});
}); |