Spaces:
Sleeping
Sleeping
Update components/GlassCard.js
Browse files- components/GlassCard.js +20 -28
components/GlassCard.js
CHANGED
|
@@ -2,21 +2,13 @@ import { motion } from "framer-motion";
|
|
| 2 |
|
| 3 |
export default function GlassCard({ image, caption, price }) {
|
| 4 |
return (
|
| 5 |
-
<div className="relative w-full h-full flex items-center justify-center
|
| 6 |
|
| 7 |
-
{/* THE FRAME
|
| 8 |
-
|
| 9 |
-
'h-[80%]' ensures it fits on screen without being covered by the top/bottom bars.
|
| 10 |
-
*/}
|
| 11 |
-
<motion.div
|
| 12 |
-
initial={{ scale: 0.9, opacity: 0 }}
|
| 13 |
-
whileInView={{ scale: 1, opacity: 1 }}
|
| 14 |
-
transition={{ duration: 0.4 }}
|
| 15 |
-
className="relative w-full max-w-sm h-[75vh] flex-shrink-0"
|
| 16 |
-
>
|
| 17 |
|
| 18 |
-
{/* LAYER 1: The Model Image (
|
| 19 |
-
<div className="absolute top-
|
| 20 |
<img
|
| 21 |
src={image}
|
| 22 |
alt="Model"
|
|
@@ -24,31 +16,31 @@ export default function GlassCard({ image, caption, price }) {
|
|
| 24 |
/>
|
| 25 |
</div>
|
| 26 |
|
| 27 |
-
{/* LAYER 2: The Glass Frame
|
| 28 |
<div className="absolute inset-0 z-10 pointer-events-none">
|
| 29 |
<img
|
| 30 |
src="/assets/picture_frame.png"
|
| 31 |
-
alt="Glass Frame"
|
| 32 |
className="w-full h-full object-fill drop-shadow-2xl"
|
| 33 |
/>
|
| 34 |
</div>
|
| 35 |
|
| 36 |
-
{/* LAYER 3:
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
<div className="flex items-center justify-center">
|
| 45 |
-
<span className="font-manrope font-extrabold text-[#0EA5E9] text-lg bg-white/70 px-3 py-1 rounded-lg backdrop-blur-md shadow-sm border border-white/50">
|
| 46 |
-
{price}
|
| 47 |
-
</span>
|
| 48 |
-
</div>
|
| 49 |
</div>
|
| 50 |
|
| 51 |
-
</
|
| 52 |
</div>
|
| 53 |
);
|
| 54 |
}
|
|
|
|
| 2 |
|
| 3 |
export default function GlassCard({ image, caption, price }) {
|
| 4 |
return (
|
| 5 |
+
<div className="relative w-full h-full flex items-center justify-center">
|
| 6 |
|
| 7 |
+
{/* THE FRAME WRAPPER */}
|
| 8 |
+
<div className="relative w-full max-w-[360px] aspect-[9/16]">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
{/* LAYER 1: The Model Image (Tucked behind the glass) */}
|
| 11 |
+
<div className="absolute top-[4%] bottom-[15%] left-[6%] right-[6%] z-0 bg-white rounded-lg overflow-hidden">
|
| 12 |
<img
|
| 13 |
src={image}
|
| 14 |
alt="Model"
|
|
|
|
| 16 |
/>
|
| 17 |
</div>
|
| 18 |
|
| 19 |
+
{/* LAYER 2: The Glass Frame (Overlay) */}
|
| 20 |
<div className="absolute inset-0 z-10 pointer-events-none">
|
| 21 |
<img
|
| 22 |
src="/assets/picture_frame.png"
|
|
|
|
| 23 |
className="w-full h-full object-fill drop-shadow-2xl"
|
| 24 |
/>
|
| 25 |
</div>
|
| 26 |
|
| 27 |
+
{/* LAYER 3: The Content (Inside the Bottom Ledge) */}
|
| 28 |
+
{/* We position this precisely to fit your PNG's bottom bar */}
|
| 29 |
+
<div className="absolute bottom-[4%] left-[8%] right-[8%] h-[10%] z-20 flex items-center justify-between px-2">
|
| 30 |
+
|
| 31 |
+
{/* Caption (Left side of ledge) */}
|
| 32 |
+
<span className="font-manrope font-bold text-[#1E293B] text-xs w-2/3 leading-tight line-clamp-2 opacity-80">
|
| 33 |
+
{caption}
|
| 34 |
+
</span>
|
| 35 |
+
|
| 36 |
+
{/* Price (Right side of ledge - Styled like a glass pill) */}
|
| 37 |
+
<span className="font-manrope font-extrabold text-[#0EA5E9] text-base">
|
| 38 |
+
{price}
|
| 39 |
+
</span>
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
</div>
|
| 42 |
|
| 43 |
+
</div>
|
| 44 |
</div>
|
| 45 |
);
|
| 46 |
}
|