|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { Writer } from "@/lib/writersData"; |
| 4 | +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; |
| 5 | +import { Github, Linkedin, Twitter, Globe } from "lucide-react"; |
| 6 | +import Image from "next/image"; |
| 7 | + |
| 8 | +interface WriterCardProps { |
| 9 | + writer: Writer; |
| 10 | +} |
| 11 | + |
| 12 | +/** |
| 13 | + * WriterCard Component |
| 14 | + * |
| 15 | + * Displays an individual writer's profile with their image, name, role, bio, |
| 16 | + * and social links. Follows Keploy's visual style with elegant hover effects. |
| 17 | + * |
| 18 | + * Note: Currently using initials as placeholders. When real writer photos are |
| 19 | + * available, place them in /public/images/writers/ and update the image paths |
| 20 | + * in writersData.ts |
| 21 | + */ |
| 22 | +export function WriterCard({ writer }: WriterCardProps) { |
| 23 | + // Check if writer has a real image (not a placeholder path) |
| 24 | + const hasRealImage = writer.image && !writer.image.includes('placeholder'); |
| 25 | + |
| 26 | + return ( |
| 27 | + <Card className="group relative h-full flex flex-col overflow-hidden bg-white border border-gray-200/60 rounded-2xl shadow-sm hover:shadow-2xl transition-all duration-500 hover:-translate-y-2"> |
| 28 | + {/* Animated gradient border on hover */} |
| 29 | + <div |
| 30 | + className="absolute inset-0 rounded-2xl bg-gradient-to-br from-[#F89559] via-[#E87B3A] to-[#F89559] opacity-0 group-hover:opacity-100 transition-opacity duration-500 -z-10" |
| 31 | + style={{ padding: '2px', margin: '-2px' }} |
| 32 | + aria-hidden="true" |
| 33 | + /> |
| 34 | + |
| 35 | + {/* Inner card background */} |
| 36 | + <div className="absolute inset-[2px] bg-white rounded-[14px] -z-5" aria-hidden="true" /> |
| 37 | + |
| 38 | + {/* Subtle top glow on hover */} |
| 39 | + <div |
| 40 | + className="absolute -top-20 left-1/2 -translate-x-1/2 w-40 h-40 bg-[#F89559]/20 rounded-full blur-3xl opacity-0 group-hover:opacity-100 transition-opacity duration-500" |
| 41 | + aria-hidden="true" |
| 42 | + /> |
| 43 | + |
| 44 | + <CardHeader className="relative text-center pb-3 pt-8 flex-shrink-0"> |
| 45 | + {/* Profile Image with gradient ring */} |
| 46 | + <div className="mx-auto mb-5 relative"> |
| 47 | + {/* Outer glow ring */} |
| 48 | + <div className="absolute inset-0 w-28 h-28 rounded-full bg-gradient-to-br from-[#F89559] to-[#E87B3A] blur-sm opacity-0 group-hover:opacity-40 transition-opacity duration-500" /> |
| 49 | + |
| 50 | + {/* Avatar container */} |
| 51 | + <div className="relative w-28 h-28 rounded-full p-[3px] bg-gradient-to-br from-[#F89559]/30 to-[#E87B3A]/30 group-hover:from-[#F89559] group-hover:to-[#E87B3A] transition-all duration-500"> |
| 52 | + <div className="w-full h-full rounded-full bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center overflow-hidden shadow-inner"> |
| 53 | + {hasRealImage ? ( |
| 54 | + <Image |
| 55 | + src={writer.image} |
| 56 | + alt={`${writer.name}'s profile photo`} |
| 57 | + width={112} |
| 58 | + height={112} |
| 59 | + className="w-full h-full object-cover" |
| 60 | + /> |
| 61 | + ) : ( |
| 62 | + /* Placeholder avatar with initials */ |
| 63 | + <span |
| 64 | + className="text-3xl font-bold bg-gradient-to-br from-[#F89559] to-[#E87B3A] bg-clip-text text-transparent select-none" |
| 65 | + aria-label={`${writer.name}'s initials`} |
| 66 | + > |
| 67 | + {writer.name.split(' ').map(n => n[0]).join('').slice(0, 2)} |
| 68 | + </span> |
| 69 | + )} |
| 70 | + </div> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + |
| 74 | + <CardTitle className="text-xl font-bold text-gray-900 group-hover:text-[#E87B3A] transition-colors duration-300"> |
| 75 | + {writer.name} |
| 76 | + </CardTitle> |
| 77 | + |
| 78 | + {writer.role && ( |
| 79 | + <p className="text-sm font-semibold text-[#F89559] mt-2 tracking-wide"> |
| 80 | + {writer.role} |
| 81 | + </p> |
| 82 | + )} |
| 83 | + </CardHeader> |
| 84 | + |
| 85 | + <CardContent className="relative text-center flex-grow flex flex-col justify-between px-6 pb-6"> |
| 86 | + {/* Bio text - fixed height with overflow handling */} |
| 87 | + <p className="text-gray-600 text-sm leading-relaxed min-h-[4.5rem]"> |
| 88 | + {writer.bio} |
| 89 | + </p> |
| 90 | + |
| 91 | + {/* Social Links - BOLDER icons with better visibility */} |
| 92 | + {writer.socialLinks && ( |
| 93 | + <div className="flex justify-center gap-4 mt-5 pt-5 border-t border-gray-100"> |
| 94 | + {writer.socialLinks.twitter && ( |
| 95 | + <a |
| 96 | + href={writer.socialLinks.twitter} |
| 97 | + target="_blank" |
| 98 | + rel="noopener noreferrer" |
| 99 | + className="p-2.5 rounded-full bg-gray-100 text-gray-600 hover:bg-[#F89559] hover:text-white transition-all duration-300 hover:scale-110 hover:shadow-lg hover:shadow-[#F89559]/30" |
| 100 | + aria-label={`Follow ${writer.name} on X (Twitter)`} |
| 101 | + > |
| 102 | + <Twitter className="w-5 h-5" strokeWidth={2.5} /> |
| 103 | + </a> |
| 104 | + )} |
| 105 | + {writer.socialLinks.github && ( |
| 106 | + <a |
| 107 | + href={writer.socialLinks.github} |
| 108 | + target="_blank" |
| 109 | + rel="noopener noreferrer" |
| 110 | + className="p-2.5 rounded-full bg-gray-100 text-gray-600 hover:bg-[#F89559] hover:text-white transition-all duration-300 hover:scale-110 hover:shadow-lg hover:shadow-[#F89559]/30" |
| 111 | + aria-label={`Visit ${writer.name}'s GitHub profile`} |
| 112 | + > |
| 113 | + <Github className="w-5 h-5" strokeWidth={2.5} /> |
| 114 | + </a> |
| 115 | + )} |
| 116 | + {writer.socialLinks.linkedin && ( |
| 117 | + <a |
| 118 | + href={writer.socialLinks.linkedin} |
| 119 | + target="_blank" |
| 120 | + rel="noopener noreferrer" |
| 121 | + className="p-2.5 rounded-full bg-gray-100 text-gray-600 hover:bg-[#F89559] hover:text-white transition-all duration-300 hover:scale-110 hover:shadow-lg hover:shadow-[#F89559]/30" |
| 122 | + aria-label={`Connect with ${writer.name} on LinkedIn`} |
| 123 | + > |
| 124 | + <Linkedin className="w-5 h-5" strokeWidth={2.5} /> |
| 125 | + </a> |
| 126 | + )} |
| 127 | + {writer.socialLinks.website && ( |
| 128 | + <a |
| 129 | + href={writer.socialLinks.website} |
| 130 | + target="_blank" |
| 131 | + rel="noopener noreferrer" |
| 132 | + className="p-2.5 rounded-full bg-gray-100 text-gray-600 hover:bg-[#F89559] hover:text-white transition-all duration-300 hover:scale-110 hover:shadow-lg hover:shadow-[#F89559]/30" |
| 133 | + aria-label={`Visit ${writer.name}'s website`} |
| 134 | + > |
| 135 | + <Globe className="w-5 h-5" strokeWidth={2.5} /> |
| 136 | + </a> |
| 137 | + )} |
| 138 | + </div> |
| 139 | + )} |
| 140 | + </CardContent> |
| 141 | + </Card> |
| 142 | + ); |
| 143 | +} |
0 commit comments