diff --git a/Frontend/src/components/Card.jsx b/Frontend/src/components/Card.jsx new file mode 100644 index 0000000..40c2c9b --- /dev/null +++ b/Frontend/src/components/Card.jsx @@ -0,0 +1,137 @@ +import React, { useState ,useEffect } from "react"; +import { motion } from "framer-motion"; +import { + FaChartLine, + FaCashRegister, + FaHospital, + FaUserMd, + FaCalendarCheck, + FaHeartbeat, + FaAmbulance, + FaLaptopMedical, +} from "react-icons/fa"; + +const MultiCardCarousel = () => { + const [currentIndex, setCurrentIndex] = useState(0); + const [cardsPerPage, setCardsPerPage] = useState(1); + + + const cards = [ + { + icon: FaAmbulance, + title: "Patient Management", + description: + "Manage patient records, treatment histories, and essential health information.", + }, + { + icon: FaCalendarCheck, + title: "Appointment Scheduling", + description: + "Organize, schedule, and track patient appointments with automated reminders.", + }, + { + icon: FaHeartbeat, + title: "Electronic Health Records", + description: + "Digitally store, access, and manage comprehensive patient medical records.", + }, + { + icon: FaCashRegister, + title: "Billing and Invoicing", + description: + "Streamline billing, generate invoices, and manage healthcare payment processes.", + }, + { + icon: FaHospital, + title: "Inventory Management", + description: + "Monitor medical supplies, equipment stock, and automate reordering processes", + }, + { + icon: FaUserMd, + title: "Staff Management", + description: + "Track staff schedules, performance, and workload for efficient operations.", + }, + { + icon: FaChartLine, + title: "Reporting and Analytics", + description: + "Generate data-driven insights and reports to improve decision-making.", + }, + { + icon: FaLaptopMedical, + title: "Telemedicine Integration", + description: + "Enable remote consultations, patient care, and video conferencing with doctors.", + }, + ]; + + const updateCardsPerPage = () => { + const width = window.innerWidth; + if (width >= 1024) { + setCardsPerPage(3); // 3 cards for large screens + } else if (width >= 640) { + setCardsPerPage(2); // 2 cards for small/medium screens + } else { + setCardsPerPage(1); // 1 card for mobile + } + }; + + // Update the cardsPerPage when the window is resized + useEffect(() => { + updateCardsPerPage(); + window.addEventListener('resize', updateCardsPerPage); + return () => window.removeEventListener('resize', updateCardsPerPage); + }, []); + + // Automatic sliding functionality + useEffect(() => { + const interval = setInterval(() => { + setCurrentIndex((prevIndex) => + prevIndex + cardsPerPage >= cards.length ? 0 : prevIndex + cardsPerPage + ); + }, 3000); // Slide every 3 seconds + + return () => clearInterval(interval); // Cleanup the interval on unmount + }, [cardsPerPage, cards.length]); + + // Ensure the current index doesn't go out of bounds when screen size changes + useEffect(() => { + if (currentIndex + cardsPerPage > cards.length) { + setCurrentIndex(Math.max(0, cards.length - cardsPerPage)); + } + }, [cardsPerPage, currentIndex, cards.length]); + + return ( +
+
+
+ {/* Responsive grid: based on cardsPerPage state */} +
+ {cards.slice(currentIndex, currentIndex + cardsPerPage).map((card, index) => ( + + +

+ {card.title} +

+

+ {card.description} +

+
+ ))} +
+
+
+
+ ); +}; + +export default MultiCardCarousel; diff --git a/Frontend/src/components/Home.jsx b/Frontend/src/components/Home.jsx index 2160680..c396004 100644 --- a/Frontend/src/components/Home.jsx +++ b/Frontend/src/components/Home.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { motion } from 'framer-motion'; import { Link } from 'react-router-dom'; -import { FaHospital, FaUserMd, FaCalendarCheck, FaHeartbeat, FaAmbulance, FaLaptopMedical } from 'react-icons/fa'; +import {FaHospital, FaUserMd, FaCalendarCheck, FaHeartbeat, FaAmbulance, FaLaptopMedical } from 'react-icons/fa'; const Home = () => { const features = [ diff --git a/Frontend/src/pages/Services.jsx b/Frontend/src/pages/Services.jsx index 3fda7a4..f77240c 100644 --- a/Frontend/src/pages/Services.jsx +++ b/Frontend/src/pages/Services.jsx @@ -1,19 +1,11 @@ import React from 'react'; +import MultiCardCarousel from '../components/Card'; const Services = () => { return (
-

Our Services

- +

Our Services

+
); };