mirror of
https://github.com/hnasheralneam/hnasheralneam.github.io.git
synced 2025-06-07 05:44:15 -04:00
Put navbar on bottom for mobile, carousel takes full width on mobile, double click for next carousel slide, slow project carousel
This commit is contained in:
parent
ebb8568ca1
commit
3b02e5258c
3 changed files with 54 additions and 4 deletions
|
@ -119,6 +119,17 @@ document.querySelector(".carousel").addEventListener("click", (event) => {
|
|||
}
|
||||
});
|
||||
|
||||
document.querySelector(".carousel").addEventListener("dblclick", (event) => {
|
||||
console.log("hi")
|
||||
if (event.target.parentElement.parentElement.classList.contains("active")) {
|
||||
if ((Date.now() - lastChange) < 500) return;
|
||||
nextSlide();
|
||||
resetCarouselLoop();
|
||||
lastChange = Date.now();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function nextSlide() {
|
||||
activeIndex = (activeIndex + 1) % items.length;
|
||||
updateCarousel();
|
||||
|
@ -130,10 +141,10 @@ function lastSlide() {
|
|||
}
|
||||
|
||||
updateCarousel();
|
||||
carouselLoop = setInterval(nextSlide, 2000);
|
||||
carouselLoop = setInterval(nextSlide, 4000);
|
||||
|
||||
function resetCarouselLoop() {
|
||||
lastChange = Date.now();
|
||||
clearInterval(carouselLoop);
|
||||
carouselLoop = setInterval(nextSlide, 2000);
|
||||
carouselLoop = setInterval(nextSlide, 4000);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue