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 ( +
+ {card.description} +
+