feat(tip): add selectable coffee gift tiers

This commit is contained in:
2026-07-15 17:00:25 +08:00
parent e1a43a641b
commit c277b3e6ca
16 changed files with 480 additions and 98 deletions
+160
View File
@@ -236,6 +236,156 @@
letter-spacing: -0.04em;
}
.tierSelector {
grid-column: 1 / -1;
min-width: 0;
margin: 2px 0 0;
padding: 0;
border: 0;
}
.tierLegend {
width: 100%;
margin-bottom: 12px;
color: #6f5055;
font-size: clamp(13px, 3.148vw, 15px);
font-weight: 850;
letter-spacing: 0.025em;
}
.tierList {
display: grid;
gap: 10px;
}
.tierOption {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto 28px;
align-items: center;
gap: 12px;
min-height: 72px;
padding: 12px 14px 12px 16px;
border: 1px solid rgba(112, 71, 65, 0.12);
border-radius: 20px;
background: rgba(255, 255, 255, 0.68);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
cursor: pointer;
transition:
border-color 0.18s ease,
background 0.18s ease,
box-shadow 0.18s ease,
transform 0.18s ease;
}
.tierOption[data-selected="true"] {
border-color: var(--color-accent, #f84d96);
background:
linear-gradient(105deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 243, 0.9)),
#ffffff;
box-shadow:
0 12px 28px rgba(248, 77, 150, 0.16),
inset 3px 0 0 var(--color-accent, #f84d96);
}
.tierOption[data-unavailable="true"],
.tierSelector:disabled .tierOption {
cursor: not-allowed;
}
.tierOption[data-unavailable="true"] {
filter: grayscale(0.25);
opacity: 0.56;
}
.tierSelector:disabled .tierOption {
opacity: 0.72;
}
.tierInput {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.tierOption:has(.tierInput:focus-visible) {
outline: 3px solid rgba(248, 77, 150, 0.28);
outline-offset: 3px;
}
.tierDetails,
.tierPriceBlock {
display: flex;
min-width: 0;
flex-direction: column;
}
.tierDetails {
gap: 4px;
}
.tierLabel {
color: #a36d73;
font-size: 10px;
font-weight: 900;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.tierName {
overflow: hidden;
color: #2a1b1e;
font-family: var(--font-athelas), Georgia, serif;
font-size: clamp(17px, 4.259vw, 21px);
font-weight: 750;
letter-spacing: -0.02em;
line-height: 1.05;
text-overflow: ellipsis;
white-space: nowrap;
}
.tierPriceBlock {
align-items: flex-end;
gap: 3px;
text-align: right;
}
.tierPrice {
color: #d23f79;
font-size: clamp(14px, 3.519vw, 17px);
font-weight: 950;
white-space: nowrap;
}
.tierUnavailable {
color: #8f7376;
font-size: 10px;
font-weight: 800;
}
.tierCheck {
display: grid;
width: 25px;
height: 25px;
place-items: center;
border: 1px solid rgba(111, 76, 73, 0.2);
border-radius: 999px;
color: transparent;
}
.tierOption[data-selected="true"] .tierCheck {
border-color: var(--color-accent, #f84d96);
background: var(--color-accent, #f84d96);
color: #ffffff;
box-shadow: 0 5px 14px rgba(248, 77, 150, 0.26);
}
.successCard {
display: flex;
align-items: center;
@@ -352,6 +502,10 @@
width: min(100%, 220px);
justify-self: center;
}
.tierName {
white-space: normal;
}
}
@media (hover: hover) {
@@ -359,6 +513,12 @@
.checkoutButton:not(:disabled):hover {
transform: translateY(-1px);
}
.tierSelector:not(:disabled)
.tierOption:not([data-unavailable="true"]):hover {
border-color: rgba(248, 77, 150, 0.42);
transform: translateY(-1px);
}
}
@keyframes floatIn {