|
| 1 | +import { motion } from 'framer-motion'; |
| 2 | +import { LuChevronRight, LuCode, LuStar, LuUsers } from 'react-icons/lu'; |
| 3 | + |
| 4 | +import { ProjectCardProps } from 'types'; |
| 5 | + |
| 6 | +const ProjectCard: React.FC<ProjectCardProps> = ({ |
| 7 | + title, |
| 8 | + description, |
| 9 | + language, |
| 10 | + lastUpdated, |
| 11 | + stars, |
| 12 | + contributors, |
| 13 | + isRight, |
| 14 | +}) => ( |
| 15 | + <motion.div |
| 16 | + className={`flex ${isRight ? 'justify-start' : 'justify-end'} relative`} |
| 17 | + initial={{ opacity: 0, x: isRight ? 100 : -100 }} |
| 18 | + whileInView={{ opacity: 1, x: 0 }} |
| 19 | + viewport={{ once: true }} |
| 20 | + transition={{ duration: 0.6 }} |
| 21 | + > |
| 22 | + <div |
| 23 | + className={`w-full md:w-5/12 ${ |
| 24 | + isRight ? 'md:ml-auto md:pr-8' : 'md:mr-auto md:pl-8' |
| 25 | + }`} |
| 26 | + > |
| 27 | + <div className="rounded-xl bg-gradient-to-br from-green-700 to-primary-900 p-6 shadow-lg transition-all duration-300 hover:shadow-2xl"> |
| 28 | + <div className="mb-4 flex items-center justify-between"> |
| 29 | + <div className="flex items-center"> |
| 30 | + <LuCode className="mr-2 text-green-300" size={24} /> |
| 31 | + <h3 className="text-xl font-bold text-white">{title}</h3> |
| 32 | + </div> |
| 33 | + <span className="rounded-full bg-green-900 px-3 py-1 text-sm font-semibold text-green-300"> |
| 34 | + {language} |
| 35 | + </span> |
| 36 | + </div> |
| 37 | + <p className="mb-4 text-gray-300">{description}</p> |
| 38 | + <div className="flex items-center justify-between text-gray-300"> |
| 39 | + <div className="flex items-center space-x-4"> |
| 40 | + <span className="flex items-center"> |
| 41 | + <LuStar className="mr-1" /> {stars} |
| 42 | + </span> |
| 43 | + <span className="flex items-center"> |
| 44 | + <LuUsers className="mr-1" /> {contributors} |
| 45 | + </span> |
| 46 | + </div> |
| 47 | + <span className="text-sm">Updated {lastUpdated}</span> |
| 48 | + </div> |
| 49 | + <div className="mt-4 flex justify-end"> |
| 50 | + <button className="flex items-center rounded-full bg-green-500 px-4 py-2 text-white transition-colors duration-300 hover:bg-green-400"> |
| 51 | + Explore <LuChevronRight className="ml-1" /> |
| 52 | + </button> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </motion.div> |
| 57 | +); |
| 58 | + |
| 59 | +export default ProjectCard; |
0 commit comments