Skip to content

Commit c2f3b82

Browse files
committed
Refactored MemberCard so that flippable functionality is optional and can be set manually. Also improved styling.
1 parent 16c94e3 commit c2f3b82

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/components/MemberCard.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
height: 316px;
55
}
66

7+
.regCard {
8+
background-color: transparent;
9+
width: 240px;
10+
height: 316px;
11+
}
12+
713
.flipCardInner {
814
position: relative;
915
width: 100%;
@@ -27,7 +33,7 @@
2733

2834
.flipCardFront {
2935
color: rgb(0, 0, 0);
30-
36+
3137
;
3238
}
3339

src/components/MemberCard.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from "react";
22
import LocalCafeIcon from "@mui/icons-material/LocalCafe";
33
import './MemberCard.css'; // Import the regular CSS file
44

5+
const FLIPPABLE = false; // Set to true to enable flip card functionality
6+
57
interface MemberCardProps {
68
imagePath: string;
79
name: string;
@@ -11,9 +13,9 @@ interface MemberCardProps {
1113
}
1214

1315
const MemberCard: React.FC<MemberCardProps> = ({ imagePath, name, title, url, backContent }) => {
14-
return (
15-
<div className="flex-col h-90 w-60 shadow-lg overflow-hidden m-3">
16-
<div className="flipCard">
16+
return (
17+
<div className="flex-col h-90 w-60 shadow-lg overflow-hidden m-3 hover:shadow-lg hover:-translate-y-3 duration-300 z-2 hover:cursor-pointer rounded-md">
18+
<div className={FLIPPABLE ? "flipCard" : "regCard"}>
1719
<div className="flipCardInner">
1820
<div className="flipCardFront">
1921
<img className="image h-60 w-full object-cover p-3" src={imagePath} alt={name} />
@@ -29,9 +31,9 @@ const MemberCard: React.FC<MemberCardProps> = ({ imagePath, name, title, url, ba
2931
</div>
3032
</div>
3133
</div>
32-
<div className="flipCardBack">
33-
<p>{backContent}</p>
34-
</div>
34+
<div className="flipCardBack">
35+
<p>{backContent}</p>
36+
</div>
3537
</div>
3638
</div>
3739
</div>

0 commit comments

Comments
 (0)