Skip to content

Commit

Permalink
Updated the delay and css
Browse files Browse the repository at this point in the history
  • Loading branch information
teshukatepalli1 committed Nov 10, 2023
1 parent d28421f commit f434adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/hero-carousel/hero-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ export default function decorate(block) {
if (deltaX > 50 && currentIndex > 0) {
goToSlide(currentIndex - 1);
clearInterval(interval);
interval = setInterval(showNextSlide, 70000);
interval = setInterval(showNextSlide, 7000);
} else if (deltaX < -50 && currentIndex < slideCount - 1) {
goToSlide(currentIndex + 1);
clearInterval(interval);
interval = setInterval(showNextSlide, 70000);
interval = setInterval(showNextSlide, 7000);
}
});

// Start the automatic slide transition
interval = setInterval(showNextSlide, 70000); // Change slide every 7 seconds
interval = setInterval(showNextSlide, 7000); // Change slide every 7 seconds

// Pause the automatic transition when a user hovers over the carousel
block.addEventListener('mouseenter', () => {
Expand All @@ -89,6 +89,6 @@ export default function decorate(block) {

// Resume the automatic transition when a user leaves the carousel
block.addEventListener('mouseleave', () => {
interval = setInterval(showNextSlide, 70000);
interval = setInterval(showNextSlide, 7000);
});
}
1 change: 1 addition & 0 deletions styles/Typo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ form.hs-form .hs-input[type="checkbox"] {
.hero-carousel-slide {
position: relative;
animation: fade-out 0.3s ease-in-out;
display: none;
}

.hero-carousel-slide > div:nth-child(1) picture > img {
Expand Down

0 comments on commit f434adf

Please sign in to comment.