card finished

This commit is contained in:
Paul Fresnel
2024-11-07 14:40:25 +01:00
parent a5697e4422
commit c143e297a4
2 changed files with 18 additions and 31 deletions
+11 -26
View File
@@ -29,12 +29,16 @@ body {
} }
} }
/* Update the card flip styles */ /* Card flip styles */
.card-container { .card-container {
perspective: 1500px; perspective: 1500px;
} }
.card { .card {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.8s; transition: transform 0.8s;
transform-style: preserve-3d; transform-style: preserve-3d;
cursor: pointer; cursor: pointer;
@@ -44,34 +48,15 @@ body {
transform: rotateY(180deg); transform: rotateY(180deg);
} }
.card-front, .card-side {
.card-back { position: absolute;
-webkit-backface-visibility: hidden; width: 100%;
height: 100%;
backface-visibility: hidden; backface-visibility: hidden;
transform-style: preserve-3d; -webkit-backface-visibility: hidden;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
} }
.card-back { .card-back {
transform: rotateY(180deg); transform: rotateY(180deg);
}
/* Add a subtle hover effect */
.card::before {
content: '';
position: absolute;
inset: 0;
z-index: 1;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.1),
rgba(255, 255, 255, 0)
);
opacity: 0;
transition: opacity 0.3s ease;
}
.card:hover::before {
opacity: 1;
} }
+7 -5
View File
@@ -91,25 +91,27 @@ const HomePage = () => {
{/* Loyalty Card with Flip Effect */} {/* Loyalty Card with Flip Effect */}
<div className="card-container max-w-2xl mx-auto aspect-[1.586/1] mb-8"> <div className="card-container max-w-2xl mx-auto aspect-[1.586/1] mb-8">
<div className="card relative w-full h-full rounded-2xl shadow-2xl"> <div className="card relative w-full h-full">
{/* Front of the card */} {/* Front of the card */}
<div className="card-front absolute w-full h-full rounded-2xl overflow-hidden"> <div className="card-side card-front absolute w-full h-full rounded-[24px] overflow-hidden bg-bakery-600">
<Image <Image
src="/images/ressources/card-front.png" src="/images/ressources/card-front.png"
alt="Carte de fidélité - Recto" alt="Carte de fidélité - Recto"
fill fill
className="object-cover" className="object-contain p-1"
priority priority
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
/> />
</div> </div>
{/* Back of the card */} {/* Back of the card */}
<div className="card-back absolute w-full h-full rounded-2xl overflow-hidden"> <div className="card-side card-back absolute w-full h-full rounded-[24px] overflow-hidden bg-bakery-600">
<Image <Image
src="/images/ressources/card-back.png" src="/images/ressources/card-back.png"
alt="Carte de fidélité - Verso" alt="Carte de fidélité - Verso"
fill fill
className="object-cover" className="object-contain p-1"
priority priority
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
/> />
</div> </div>
</div> </div>