From 38ee0d866ccc40452ea7beb1e09a0972e392d8bf Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Tue, 23 Sep 2025 12:58:17 -0400 Subject: [PATCH] updated the banner order and transition changes --- components/sections/home2/Banner.js | 302 +++++++++++++++------------- next.config.js | 2 +- 2 files changed, 164 insertions(+), 140 deletions(-) diff --git a/components/sections/home2/Banner.js b/components/sections/home2/Banner.js index 9ade556..55670dc 100644 --- a/components/sections/home2/Banner.js +++ b/components/sections/home2/Banner.js @@ -14,7 +14,7 @@ const swiperOptions = { slidesPerView: 1, spaceBetween: 0, autoplay: { - delay: 5000, + delay: 2000, disableOnInteraction: false, pauseOnMouseEnter: true, // stops on hover for smooth UX }, @@ -49,9 +49,48 @@ const variants = { }, rightToLeft: { initial: { x: '100vw', opacity: 0 }, - animate: { x: 0, opacity: 1 }, - exit: { x: '-100vw', opacity: 0 } + animate: { + x: 0, + opacity: 1, + transition: { + duration: 0.8, // adjust speed + ease: "easeInOut" // try "easeOut", "easeIn", or custom [0.4, 0, 0.2, 1] + } }, + exit: { + x: "-100vw", + opacity: 0, + transition: { + duration: 0.6, + ease: "easeInOut" + } + } + }, +}; +const revealVariants = { + hidden: { + scaleX: 0, + opacity: 0, + originX: 0, // same as transform-origin: 0% 50% + }, + visible: { + scaleX: 1, + opacity: 1, + originX: 0, + transition: { + duration: 0.8, + ease: "easeInOut" + } + }, + exit: { + scaleX: 0, + opacity: 0, + originX: 0, + transition: { + duration: 0.6, + ease: "easeInOut" + } + } }; const transition = { @@ -72,145 +111,130 @@ export default function Banner() { return (
- setActiveIndex(swiper.realIndex || 0)} - onSlideChange={handleSlideChange} - > - {/* Slide 1 */} - - - {activeIndex === 0 && ( - -
-
-
-
- Renew your -

STRENGTH

-

• Physiotherapy • Sports Therapy • Injury Prevention

-
- - Book Your Appointment - -
-
-
-
- )} -
-
+ setActiveIndex(swiper.realIndex || 0)} + onSlideChange={handleSlideChange} +> - {/* Slide 2 */} - - - {activeIndex === 1 && ( - -
-
-
-
- Restore your -

Mobility

-

• Pain Relief • Active Care • Long-Term Result

-
- - Schedule a Massage - -
-
-
-
- )} -
-
+ {/* ✅ 4th slide moved to 1st position */} + + + {activeIndex === 0 && ( + +
+
+
+
+ Begin your +

Recovery

+

• Rehab • Strength Training • Personalized Care

+
+ + Visit Our Location + +
+
+
+
+ )} +
+
- {/* Slide 3 */} - - - {activeIndex === 2 && ( - -
-
-
-
- Reclaim your -

Wellnes

-

• Pain Relief • Strength Training • Active Care

-
- - Explore Our Service - -
-
-
-
- )} -
-
+ {/* ✅ 1st slide moved to 2nd position */} + + + {activeIndex === 1 && ( + +
+
+
+
+ Build Your Strength & +

Endurance

+

• Physiotherapy • Sports Therapy • Injury Prevention

+
+ + Book Your Appointment + +
+
+
+
+ )} +
+
- {/* Slide 4 */} - - - {activeIndex === 3 && ( - -
-
-
-
- Begin your -

Recovery

-

• Rehab • Strength Training • Personalized Care

-
- - Visit Our Location - -
-
-
-
- )} -
-
+ {/* ✅ existing 3rd slide remains as 3rd */} + + + {activeIndex === 2 && ( + +
+
+
+
+ Regain your +

Flexiblity and Balance

+

• Pain Relief • Strength Training • Active Care

+
+ + Explore Our Service + +
+
+
+
+ )} +
+
+ + {/* ✅ 2nd slide moved to 4th position */} + + + {activeIndex === 3 && ( + +
+
+
+
+ Build your Core +

Performance

+

• Pain Relief • Active Care • Long-Term Result

+
+ + Schedule a Massage + +
+
+
+
+ )} +
+
+ +
-
); -} +} \ No newline at end of file diff --git a/next.config.js b/next.config.js index ded3b24..38da262 100644 --- a/next.config.js +++ b/next.config.js @@ -7,4 +7,4 @@ const nextConfig = { }, }; -export default nextConfig; +module.exports = nextConfig;