-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeamCard.tsx
More file actions
68 lines (63 loc) · 2.03 KB
/
TeamCard.tsx
File metadata and controls
68 lines (63 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// src/components/about/TeamCard.tsx
"use client";
import Image from "next/image";
import { FaLinkedin } from "react-icons/fa";
import { useState } from "react";
export type TeamMemberProps = {
name: string;
role: string;
imageSrc: string;
linkedinUrl?: string; // Optional LinkedIn URL
altText?: string; // Optional alt text for image
};
export const TeamCard: React.FC<TeamMemberProps> = ({
name,
role,
imageSrc,
linkedinUrl,
altText,
}) => {
const [isHovered, setIsHovered] = useState(false);
return (
<div
className="relative overflow-hidden rounded-xl transition-all duration-300 hover:shadow-[0_0_30px_rgba(121,199,253,0.3)]"
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
{/* Card with image and info */}
<div className="border border-gray-800 bg-gray-900">
{/* Image container with fixed aspect ratio */}
<div className="relative aspect-square w-full overflow-hidden">
<Image
src={imageSrc}
alt={altText || `${name}, ${role}`}
fill
className="object-cover transition-transform duration-300"
sizes="(max-width: 768px) 100vw, 33vw"
/>
</div>
{/* Info section */}
<div className="p-4">
<h3 className="text-lg font-semibold">{name}</h3>
<div className="inline-block rounded-md bg-blue bg-opacity-10 px-3 py-1 text-sm text-blue">
{role}
</div>
</div>
</div>
{/* LinkedIn overlay that appears on hover */}
{linkedinUrl && (
<a
href={linkedinUrl}
target="_blank"
rel="noopener noreferrer"
className={`absolute inset-0 flex items-end justify-end bg-black bg-opacity-20 p-4 transition-opacity duration-300 ${
isHovered ? "opacity-100" : "opacity-0"
}`}
aria-label={`View ${name}'s LinkedIn profile`}
>
<FaLinkedin className="text-5xl text-blue" />
</a>
)}
</div>
);
};