From d933855ef5af646a16531fccd53d5697908494a0 Mon Sep 17 00:00:00 2001 From: Krish-2118 Date: Sun, 3 Aug 2025 15:21:58 +0530 Subject: [PATCH 1/7] : data TeamPage.jsx --- src/pages/team/TeamPage.jsx | 58 +++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/src/pages/team/TeamPage.jsx b/src/pages/team/TeamPage.jsx index 83d9795..54b5793 100644 --- a/src/pages/team/TeamPage.jsx +++ b/src/pages/team/TeamPage.jsx @@ -4,14 +4,17 @@ import teamMembers from "../../config/teammate"; const TeamPage = () => { const [activeTeam, setActiveTeam] = useState("All"); - - const teams = ["All", "Team 1", "Team 2", "Team 3", "Team 4"]; + + const teams = ["All", "Executive Body","Team Bluebird", "Team Bluestreak", "Team Blueprint"]; const filteredMembers = - activeTeam === "All" - ? teamMembers - : teamMembers.filter((member) => member.team === activeTeam); - + activeTeam === "All" + ? Array.from( + new Map( + teamMembers.map((m) => [m.name, m]) + ).values() + ) + : teamMembers.filter((member) => member.team === activeTeam); return (
@@ -19,7 +22,7 @@ const TeamPage = () => { Meet Our Team

- Lorem ipsum dolor sit amet, consectetur adipiscing elit... +

@@ -28,7 +31,7 @@ const TeamPage = () => { ))} - +
+ {activeTeam === "Team Bluestreak" && ( +

+ Bluestreak, a team within ASME at NIT Rourkela, is a dedicated team focused on research, + analysis, and innovation. They specialize in designing human-powered vehicles from scratch, + incorporating indigenous elements. Bluestreak actively participates in the eHPV competition at ASME Efest, + showcasing their commitment to pushing the boundaries of human-powered vehicle design and contributing to the advancement + of sustainable transportation solutions. +

+ )} + {activeTeam === "Team Bluebird" && ( +

+ Bluebird, a team from ASME NIT Rourkela, specializes in CAD modeling and coding for virtual competitions. + Their expertise extends to designing vehicles for diverse challenges, including autonomous vehicle competitions, + lunar lander simulations, and ocean cleanup missions. Through innovation and technical prowess, Team + Bluebird consistently participates in and excels at a variety of virtual events, showcasing their commitment + to engineering excellence and problem-solving in the digital realm. +

+ )} + {activeTeam === "Team Blueprint" && ( +

+ Team Blueprint, a team of ASME NIT Rourkela, engages in research, innovation, and design. They utilize + CAD software to create diverse models, subsequently manufacturing them through 3D printing technology + . The team actively participates in the IAM3D competition as part of ASME Efest, showcasing their skills + and expertise in engineering and design within the ASME community +

+ )} +
+ {filteredMembers.map((member, index) => (
@@ -53,9 +84,12 @@ const TeamPage = () => {
-

{member.name || "Full name"}

-

- {member.title || "Job title"} +

{member.name || "Full name"}

+

+ {member.title || ""} +

+

+ {member.team || ""}

Date: Sun, 3 Aug 2025 15:23:24 +0530 Subject: [PATCH 2/7] responsiveness of Team.jsx --- src/components/Team.jsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/Team.jsx b/src/components/Team.jsx index 234b345..3b72c09 100644 --- a/src/components/Team.jsx +++ b/src/components/Team.jsx @@ -8,7 +8,6 @@ const TeamSlider = () => { const [visibleCount, setVisibleCount] = useState(1); const getVisibleCount = () => { - if (window.innerWidth < 640) return 1; if (window.innerWidth < 768) return 1; if (window.innerWidth < 1024) return 2; if (window.innerWidth < 1280) return 3; @@ -45,7 +44,7 @@ const TeamSlider = () => {

Our team

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. +

@@ -75,22 +73,28 @@ const TeamSlider = () => { transform: `translateX(-${currentIndex * (100 / visibleCount)}%)`, }} > - {Array.from(new Map(teamMembers.map((m) => [m.name, m])).values()).map((member, index) => ( -
- + {Array.from( + new Map(teamMembers.map((m) => [m.name, m])).values(), + ).map((member, index) => ( +
{member.name}
-

{member.name}

-

{member.title}

-

{member.team}

+

+ {member.name} +

+

+ {member.title} +

+

{member.team}

{member.description}

diff --git a/src/config/teammate.js b/src/config/teammate.js index adbcf60..ad393fa 100644 --- a/src/config/teammate.js +++ b/src/config/teammate.js @@ -6,7 +6,7 @@ const teamMembers = [ img: "https://res.cloudinary.com/dm406z4pf/image/upload/v1754119368/Photo_from_Soumya_Mohanty_yv6fsd.jpg", description: "", linkedin: "https://www.linkedin.com/in/soumya-mohanty-me0409", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Pratyush Prateek Dash", @@ -15,7 +15,7 @@ const teamMembers = [ description: "", team: "Executive Body", linkedin: "https://www.linkedin.com/in/pratyush-prateek-dash-b8298128a/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Sahil Singh", @@ -24,34 +24,34 @@ const teamMembers = [ description: "", team: "Executive Body", linkedin: "https://linkedin.com/in/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, - { + { name: "Gurudutta Sutar", title: "Treasurer", img: "https://res.cloudinary.com/dm406z4pf/image/upload/v1754119361/Gurudutta_taaaxv.jpg", description: "", team: "Executive Body", linkedin: "https://linkedin.com/in/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, - { + { name: "Samidha Behera", title: "Sponsorship Head", img: "https://res.cloudinary.com/dm406z4pf/image/upload/v1754119375/samidha_kxwkkb.jpg", description: "", team: "Executive Body", linkedin: "https://www.linkedin.com/in/samidha-behera-09297828a/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, - { + { name: "Nikhil Kumar Dalai", title: "PR Head", img: "https://res.cloudinary.com/dm406z4pf/image/upload/v1754122159/nikhil_co92yf.jpg", description: "", team: "Executive Body", linkedin: "https://www.linkedin.com/in/nikhil-dalai/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Aaditya Sahu", @@ -60,7 +60,7 @@ const teamMembers = [ team: "Team Bluestreak", description: "", linkedin: "https://www.linkedin.com/in/aaditya-sahoo-9605a4279/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Komal Hitesh", @@ -69,7 +69,7 @@ const teamMembers = [ description: "", team: "Team Bluestreak", linkedin: "https://www.linkedin.com/in/komal-hitesh-gude-a1402830a/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Somanchi Shanmukh", @@ -78,7 +78,6 @@ const teamMembers = [ description: "", team: "Team Bluestreak", linkedin: "https://www.linkedin.com/in/shanmukhsomanchi/", - }, { name: "Aryan Dongare", @@ -87,7 +86,7 @@ const teamMembers = [ description: "", team: "Team Bluestreak", linkedin: "https://www.linkedin.com/in/aryan-dongare-82aa40325/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Mayukh Thakuria", @@ -96,7 +95,7 @@ const teamMembers = [ description: "", team: "Team Bluestreak", linkedin: "https://www.linkedin.com/in/mayukh-thakuria-509ab8306/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Smruti Satabdi Prusty", @@ -105,7 +104,7 @@ const teamMembers = [ description: "", team: "Team Bluestreak", linkedin: "https://www.linkedin.com/in/smruti-satabdi-prusty-a35a3a2a2/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Chittaranjan Behera", @@ -114,7 +113,7 @@ const teamMembers = [ description: "", team: "Team Blueprint", linkedin: "https://www.linkedin.com/in/chittaranjan-behera-012b64292/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Dharitri", @@ -123,7 +122,7 @@ const teamMembers = [ description: "", team: "Team Blueprint", linkedin: "https://www.linkedin.com/in/dharitri-pradhan-a92b98269/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Nikhil Raj Kiran Sahoo", @@ -132,7 +131,7 @@ const teamMembers = [ description: "", team: "Team Blueprint", linkedin: "https://www.linkedin.com/in/nikhil-rajkiran-sahoo-515397277/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Soaham Tripathy", @@ -141,7 +140,7 @@ const teamMembers = [ description: "", team: "Team Blueprint", linkedin: "https://www.linkedin.com/in/soaham-tripathy-223582336/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Soaham Tripathy", @@ -150,7 +149,7 @@ const teamMembers = [ description: "", team: "Team Bluebird", linkedin: "https://www.linkedin.com/in/soaham-tripathy-223582336/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, { name: "Dev Soni", @@ -159,9 +158,8 @@ const teamMembers = [ description: "", team: "Team Bluebird", linkedin: "https://www.linkedin.com/in/dev-soni-80020228a/", - twitter: "https://x.com/home" + twitter: "https://x.com/home", }, - ]; export default teamMembers; diff --git a/src/pages/team/TeamPage.jsx b/src/pages/team/TeamPage.jsx index 54b5793..378ceaf 100644 --- a/src/pages/team/TeamPage.jsx +++ b/src/pages/team/TeamPage.jsx @@ -4,26 +4,26 @@ import teamMembers from "../../config/teammate"; const TeamPage = () => { const [activeTeam, setActiveTeam] = useState("All"); - - const teams = ["All", "Executive Body","Team Bluebird", "Team Bluestreak", "Team Blueprint"]; + + const teams = [ + "All", + "Executive Body", + "Team Bluebird", + "Team Bluestreak", + "Team Blueprint", + ]; const filteredMembers = - activeTeam === "All" - ? Array.from( - new Map( - teamMembers.map((m) => [m.name, m]) - ).values() - ) - : teamMembers.filter((member) => member.team === activeTeam); + activeTeam === "All" + ? Array.from(new Map(teamMembers.map((m) => [m.name, m])).values()) + : teamMembers.filter((member) => member.team === activeTeam); return (

Meet Our Team

-

- -

+

@@ -43,34 +43,40 @@ const TeamPage = () => {
{activeTeam === "Team Bluestreak" && ( -

- Bluestreak, a team within ASME at NIT Rourkela, is a dedicated team focused on research, - analysis, and innovation. They specialize in designing human-powered vehicles from scratch, - incorporating indigenous elements. Bluestreak actively participates in the eHPV competition at ASME Efest, - showcasing their commitment to pushing the boundaries of human-powered vehicle design and contributing to the advancement - of sustainable transportation solutions. -

- )} - {activeTeam === "Team Bluebird" && ( -

- Bluebird, a team from ASME NIT Rourkela, specializes in CAD modeling and coding for virtual competitions. - Their expertise extends to designing vehicles for diverse challenges, including autonomous vehicle competitions, - lunar lander simulations, and ocean cleanup missions. Through innovation and technical prowess, Team - Bluebird consistently participates in and excels at a variety of virtual events, showcasing their commitment - to engineering excellence and problem-solving in the digital realm. -

- )} - {activeTeam === "Team Blueprint" && ( -

- Team Blueprint, a team of ASME NIT Rourkela, engages in research, innovation, and design. They utilize - CAD software to create diverse models, subsequently manufacturing them through 3D printing technology - . The team actively participates in the IAM3D competition as part of ASME Efest, showcasing their skills - and expertise in engineering and design within the ASME community -

- )} +

+ Bluestreak, a team within ASME at NIT Rourkela, is a dedicated team + focused on research, analysis, and innovation. They specialize in + designing human-powered vehicles from scratch, incorporating + indigenous elements. Bluestreak actively participates in the eHPV + competition at ASME Efest, showcasing their commitment to pushing + the boundaries of human-powered vehicle design and contributing to + the advancement of sustainable transportation solutions. +

+ )} + {activeTeam === "Team Bluebird" && ( +

+ Bluebird, a team from ASME NIT Rourkela, specializes in CAD modeling + and coding for virtual competitions. Their expertise extends to + designing vehicles for diverse challenges, including autonomous + vehicle competitions, lunar lander simulations, and ocean cleanup + missions. Through innovation and technical prowess, Team Bluebird + consistently participates in and excels at a variety of virtual + events, showcasing their commitment to engineering excellence and + problem-solving in the digital realm. +

+ )} + {activeTeam === "Team Blueprint" && ( +

+ Team Blueprint, a team of ASME NIT Rourkela, engages in research, + innovation, and design. They utilize CAD software to create diverse + models, subsequently manufacturing them through 3D printing + technology . The team actively participates in the IAM3D competition + as part of ASME Efest, showcasing their skills and expertise in + engineering and design within the ASME community +

+ )}
- {filteredMembers.map((member, index) => (
@@ -84,13 +90,11 @@ const TeamPage = () => {
-

{member.name || "Full name"}

-

- {member.title || ""} -

-

- {member.team || ""} -

+

+ {member.name || "Full name"} +

+

{member.title || ""}

+

{member.team || ""}

Date: Fri, 8 Aug 2025 00:11:12 +0530 Subject: [PATCH 5/7] Add Sponsors data --- src/config/sponsors.js | 53 +++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/src/config/sponsors.js b/src/config/sponsors.js index 2f95aee..4d555e2 100644 --- a/src/config/sponsors.js +++ b/src/config/sponsors.js @@ -1,46 +1,41 @@ // sponsors.js const sponsors = [ { - name: "Sponsor One", - image: "https://via.placeholder.com/200x100?text=Sponsor+1", - link: "https://sponsor1.com", + name: "NIT Rourkela Alumini ", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590523/Sponsor_5_jkviya.jpg", + link: "https://www.nitraa.org/", }, { - name: "Sponsor Two", - image: "https://via.placeholder.com/200x100?text=Sponsor+2", - link: "https://sponsor2.com", + name: "NALCO", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590523/Sponsor_4_c44gxu.jpg", + link: "https://nalcoindia.com/", }, { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", + name: "SOLID WORKS", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590497/Sponsors_2_p8nglm.jpg", + link: "https://www.solidworks.com/", }, { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", + name: "PHOENIX ROBOTIC", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590497/Sponsors_n6wktj.jpg", + link: "https://www.phoenixrobotic.com/", }, { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", + name: "ANSYS", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590497/Sponsors_3_a2nmqj.jpg", + link: "https://www.ansys.com/", }, { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", + name: "SAIL", + image: + "https://res.cloudinary.com/dm406z4pf/image/upload/v1754590497/Sponsor_6_bqcx5l.jpg", + link: "https://www.sail.co.in/", }, - { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", - }, - { - name: "Sponsor Three", - image: "https://via.placeholder.com/200x100?text=Sponsor+3", - link: "https://sponsor3.com", - }, - // Add more sponsors freely ]; export default sponsors; From fc44aaeba06becbe41f97cf39620537cc8f14507 Mon Sep 17 00:00:00 2001 From: Krish Agarwal Date: Sun, 10 Aug 2025 14:43:48 +0530 Subject: [PATCH 6/7] Routing to team button --- src/components/Team.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/Team.jsx b/src/components/Team.jsx index f6a3349..738ac87 100644 --- a/src/components/Team.jsx +++ b/src/components/Team.jsx @@ -2,11 +2,13 @@ import { useState, useEffect } from "react"; import teamMembers from "../config/teammate"; import { ArrowLeft, ArrowRight } from "lucide-react"; import { FaLinkedin, FaXTwitter } from "react-icons/fa6"; +import { useNavigate } from "react-router"; const TeamSlider = () => { const [currentIndex, setCurrentIndex] = useState(0); const [visibleCount, setVisibleCount] = useState(1); + const navigate = useNavigate(); const getVisibleCount = () => { if (window.innerWidth < 768) return 1; if (window.innerWidth < 1024) return 2; @@ -31,11 +33,12 @@ const TeamSlider = () => { const nextSlide = () => { const maxIndex = Math.max(0, teamMembers.length - visibleCount); - setCurrentIndex((prev) => Math.min(prev + visibleCount, maxIndex)); + setCurrentIndex((prev) => (prev >= maxIndex ? 0 : prev + visibleCount)); }; const prevSlide = () => { - setCurrentIndex((prev) => Math.max(prev - visibleCount, 0)); + const maxIndex = Math.max(0, teamMembers.length - visibleCount); + setCurrentIndex((prev) => (prev <= 0 ? maxIndex : prev - visibleCount)); }; return ( @@ -44,7 +47,13 @@ const TeamSlider = () => {

Our team

-
From 51863e4d0b2dd2b4444d8b09bec2c2d6bfff9503 Mon Sep 17 00:00:00 2001 From: Krish Agarwal Date: Sun, 10 Aug 2025 16:56:20 +0530 Subject: [PATCH 7/7] fix caraousel buttons --- src/components/Sponsor.jsx | 137 +++++++++++++------------ src/components/Team.jsx | 198 +++++++++++++++++++++---------------- 2 files changed, 191 insertions(+), 144 deletions(-) diff --git a/src/components/Sponsor.jsx b/src/components/Sponsor.jsx index fb986ad..158bc31 100644 --- a/src/components/Sponsor.jsx +++ b/src/components/Sponsor.jsx @@ -4,68 +4,84 @@ import sponsors from "../config/sponsors"; import "./sponsor.css"; const SponsorsSection = () => { - const scrollRef = useRef(null); - const [isHovered, setIsHovered] = useState(false); - const pageIndex = useRef(0); - const [visibleCount, setVisibleCount] = useState(1); + const containerRef = useRef(null); + const [isPaused, setIsPaused] = useState(false); + const currentIndex = useRef(0); + const [itemsToShow, setItemsToShow] = useState(1); useEffect(() => { - const handleResize = () => { - const width = window.innerWidth; - if (width < 640) setVisibleCount(1); - else if (width < 1024) setVisibleCount(2); - else setVisibleCount(3); + const updateItemsToShow = () => { + if (window.innerWidth >= 1024) { + setItemsToShow(3); + } else if (window.innerWidth >= 640) { + setItemsToShow(2); + } else { + setItemsToShow(1); + } }; - handleResize(); - window.addEventListener("resize", handleResize); - return () => window.removeEventListener("resize", handleResize); + updateItemsToShow(); + window.addEventListener("resize", updateItemsToShow); + return () => window.removeEventListener("resize", updateItemsToShow); }, []); - const scrollToPage = (index) => { - const container = scrollRef.current; - if (!container) return; + const scrollToIndex = (index) => { + if (!containerRef.current) return; - const cardWidth = container.scrollWidth / sponsors.length; - const scrollX = cardWidth * visibleCount * index; - container.scrollTo({ left: scrollX, behavior: "smooth" }); + const itemWidth = containerRef.current.scrollWidth / sponsors.length; + const scrollPosition = itemWidth * itemsToShow * index; + + containerRef.current.scrollTo({ + left: scrollPosition, + behavior: "smooth", + }); + }; + + const getTotalPages = () => { + return Math.ceil(sponsors.length / itemsToShow); }; - const totalPages = () => { - return Math.ceil(sponsors.length / visibleCount); + const goToNext = () => { + const totalPages = getTotalPages(); + currentIndex.current = (currentIndex.current + 1) % totalPages; + scrollToIndex(currentIndex.current); }; - const handleManualScroll = (direction) => { - const pages = totalPages(); - if (direction === "left") { - pageIndex.current = - pageIndex.current === 0 ? pages - 1 : pageIndex.current - 1; - } else { - pageIndex.current = (pageIndex.current + 1) % pages; - } - scrollToPage(pageIndex.current); + const goToPrevious = () => { + const totalPages = getTotalPages(); + currentIndex.current = + currentIndex.current === 0 ? totalPages - 1 : currentIndex.current - 1; + scrollToIndex(currentIndex.current); }; useEffect(() => { - const autoScroll = () => { - const container = scrollRef.current; - if (!container) return; + if (isPaused) return; - const pages = totalPages(); - pageIndex.current = (pageIndex.current + 1) % pages; - scrollToPage(pageIndex.current); - }; + const autoPlay = setInterval(() => { + goToNext(); + }, 5000); + + return () => clearInterval(autoPlay); + }, [isPaused, itemsToShow]); - let interval; - if (!isHovered) { - interval = setInterval(autoScroll, 5000); - } - return () => clearInterval(interval); - }, [isHovered, visibleCount]); + const handleMouseEnter = () => setIsPaused(true); + const handleMouseLeave = () => setIsPaused(false); + + const handlePrevClick = () => { + goToPrevious(); + setIsPaused(true); + setTimeout(() => setIsPaused(false), 200); + }; + + const handleNextClick = () => { + goToNext(); + setIsPaused(true); + setTimeout(() => setIsPaused(false), 200); + }; return ( -
-
+
+

Our Sponsors and Partners @@ -76,22 +92,21 @@ const SponsorsSection = () => {

setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} + className="relative px-12" + onMouseEnter={handleMouseEnter} + onMouseLeave={handleMouseLeave} > - {/* Left Arrow */} - {/* Sponsor Scroll Area */}
{sponsors.map((sponsor, index) => ( { href={sponsor.link} target="_blank" rel="noopener noreferrer" - className="flex-shrink-0 px-2 box-border" - style={{ width: `${100 / visibleCount}%` }} + className="flex-shrink-0 px-2" + style={{ width: `${100 / itemsToShow}%` }} > -
+
{sponsor.name}
@@ -114,10 +129,10 @@ const SponsorsSection = () => {
diff --git a/src/components/Team.jsx b/src/components/Team.jsx index 738ac87..f1e8652 100644 --- a/src/components/Team.jsx +++ b/src/components/Team.jsx @@ -5,54 +5,74 @@ import { FaLinkedin, FaXTwitter } from "react-icons/fa6"; import { useNavigate } from "react-router"; const TeamSlider = () => { - const [currentIndex, setCurrentIndex] = useState(0); - const [visibleCount, setVisibleCount] = useState(1); - + const [currentSlideIndex, setCurrentSlideIndex] = useState(0); + const [cardsPerView, setCardsPerView] = useState(1); const navigate = useNavigate(); - const getVisibleCount = () => { - if (window.innerWidth < 768) return 1; - if (window.innerWidth < 1024) return 2; - if (window.innerWidth < 1280) return 3; - return 4; - }; useEffect(() => { - const handleResize = () => { - const count = getVisibleCount(); - setVisibleCount(count); - const maxIndex = Math.max(0, teamMembers.length - count); - if (currentIndex > maxIndex) { - setCurrentIndex(maxIndex); + const handleScreenResize = () => { + const screenWidth = window.innerWidth; + + if (screenWidth >= 1200) { + setCardsPerView(4); + } else if (screenWidth >= 850) { + setCardsPerView(3); + } else if (screenWidth >= 500) { + setCardsPerView(2); + } else { + setCardsPerView(1); } }; - setVisibleCount(getVisibleCount()); - window.addEventListener("resize", handleResize); - return () => window.removeEventListener("resize", handleResize); - }, [currentIndex]); + handleScreenResize(); + window.addEventListener("resize", handleScreenResize); + + return () => window.removeEventListener("resize", handleScreenResize); + }, []); + + const uniqueTeamMembers = Array.from( + new Map(teamMembers.map((member) => [member.name, member])).values(), + ); + + const maxSlideIndex = Math.max(0, uniqueTeamMembers.length - cardsPerView); + + const showNextMembers = () => { + setCurrentSlideIndex((currentIndex) => { + if (currentIndex >= maxSlideIndex) { + return 0; + } + + const remainingCards = maxSlideIndex - currentIndex; + const cardsToMove = Math.min(cardsPerView, remainingCards); + + return currentIndex + cardsToMove; + }); + }; + + const showPreviousMembers = () => { + setCurrentSlideIndex((currentIndex) => { + if (currentIndex <= 0) { + return maxSlideIndex; + } - const nextSlide = () => { - const maxIndex = Math.max(0, teamMembers.length - visibleCount); - setCurrentIndex((prev) => (prev >= maxIndex ? 0 : prev + visibleCount)); + return Math.max(0, currentIndex - cardsPerView); + }); }; - const prevSlide = () => { - const maxIndex = Math.max(0, teamMembers.length - visibleCount); - setCurrentIndex((prev) => (prev <= 0 ? maxIndex : prev - visibleCount)); + const viewFullTeam = () => { + navigate("/Team"); + window.scrollTo(0, 0); }; return ( -
+
-

Our team

-

+

Our team

+

@@ -60,70 +80,73 @@ const TeamSlider = () => {
- - -
+
-

Join Us Today!

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. +

Join Us Today!

+

+ Ready to be part of our amazing team? We're always looking for + talented individuals who share our passion.

-