function startCountdownTimer(ids) { const countdownTime = 2 * 60 * 60; // 10 hours in seconds let endTime = localStorage.getItem('endTime'); function setNewEndTime() { endTime = new Date().getTime() + countdownTime * 1000; localStorage.setItem('endTime', endTime); } if (!endTime || endTime < new Date().getTime()) { setNewEndTime(); } else { endTime = parseInt(endTime, 2); } function updateCountdown() { const now = new Date().getTime(); let distance = endTime - now; if (distance < 0) { setNewEndTime(); distance = countdownTime * 1000; } 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(ids.hours).innerText = String(hours).padStart(2, '0'); document.getElementById(ids.minutes).innerText = String(minutes).padStart(2, '0'); document.getElementById(ids.seconds).innerText = String(seconds).padStart(2, '0'); } updateCountdown(); // Initial call const timerInterval = setInterval(updateCountdown, 1000); } // Example usage with different IDs const countdownIds1 = { hours: 'hours', minutes: 'minutes', seconds: 'seconds' }; startCountdownTimer(countdownIds1); const countdownIds2 = { hours: 'hours2', minutes: 'minutes2', seconds: 'seconds2' }; startCountdownTimer(countdownIds2); let counter = 69388; function incrementCounter() { counter++; document.getElementById('counter-increase').innerText = counter; } setInterval(incrementCounter, 1000); var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc[i].addEventListener("click", function() { this.classList.toggle("active"); var panel = this.nextElementSibling; var caretRight = this.querySelector('.fa-caret-right'); var sortDown = this.querySelector('.fa-sort-down'); if (panel.style.maxHeight) { panel.style.maxHeight = null; panel.style.padding = '0 18px'; caretRight.style.display = 'inline'; sortDown.style.display = 'none'; } else { panel.style.maxHeight = panel.scrollHeight + "px"; panel.style.padding = '18px 18px'; caretRight.style.display = 'none'; sortDown.style.display = 'inline'; } }); } window.addEventListener('scroll', function() { const nav = document.querySelector('.nav_section'); if (window.scrollY >= window.innerHeight) { nav.classList.add('scrolled'); } else { nav.classList.remove('scrolled'); } }); document.addEventListener('keydown', function(event) { if (event.key === 'F12' || (event.ctrlKey && event.shiftKey && event.key === 'I')) { event.preventDefault(); } });