feat(tip): display realistic coffee photo

This commit is contained in:
2026-07-13 18:54:15 +08:00
parent 4083cf0b6c
commit f9b5f22ee9
4 changed files with 21 additions and 58 deletions
+17 -54
View File
@@ -176,52 +176,31 @@
.coffeeStage {
position: relative;
display: grid;
min-height: 172px;
place-items: center;
overflow: hidden;
border-radius: 30px;
background:
radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.82), transparent 34%),
linear-gradient(145deg, #fff8ed, #ffe1cc);
box-shadow: inset 0 0 0 1px rgba(126, 66, 57, 0.06);
isolation: isolate;
}
.coffeeStage::before {
position: absolute;
width: clamp(112px, 30vw, 148px);
width: 100%;
aspect-ratio: 1;
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 50%;
background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 198, 151, 0.3));
overflow: hidden;
border-radius: clamp(24px, 6.667vw, 32px);
background: #c59b7d;
box-shadow:
0 20px 42px rgba(174, 91, 60, 0.13),
inset 0 1px 0 rgba(255, 255, 255, 0.96);
content: "";
transform: rotate(-8deg);
0 18px 34px rgba(102, 53, 39, 0.18),
inset 0 0 0 1px rgba(126, 66, 57, 0.08);
isolation: isolate;
}
.coffeeStage::after {
position: absolute;
bottom: 24px;
width: clamp(72px, 18vw, 98px);
height: 15px;
border-radius: 50%;
background: rgba(111, 58, 44, 0.12);
inset: 0;
z-index: 1;
border-radius: inherit;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
content: "";
filter: blur(7px);
transform: scaleX(1.08);
pointer-events: none;
}
.coffeeImage {
z-index: 1;
width: clamp(132px, 31vw, 164px);
max-width: 92%;
height: auto;
object-fit: contain;
filter: drop-shadow(0 14px 14px rgba(102, 53, 39, 0.2));
animation: coffeeFloat 3.2s ease-in-out infinite;
width: 100%;
height: 100%;
object-fit: cover;
}
.productCopy {
@@ -370,7 +349,8 @@
}
.coffeeStage {
min-height: 152px;
width: min(100%, 220px);
justify-self: center;
}
}
@@ -392,20 +372,3 @@
transform: translateY(0) scale(1);
}
}
@keyframes coffeeFloat {
0%,
100% {
transform: translateY(3px) rotate(-1deg);
}
50% {
transform: translateY(-5px) rotate(1deg);
}
}
@media (prefers-reduced-motion: reduce) {
.coffeeImage {
animation: none;
}
}
+4 -4
View File
@@ -183,11 +183,11 @@ export function TipScreen({
<section className={styles.productCard} aria-label="Coffee tip product">
<div className={styles.coffeeStage} aria-hidden="true">
<Image
src="/images/tip/coffee.png"
src="/images/tip/coffee.jpg"
alt=""
width={377}
height={360}
sizes="(max-width: 380px) 132px, 164px"
width={736}
height={736}
sizes="(max-width: 380px) 220px, 211px"
className={styles.coffeeImage}
/>
</div>