diff --git a/components/sections/home2/MobileBanner.js b/components/sections/home2/MobileBanner.js index 64c80bb..159dcab 100644 --- a/components/sections/home2/MobileBanner.js +++ b/components/sections/home2/MobileBanner.js @@ -14,15 +14,34 @@ export default function MobileBanner() { return () => window.removeEventListener("resize", handleResize); }, []); - const [sliderRef] = useKeenSlider({ - loop: true, - autoplay: { - delay: 4000, - pauseOnMouseEnter: true, - stopOnInteraction: false, + // ✅ Autoplay plugin added here + const autoplay = (slider) => { + let timeout; + const delay = 4000; + + function clearNextTimeout() { + clearTimeout(timeout); + } + function nextTimeout() { + clearTimeout(timeout); + timeout = setTimeout(() => { + slider.next(); + }, delay); + } + + slider.on("created", nextTimeout); + slider.on("dragStarted", clearNextTimeout); + slider.on("animationEnded", nextTimeout); + slider.on("updated", nextTimeout); + }; + + const [sliderRef] = useKeenSlider( + { + loop: true, + slides: { perView: 1, spacing: 0 }, }, - slides: { perView: 1, spacing: 0 }, - }); + [autoplay] // ✅ autoplay fixed here + ); const slides = [ { @@ -104,13 +123,23 @@ export default function MobileBanner() { >
{slide.upperText} -

+

{slide.title}

{/* {slide.subtitle &&

{slide.subtitle}

} */} {/*

{slide.description}

*/}
- + {slide.buttonText}
diff --git a/public/assets/css/module-css/about.css b/public/assets/css/module-css/about.css index 97e1e91..0cef396 100644 --- a/public/assets/css/module-css/about.css +++ b/public/assets/css/module-css/about.css @@ -499,7 +499,7 @@ /** RESPONSIVE-CSS **/ -/* @media only screen and (max-width: 1024px){ +@media only screen and (max-width: 1024px){ .image_block_one .image-box .text-box{ left: 0px; @@ -759,7 +759,7 @@ top: 309px; } -} */ +}