diff --git a/components/landing/BannerHumas.tsx b/components/landing/BannerHumas.tsx index 7d7a663..68e3bf7 100644 --- a/components/landing/BannerHumas.tsx +++ b/components/landing/BannerHumas.tsx @@ -1,21 +1,76 @@ +"use client"; import { useTranslations } from "next-intl"; -import React from "react"; +import Image from "next/image"; +import React, { useEffect, useState } from "react"; +import { ChevronLeftIcon, ChevronRightIcon } from "../icons"; + +const images = [ + "/landing-1.jpg", + "/landing-2.jpg", + "/landing-3.jpg", + "/landing-4.jpg", +]; export default function BannerHumas() { const t = useTranslations("Banner"); + const [currentIndex, setCurrentIndex] = useState(0); + const [resetTimer, setResetTimer] = useState(0); + + useEffect(() => { + const interval = setInterval(() => { + setCurrentIndex((prevIndex) => (prevIndex + 1) % images.length); + }, 25000); + + return () => clearInterval(interval); + }, [resetTimer]); + const nextImage = () => { + setCurrentIndex((prevIndex) => (prevIndex + 1) % images.length); + setResetTimer((prev) => prev + 1); + }; + + const prevImage = () => { + setCurrentIndex( + (prevIndex) => (prevIndex - 1 + images.length) % images.length + ); + setResetTimer((prev) => prev + 1); + }; + return ( -
- humasbanner +
+
+ {images.map((img, index) => ( +
+ {`humasbanner-${index}`} +
+ ))} +

{t("jumbotron")}

{`"${t("phrase")}"`}

+ +
); } diff --git a/public/landing-1.jpg b/public/landing-1.jpg new file mode 100644 index 0000000..82b5e9c Binary files /dev/null and b/public/landing-1.jpg differ diff --git a/public/landing-2.jpg b/public/landing-2.jpg new file mode 100644 index 0000000..69a2393 Binary files /dev/null and b/public/landing-2.jpg differ diff --git a/public/landing-3.jpg b/public/landing-3.jpg new file mode 100644 index 0000000..f33badb Binary files /dev/null and b/public/landing-3.jpg differ diff --git a/public/landing-4.jpg b/public/landing-4.jpg new file mode 100644 index 0000000..9fb5905 Binary files /dev/null and b/public/landing-4.jpg differ