TruePower2020's picture
вставь счетчик обратного отсчета до даты 12 июля 2027 года с надписью "BALKA WALLEY FESTIVAL 2027" стиль посмотри на прикрепленной картинке ref.JPG
0d9b14b verified
// 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();
});