diff --git a/app/page.js b/app/page.js index 7f25993..b126d2d 100644 --- a/app/page.js +++ b/app/page.js @@ -17,13 +17,20 @@ import News from "@/components/sections/home1/News" import Funfacts from "@/components/sections/home1/Funfacts" import MobileServices from "@/components/sections/home/MobileServicesSection" import MobileFeatureCard from "@/components/sections/home/MobileFeatureCard" +import MobileBanner from "@/components/sections/home2/MobileBanner" export default function Home() { return ( <> - +
+ +
+ +
+ +
{/* */} {/* */} @@ -36,8 +43,8 @@ export default function Home() {
- - + + diff --git a/components/sections/home/ServicesSection.js b/components/sections/home/ServicesSection.js index e299b5a..afad8f5 100644 --- a/components/sections/home/ServicesSection.js +++ b/components/sections/home/ServicesSection.js @@ -4,15 +4,7 @@ import React from 'react'; export default function ServicesSection() { return ( - //
-
+
diff --git a/components/sections/home2/Banner.js b/components/sections/home2/Banner.js index 72ddb4b..17d3878 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: 8000, + delay: 5000, disableOnInteraction: false, }, loop: true, @@ -158,10 +158,9 @@ export default function Banner() {
{slide.upperText} - +

{slide.title} {slide.titleSpan} {slide.titleEnd}

- +

{slide.subtitle}

- +

{slide.description}

- +
{slide.buttonText} diff --git a/components/sections/home2/MobileBanner.js b/components/sections/home2/MobileBanner.js new file mode 100644 index 0000000..4fd23e5 --- /dev/null +++ b/components/sections/home2/MobileBanner.js @@ -0,0 +1,178 @@ +'use client' +import React, { useState, useEffect } from 'react'; +import Link from "next/link"; +import { Autoplay, Navigation, Pagination } from "swiper/modules"; +import { Swiper, SwiperSlide } from "swiper/react"; +import { motion, AnimatePresence } from "framer-motion"; + +import "swiper/css"; +import "swiper/css/navigation"; +import "swiper/css/pagination"; + +const swiperOptions = { + modules: [Autoplay, Pagination, Navigation], + slidesPerView: 1, + spaceBetween: 0, + autoplay: { + delay: 5000, + disableOnInteraction: false, + }, + loop: true, + navigation: { + nextEl: '.h1n', + prevEl: '.h1p', + }, + pagination: { + el: '.swiper-pagination', + clickable: true, + }, +}; + +const variants = { + topToBottom: { initial: { y: '-100vh', opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: '100vh', opacity: 0 } }, + bottomToTop: { initial: { y: '100vh', opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: '-100vh', opacity: 0 } }, + leftToRight: { initial: { x: '-100vw', opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: '100vw', opacity: 0 } }, + rightToLeft: { initial: { x: '100vw', opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: '-100vw', opacity: 0 } }, +}; + +const transition = { type: "tween", ease: [0.4, 0.0, 0.2, 1], duration: 1.2 }; + +export default function MobileBanner() { + const [activeIndex, setActiveIndex] = useState(0); + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const handleResize = () => setIsMobile(window.innerWidth <= 768); + handleResize(); + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); + + const slides = [ + { + id: 0, + variant: 'topToBottom', + bgImage: '/assets/images/banner/mobile-banner/banner-1.webp', + hideContent: true + }, + { + id: 1, + variant: 'bottomToTop', + bgImage: '/assets/images/banner/mobile-banner/banner-2.webp', + upperText: 'Compassionate Care, Delivered with Expertise', + title: 'Healing Touch,', + titleSpan: 'Fresh', + titleEnd: 'Inner Strength', + subtitle: 'Expert Hand Massage Techniques for Relief', + description: 'Experience targeted hand massage therapy to ease tension and promote healing, delivered by experienced therapists focused on your comfort and well-being.', + buttonText: 'Schedule a Massage', + buttonLink: '/contact', + contentStyle: 'with-background' + }, + { + id: 2, + variant: 'leftToRight', + bgImage: '/assets/images/banner/mobile-banner/banner-3.webp', + upperText: 'Your Path to Complete Wellness Starts Here', + title: 'Local Physio', + titleSpan: 'Experts', + titleEnd: 'Near You', + subtitle: 'Physiotherapy Etobicoke & Rehab Care.', + description: 'Offering comprehensive physiotherapy and rehabilitation services in Etobicoke to support your wellness journey and help restore your strength efficiently.', + buttonText: 'Explore Our Service', + buttonLink: '/etobicoke-treatment-service', + contentStyle: 'with-background' + }, + { + id: 3, + variant: 'rightToLeft', + bgImage: '/assets/images/banner/mobile-banner/banner-4.webp', + upperText: 'Healing Hands, Caring Hearts in Action', + title: 'Wellness', + titleSpan: 'by the', + titleEnd: 'Waterfront', + subtitle: 'Waterfront Physio and Rehab Services.', + description: 'Find peace and true healing with our specialized waterfront physio and rehab programs carefully designed for lasting wellness and a better quality of life.', + buttonText: 'Visit Our Location', + buttonLink: '/contact', + contentStyle: 'with-background' + } + ]; + + if (!isMobile) return null; + + return ( +
+ setActiveIndex(swiper.realIndex || 0)} + onSlideChange={(swiper) => setActiveIndex(swiper.realIndex || 0)} + > + {slides.map((slide, index) => ( + + + {activeIndex === index && ( + +
+ +
+ {!slide.hideContent && ( +
+ {slide.upperText} +

{slide.title} {slide.titleSpan} {slide.titleEnd}

+

{slide.subtitle}

+

{slide.description}

+
+ + {slide.buttonText} + +
+
+ )} +
+ +
+ )} +
+
+ ))} +
+
+ ); +}; diff --git a/public/assets/images/banner/mobile-banner/banner-1.webp b/public/assets/images/banner/mobile-banner/banner-1.webp new file mode 100644 index 0000000..31e2b89 Binary files /dev/null and b/public/assets/images/banner/mobile-banner/banner-1.webp differ diff --git a/public/assets/images/banner/mobile-banner/banner-2.webp b/public/assets/images/banner/mobile-banner/banner-2.webp new file mode 100644 index 0000000..40dc791 Binary files /dev/null and b/public/assets/images/banner/mobile-banner/banner-2.webp differ diff --git a/public/assets/images/banner/mobile-banner/banner-3.webp b/public/assets/images/banner/mobile-banner/banner-3.webp new file mode 100644 index 0000000..4fc38c5 Binary files /dev/null and b/public/assets/images/banner/mobile-banner/banner-3.webp differ diff --git a/public/assets/images/banner/mobile-banner/banner-4.webp b/public/assets/images/banner/mobile-banner/banner-4.webp new file mode 100644 index 0000000..57597c4 Binary files /dev/null and b/public/assets/images/banner/mobile-banner/banner-4.webp differ