© 2025 Abraham Shenk. All rights reserved.
document.getElementById(“hb”).addEventListener(“click”,function(){document.getElementById(“nl”).classList.toggle(“open”);}); var slides=document.querySelectorAll(‘.slide’); var dots=document.querySelectorAll(‘.dot’); var bar=document.getElementById(‘bar’); var car=document.getElementById(‘car’); var cur=0,TOTAL=11,timer,hideTimer; function goTo(idx){ slides[cur].classList.remove(‘active’); dots[cur].classList.remove(‘active’); cur=(idx+TOTAL)%TOTAL; slides[cur].classList.add(‘active’); dots[cur].classList.add(‘active’); resetBar(); } function next(){goTo(cur+1);} function prev(){goTo(cur-1);} function resetBar(){ bar.style.transition=’none’;bar.style.width=’0%’; requestAnimationFrame(function(){ requestAnimationFrame(function(){ bar.style.transition=’width 5s linear’;bar.style.width=’100%’; }); }); clearInterval(timer); timer=setInterval(next,5000); } function showUI(){ car.classList.add(‘active-ui’); clearTimeout(hideTimer); hideTimer=setTimeout(function(){car.classList.remove(‘active-ui’);},2500); } car.addEventListener(‘mousemove’,showUI); var tx=0; car.addEventListener(‘touchstart’,function(e){tx=e.touches[0].clientX;},{passive:true}); car.addEventListener(‘touchend’,function(e){ var dx=e.changedTouches[0].clientX-tx; if(Math.abs(dx)>40){dx<0?next():prev();} }); document.addEventListener('keydown',function(e){if(e.key==='ArrowRight')next();if(e.key==='ArrowLeft')prev();}); resetBar(); (function(){var nav=document.querySelector(‘.nav’);window.addEventListener(‘scroll’,function(){if(window.scrollY>40){nav.style.transform=’translateY(-100%)’;}else{nav.style.transform=’translateY(0)’;}});document.addEventListener(‘mousemove’,function(e){if(e.clientY<80){nav.style.transform='translateY(0)';}});})();