

window.addEventListener('scroll', function() {
    const element = document.getElementById('header'); 
    const classesToRemove = ['bg-gradient-to-b', 'from-black']; 
  
    if (window.scrollY >= 50) {
      classesToRemove.forEach(className => {
        element.classList.remove(className);
        element.classList.add('bg-black');
      });
    } else {
      classesToRemove.forEach(className => {
        element.classList.add(className);
        element.classList.remove('bg-black');
      });
    }
  });




  let  timer2=document.querySelectorAll('.timer');
timer2.forEach(timer=>{
    const spans=timer.querySelectorAll('span');
    let hours=parseInt(spans[4].textContent)
    let minutes=parseInt(spans[2].textContent)
    let seconds=parseInt(spans[0].textContent)
    let intervalId=setInterval(()=>{
        seconds--;
        if(seconds<0){
            seconds=59;
            minutes--; 
            if(minutes<0){
                minutes=59;
                hours--;
                if(hours<0){
                    hours=0
                    minutes=0
                    seconds=0
                    clearInterval(intervalId);
                }
            }
        }
        spans[4].textContent=String(hours).padStart(2,"0")
        spans[2].textContent=String(minutes).padStart(2,"0")
        spans[0].textContent=String(seconds).padStart(2,"0")
    },1000)
})




