Shinhati2023 commited on
Commit
9d9d4eb
·
verified ·
1 Parent(s): 343ff0d

Update components/GlassCard.js

Browse files
Files changed (1) hide show
  1. 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 bg-[#F8FAFC]">
6
 
7
- {/* THE FRAME CONTAINER
8
- Adjust 'max-w-md' if you want it wider or narrower.
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 (Behind Glass) */}
19
- <div className="absolute top-6 bottom-16 left-5 right-5 z-0 rounded-2xl overflow-hidden bg-white shadow-inner">
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 PNG (Overlay) */}
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: Caption & Price (On the 'Caption Frame' Ledge) */}
37
- <div className="absolute bottom-5 left-8 right-8 z-20 h-16 flex items-center justify-between">
38
- <div className="flex flex-col justify-center w-2/3">
39
- <p className="font-manrope font-bold text-[#1E293B] text-sm leading-tight line-clamp-2">
40
- {caption}
41
- </p>
42
- </div>
 
 
 
 
 
 
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
- </motion.div>
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
  }