Compare commits
2 Commits
d6be2081c3
...
d5a70739ee
| Author | SHA1 | Date | |
|---|---|---|---|
| d5a70739ee | |||
| 612c4139af |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 35 KiB |
@@ -62,6 +62,28 @@ describe("PaymentMethodSelector", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("renders compact controls without the caption", () => {
|
||||||
|
const html = renderToStaticMarkup(
|
||||||
|
<PaymentMethodSelector
|
||||||
|
config={{
|
||||||
|
canChoosePaymentMethod: true,
|
||||||
|
initialPayChannel: "ezpay",
|
||||||
|
showPaymentMethodSelector: true,
|
||||||
|
}}
|
||||||
|
value="ezpay"
|
||||||
|
density="compact"
|
||||||
|
caption="This caption is hidden"
|
||||||
|
analyticsKey="tip.payment_method"
|
||||||
|
onChange={() => undefined}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(html).toContain('data-density="compact"');
|
||||||
|
expect(html).toContain("Payment Method");
|
||||||
|
expect(html).not.toContain("This caption is hidden");
|
||||||
|
expect(html).toContain("min-h-11");
|
||||||
|
});
|
||||||
|
|
||||||
it("does not render when payment method selection is unavailable", () => {
|
it("does not render when payment method selection is unavailable", () => {
|
||||||
const html = renderToStaticMarkup(
|
const html = renderToStaticMarkup(
|
||||||
<PaymentMethodSelector
|
<PaymentMethodSelector
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ const PAYMENT_METHODS: readonly {
|
|||||||
export interface PaymentMethodSelectorProps {
|
export interface PaymentMethodSelectorProps {
|
||||||
config: PaymentMethodConfig;
|
config: PaymentMethodConfig;
|
||||||
value: PayChannel;
|
value: PayChannel;
|
||||||
|
density?: "default" | "compact";
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
caption?: string;
|
caption?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -34,6 +35,7 @@ export interface PaymentMethodSelectorProps {
|
|||||||
export function PaymentMethodSelector({
|
export function PaymentMethodSelector({
|
||||||
config,
|
config,
|
||||||
value,
|
value,
|
||||||
|
density = "default",
|
||||||
disabled = false,
|
disabled = false,
|
||||||
caption = "Stripe by default",
|
caption = "Stripe by default",
|
||||||
className,
|
className,
|
||||||
@@ -41,6 +43,7 @@ export function PaymentMethodSelector({
|
|||||||
onChange,
|
onChange,
|
||||||
}: PaymentMethodSelectorProps) {
|
}: PaymentMethodSelectorProps) {
|
||||||
if (!config.showPaymentMethodSelector) return null;
|
if (!config.showPaymentMethodSelector) return null;
|
||||||
|
const isCompact = density === "compact";
|
||||||
|
|
||||||
const paymentMethods =
|
const paymentMethods =
|
||||||
config.initialPayChannel === "ezpay"
|
config.initialPayChannel === "ezpay"
|
||||||
@@ -51,26 +54,31 @@ export function PaymentMethodSelector({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
className={`flex flex-col gap-[clamp(8px,1.852vw,10px)] ${className ?? ""}`.trim()}
|
className={`flex flex-col ${isCompact ? "gap-1.5" : "gap-[clamp(8px,1.852vw,10px)]"} ${className ?? ""}`.trim()}
|
||||||
|
data-density={density}
|
||||||
aria-labelledby="payment-method-title"
|
aria-labelledby="payment-method-title"
|
||||||
>
|
>
|
||||||
<div className="flex items-baseline justify-between gap-sm px-xs">
|
<div
|
||||||
|
className={`flex items-baseline justify-between gap-sm ${isCompact ? "px-0.5" : "px-xs"}`}
|
||||||
|
>
|
||||||
<h2
|
<h2
|
||||||
id="payment-method-title"
|
id="payment-method-title"
|
||||||
className="m-0 text-(length:--responsive-card-title,var(--font-size-lg)) font-bold leading-[1.2] text-auth-text-primary"
|
className={`m-0 font-bold leading-[1.2] text-auth-text-primary ${isCompact ? "text-sm" : "text-(length:--responsive-card-title,var(--font-size-lg))"}`}
|
||||||
style={{ fontFamily: "var(--font-athelas), var(--font-system)" }}
|
style={{ fontFamily: "var(--font-athelas), var(--font-system)" }}
|
||||||
>
|
>
|
||||||
Payment Method
|
Payment Method
|
||||||
</h2>
|
</h2>
|
||||||
|
{!isCompact ? (
|
||||||
<span className="whitespace-nowrap text-(length:--responsive-caption,var(--font-size-sm)) leading-[1.2] text-text-secondary">
|
<span className="whitespace-nowrap text-(length:--responsive-caption,var(--font-size-sm)) leading-[1.2] text-text-secondary">
|
||||||
{caption}
|
{caption}
|
||||||
</span>
|
</span>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-2 gap-sm">
|
<div className="grid grid-cols-2 gap-sm">
|
||||||
{paymentMethods.map((method) => {
|
{paymentMethods.map((method) => {
|
||||||
const selected = method.channel === value;
|
const selected = method.channel === value;
|
||||||
const classes = [
|
const classes = [
|
||||||
"flex min-h-[clamp(54px,11.481vw,62px)] cursor-pointer items-center justify-center rounded-(--responsive-card-radius-sm,18px) px-[clamp(12px,2.593vw,14px)] py-[clamp(9px,1.852vw,10px)] text-center font-[inherit] text-[#3c3b3b] transition-[border-color,box-shadow,transform] duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:enabled:scale-98 disabled:cursor-not-allowed disabled:opacity-72",
|
`flex cursor-pointer items-center justify-center text-center font-[inherit] text-[#3c3b3b] transition-[border-color,box-shadow,transform] duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:enabled:scale-98 disabled:cursor-not-allowed disabled:opacity-72 ${isCompact ? "min-h-11 rounded-2xl px-2 py-1.5" : "min-h-[clamp(54px,11.481vw,62px)] rounded-(--responsive-card-radius-sm,18px) px-[clamp(12px,2.593vw,14px)] py-[clamp(9px,1.852vw,10px)]"}`,
|
||||||
selected
|
selected
|
||||||
? "border-2 border-[#f657a0] bg-[#fff4f9] shadow-[0_8px_18px_rgba(217,47,127,0.24),0_0_0_3px_rgba(217,47,127,0.18)] -translate-y-0.5"
|
? "border-2 border-[#f657a0] bg-[#fff4f9] shadow-[0_8px_18px_rgba(217,47,127,0.24),0_0_0_3px_rgba(217,47,127,0.18)] -translate-y-0.5"
|
||||||
: "border border-[rgba(246,87,160,0.18)] bg-white shadow-[0_5px_7px_0_rgba(247,89,168,0.08)]",
|
: "border border-[rgba(246,87,160,0.18)] bg-white shadow-[0_5px_7px_0_rgba(247,89,168,0.08)]",
|
||||||
@@ -97,7 +105,7 @@ export function PaymentMethodSelector({
|
|||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
width={122}
|
width={122}
|
||||||
height={29}
|
height={29}
|
||||||
className="block max-h-8.5 w-[min(100%,92px)] object-contain"
|
className={`block object-contain ${isCompact ? "max-h-7 w-[min(100%,80px)]" : "max-h-8.5 w-[min(100%,92px)]"}`}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span className="text-(length:--responsive-body,16px) font-bold leading-[1.1] text-[#1e1e1e]">
|
<span className="text-(length:--responsive-body,16px) font-bold leading-[1.1] text-[#1e1e1e]">
|
||||||
|
|||||||
@@ -20,14 +20,18 @@ const mocks = vi.hoisted(() => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("@/app/_components", () => ({
|
vi.mock("@/app/_components", () => ({
|
||||||
BackButton: () => null,
|
BackButton: () => <span data-testid="tip-back-button" />,
|
||||||
CharacterAvatar: () => null,
|
CharacterAvatar: ({ alt }: { alt: string }) => (
|
||||||
|
<span data-testid="tip-character-avatar">{alt}</span>
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
vi.mock("@/app/_components/core", () => ({
|
vi.mock("@/app/_components/core", () => ({
|
||||||
MobileShell: ({ children }: { children: React.ReactNode }) => children,
|
MobileShell: ({ children }: { children: React.ReactNode }) => children,
|
||||||
}));
|
}));
|
||||||
vi.mock("@/app/_components/payment/payment-method-selector", () => ({
|
vi.mock("@/app/_components/payment/payment-method-selector", () => ({
|
||||||
PaymentMethodSelector: () => null,
|
PaymentMethodSelector: ({ density }: { density?: string }) => (
|
||||||
|
<span data-testid="tip-payment-method" data-density={density} />
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
vi.mock("@/app/_hooks/use-payment-method-selection", () => ({
|
vi.mock("@/app/_hooks/use-payment-method-selection", () => ({
|
||||||
usePaymentMethodSelection: () => undefined,
|
usePaymentMethodSelection: () => undefined,
|
||||||
@@ -85,10 +89,20 @@ vi.mock("../tip-checkout-button", () => ({
|
|||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
vi.mock("../tip-gift-product-selector", () => ({
|
vi.mock("../tip-gift-product-selector", () => ({
|
||||||
TipGiftProductSelector: () => null,
|
TipGiftProductSelector: ({
|
||||||
|
products,
|
||||||
|
}: {
|
||||||
|
products: readonly { planId: string; planName: string }[];
|
||||||
|
}) => (
|
||||||
|
<span data-testid="tip-product-selector">
|
||||||
|
{products.map((product) => product.planName).join(",")}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
vi.mock("../tip-product-image", () => ({
|
vi.mock("../tip-product-image", () => ({
|
||||||
TipProductImage: ({ alt }: { alt: string }) => <span>{alt}</span>,
|
TipProductImage: ({ alt }: { alt: string }) => (
|
||||||
|
<span data-testid="tip-product-image">{alt}</span>
|
||||||
|
),
|
||||||
}));
|
}));
|
||||||
vi.mock("../use-tip-support-prompt", () => ({
|
vi.mock("../use-tip-support-prompt", () => ({
|
||||||
useTipSupportPrompt: () => ({
|
useTipSupportPrompt: () => ({
|
||||||
@@ -174,12 +188,30 @@ describe("TipScreen checkout", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("renders the compact purchase flow with character atmosphere", () => {
|
||||||
|
renderScreen();
|
||||||
|
|
||||||
|
expect(container.textContent).toContain("Send Maya a gift");
|
||||||
|
expect(container.textContent).toContain("A warm coffee prompt.");
|
||||||
|
expect(container.querySelector('[data-testid="tip-back-button"]')).not.toBeNull();
|
||||||
|
expect(container.querySelector('[data-testid="tip-character-avatar"]')).not.toBeNull();
|
||||||
|
expect(container.querySelector('[data-testid="tip-product-image"]')).not.toBeNull();
|
||||||
|
expect(container.querySelector('[data-testid="tip-product-selector"]')).not.toBeNull();
|
||||||
|
expect(
|
||||||
|
container
|
||||||
|
.querySelector('[data-testid="tip-payment-method"]')
|
||||||
|
?.getAttribute("data-density"),
|
||||||
|
).toBe("compact");
|
||||||
|
expect(container.textContent).not.toContain("A little sweetness for today");
|
||||||
|
expect(container.textContent).not.toContain("Tip Maya");
|
||||||
|
expect(
|
||||||
|
container
|
||||||
|
.querySelector("main")
|
||||||
|
?.getAttribute("style"),
|
||||||
|
).toContain('--tip-cover-image: url("/images/cover/maya.png")');
|
||||||
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
["catalog is loading", { isLoadingPlans: true }],
|
|
||||||
[
|
|
||||||
"the selected product is missing",
|
|
||||||
{ plans: [], giftProducts: [], selectedPlanId: "" },
|
|
||||||
],
|
|
||||||
["an order is being created", { isCreatingOrder: true }],
|
["an order is being created", { isCreatingOrder: true }],
|
||||||
["an order is being polled", { isPollingOrder: true }],
|
["an order is being polled", { isPollingOrder: true }],
|
||||||
] as const)("disables checkout when %s", (_label, overrides) => {
|
] as const)("disables checkout when %s", (_label, overrides) => {
|
||||||
@@ -188,6 +220,38 @@ describe("TipScreen checkout", () => {
|
|||||||
expect(getCheckoutButton().disabled).toBe(true);
|
expect(getCheckoutButton().disabled).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
["catalog is loading", { isLoadingPlans: true }],
|
||||||
|
[
|
||||||
|
"the catalog is empty",
|
||||||
|
{ plans: [], giftProducts: [], selectedPlanId: "" },
|
||||||
|
],
|
||||||
|
] as const)("hides payment controls when %s", (_label, overrides) => {
|
||||||
|
mocks.payment = makePaymentState(overrides);
|
||||||
|
renderScreen();
|
||||||
|
|
||||||
|
expect(container.querySelector('[data-testid="tip-checkout"]')).toBeNull();
|
||||||
|
expect(container.querySelector('[data-testid="tip-payment-method"]')).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("shows a compact retry state when the catalog fails", () => {
|
||||||
|
mocks.payment = makePaymentState({
|
||||||
|
plans: [],
|
||||||
|
giftProducts: [],
|
||||||
|
selectedPlanId: "",
|
||||||
|
errorMessage: "catalog unavailable",
|
||||||
|
});
|
||||||
|
renderScreen();
|
||||||
|
|
||||||
|
expect(container.textContent).toContain(
|
||||||
|
"We could not load gifts for this character.",
|
||||||
|
);
|
||||||
|
act(() => getButton("Try again").click());
|
||||||
|
expect(mocks.paymentDispatch).toHaveBeenCalledWith({
|
||||||
|
type: "PaymentCatalogRetryRequested",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("shows fixed copy for the first character Tip", () => {
|
it("shows fixed copy for the first character Tip", () => {
|
||||||
mocks.payment = makePaymentState({
|
mocks.payment = makePaymentState({
|
||||||
status: "paid",
|
status: "paid",
|
||||||
|
|||||||
+299
-307
@@ -1,186 +1,162 @@
|
|||||||
.shell {
|
.shell {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: var(--app-viewport-height, 100dvh);
|
||||||
min-height: var(--app-viewport-height, 100dvh);
|
min-height: var(--app-viewport-height, 100dvh);
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-direction: column;
|
||||||
padding:
|
padding:
|
||||||
calc(var(--app-safe-top, 0px) + clamp(18px, 4.444vw, 24px))
|
calc(var(--app-safe-top, 0px) + 14px)
|
||||||
calc(var(--app-safe-right, 0px) + clamp(20px, 5.556vw, 30px))
|
calc(var(--app-safe-right, 0px) + clamp(14px, 4vw, 22px))
|
||||||
calc(var(--app-safe-bottom, 0px) + clamp(24px, 6.667vw, 36px))
|
calc(var(--app-safe-bottom, 0px) + 14px)
|
||||||
calc(var(--app-safe-left, 0px) + clamp(20px, 5.556vw, 30px));
|
calc(var(--app-safe-left, 0px) + clamp(14px, 4vw, 22px));
|
||||||
overflow: hidden auto;
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
background:
|
background:
|
||||||
radial-gradient(circle at 18% 12%, rgba(255, 181, 105, 0.34), transparent 32%),
|
radial-gradient(circle at 88% 8%, rgba(255, 116, 151, 0.14), transparent 28%),
|
||||||
radial-gradient(circle at 86% 24%, rgba(255, 85, 139, 0.2), transparent 30%),
|
linear-gradient(180deg, #fff2e8 0%, #fff9f4 58%, #ffffff 100%);
|
||||||
linear-gradient(180deg, #fff2e8 0%, #fff8f2 46%, #ffffff 100%);
|
|
||||||
color: #25191b;
|
color: #25191b;
|
||||||
}
|
isolation: isolate;
|
||||||
|
|
||||||
.bgImage,
|
|
||||||
.bgGlowOne,
|
|
||||||
.bgGlowTwo {
|
|
||||||
position: absolute;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bgImage {
|
.bgImage {
|
||||||
inset: 0 0 auto;
|
position: absolute;
|
||||||
height: 330px;
|
|
||||||
background:
|
|
||||||
linear-gradient(180deg, rgba(255, 242, 232, 0.3), #fff2e8 96%),
|
|
||||||
var(--tip-cover-image) center 18% / cover no-repeat;
|
|
||||||
opacity: 0.36;
|
|
||||||
filter: saturate(0.95) blur(0.2px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgGlowOne,
|
|
||||||
.bgGlowTwo {
|
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
border-radius: 999px;
|
inset: 0 0 auto;
|
||||||
filter: blur(10px);
|
height: clamp(230px, 42vh, 330px);
|
||||||
}
|
background:
|
||||||
|
linear-gradient(
|
||||||
.bgGlowOne {
|
180deg,
|
||||||
top: 192px;
|
rgba(255, 242, 232, 0.18) 0%,
|
||||||
right: -86px;
|
rgba(255, 246, 239, 0.5) 62%,
|
||||||
width: 190px;
|
#fff9f4 100%
|
||||||
height: 190px;
|
),
|
||||||
background: rgba(255, 92, 142, 0.16);
|
var(--tip-cover-image) center 20% / cover no-repeat;
|
||||||
}
|
filter: saturate(0.9);
|
||||||
|
opacity: 0.48;
|
||||||
.bgGlowTwo {
|
pointer-events: none;
|
||||||
bottom: 108px;
|
|
||||||
left: -98px;
|
|
||||||
width: 210px;
|
|
||||||
height: 210px;
|
|
||||||
background: rgba(255, 181, 104, 0.18);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header,
|
|
||||||
.hero,
|
|
||||||
.productCard,
|
|
||||||
.paymentMethodSlot,
|
|
||||||
.statusMessage,
|
|
||||||
.catalogStatus,
|
|
||||||
.checkoutSlot {
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
position: relative;
|
||||||
align-items: center;
|
z-index: 1;
|
||||||
justify-content: space-between;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerPill {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
min-height: 34px;
|
|
||||||
padding: 0 14px;
|
|
||||||
border: 1px solid rgba(255, 116, 151, 0.22);
|
|
||||||
border-radius: 999px;
|
|
||||||
background: rgba(255, 255, 255, 0.66);
|
|
||||||
color: #9b5360;
|
|
||||||
font-size: clamp(12px, 2.963vw, 14px);
|
|
||||||
font-weight: 850;
|
|
||||||
letter-spacing: 0.03em;
|
|
||||||
backdrop-filter: blur(18px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: clamp(18px, 5.185vw, 28px);
|
|
||||||
text-align: center;
|
|
||||||
animation: floatIn 0.5s ease both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatarRing {
|
|
||||||
display: grid;
|
display: grid;
|
||||||
width: clamp(88px, 22.222vw, 112px);
|
min-height: 46px;
|
||||||
height: clamp(88px, 22.222vw, 112px);
|
grid-template-columns: 42px minmax(0, 1fr) 42px;
|
||||||
place-items: center;
|
align-items: center;
|
||||||
border: 4px solid rgba(255, 255, 255, 0.9);
|
gap: 8px;
|
||||||
border-radius: 9999px;
|
}
|
||||||
background: linear-gradient(145deg, #ffbd7c, #ff5d91);
|
|
||||||
box-shadow:
|
.headerIdentity {
|
||||||
0 20px 44px rgba(255, 98, 133, 0.24),
|
display: flex;
|
||||||
inset 0 0 0 1px rgba(255, 255, 255, 0.32);
|
min-width: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerAvatar {
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
border: 2px solid rgba(255, 255, 255, 0.94);
|
||||||
|
border-radius: 999px;
|
||||||
|
background: #f3d3c3;
|
||||||
|
box-shadow: 0 8px 20px rgba(112, 65, 66, 0.16);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eyebrow {
|
.headerTitle {
|
||||||
margin: 16px 0 0;
|
max-width: 220px;
|
||||||
color: #b35d63;
|
margin: 0;
|
||||||
font-size: clamp(12px, 3.148vw, 15px);
|
overflow: hidden;
|
||||||
font-weight: 850;
|
color: #2a1a1d;
|
||||||
letter-spacing: 0.08em;
|
font-family: var(--font-athelas), Georgia, serif;
|
||||||
text-transform: uppercase;
|
font-size: clamp(18px, 5vw, 24px);
|
||||||
|
font-weight: 760;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
line-height: 1.05;
|
||||||
|
text-align: left;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.headerBalance {
|
||||||
max-width: 320px;
|
display: block;
|
||||||
margin: 8px 0 0;
|
width: 42px;
|
||||||
color: #231518;
|
height: 1px;
|
||||||
font-size: clamp(34px, 9.259vw, 48px);
|
|
||||||
font-weight: 950;
|
|
||||||
letter-spacing: -0.055em;
|
|
||||||
line-height: 0.92;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle {
|
.supportPrompt {
|
||||||
min-height: 4.56em;
|
position: relative;
|
||||||
max-width: 330px;
|
z-index: 1;
|
||||||
margin: 14px 0 0;
|
min-height: 3.7em;
|
||||||
color: #7c6062;
|
box-sizing: border-box;
|
||||||
font-size: clamp(14px, 3.704vw, 18px);
|
margin: 10px 0 0;
|
||||||
font-weight: 620;
|
padding: 9px 13px;
|
||||||
line-height: 1.52;
|
border: 1px solid rgba(255, 255, 255, 0.64);
|
||||||
opacity: 0.78;
|
border-radius: 18px;
|
||||||
|
background: rgba(255, 255, 255, 0.7);
|
||||||
|
color: #684d51;
|
||||||
|
font-size: clamp(12.5px, 3.45vw, 14px);
|
||||||
|
font-weight: 650;
|
||||||
|
line-height: 1.35;
|
||||||
|
text-align: center;
|
||||||
text-wrap: balance;
|
text-wrap: balance;
|
||||||
|
opacity: 0.78;
|
||||||
|
box-shadow: 0 10px 26px rgba(91, 55, 52, 0.08);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
transition: opacity 0.24s ease;
|
transition: opacity 0.24s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitleReady {
|
.supportPromptReady {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.purchaseFlow {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
display: flex;
|
||||||
|
min-height: 0;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.productCard {
|
.productCard {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(112px, 0.85fr) 1fr;
|
flex: 0 1 auto;
|
||||||
|
grid-template-columns: clamp(98px, 28vw, 118px) minmax(0, 1fr);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: clamp(16px, 4.444vw, 24px);
|
gap: 10px;
|
||||||
margin-top: clamp(24px, 7.407vw, 38px);
|
padding: 12px;
|
||||||
padding: clamp(18px, 5.185vw, 28px);
|
border: 1px solid rgba(118, 61, 55, 0.09);
|
||||||
border: 1px solid rgba(118, 61, 55, 0.08);
|
border-radius: 24px;
|
||||||
border-radius: clamp(30px, 8.148vw, 44px);
|
background: rgba(255, 255, 255, 0.86);
|
||||||
background:
|
|
||||||
linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 237, 223, 0.78)),
|
|
||||||
#ffffff;
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 26px 62px rgba(119, 72, 67, 0.13),
|
0 16px 36px rgba(119, 72, 67, 0.11),
|
||||||
inset 0 1px 0 rgba(255, 255, 255, 0.86);
|
inset 0 1px 0 rgba(255, 255, 255, 0.9);
|
||||||
animation: floatIn 0.5s 0.08s ease both;
|
backdrop-filter: blur(16px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.coffeeStage {
|
.coffeeStage {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
|
align-self: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: clamp(24px, 6.667vw, 32px);
|
border-radius: 20px;
|
||||||
background: #c59b7d;
|
background: #c59b7d;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 18px 34px rgba(102, 53, 39, 0.18),
|
0 10px 24px rgba(102, 53, 39, 0.16),
|
||||||
inset 0 0 0 1px rgba(126, 66, 57, 0.08);
|
inset 0 0 0 1px rgba(126, 66, 57, 0.08);
|
||||||
isolation: isolate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.coffeeStage::after {
|
.coffeeStage::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: 1;
|
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
|
||||||
content: "";
|
content: "";
|
||||||
@@ -193,39 +169,6 @@
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.productCopy {
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.productBadge {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 7px;
|
|
||||||
padding: 8px 11px;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: rgba(255, 91, 142, 0.1);
|
|
||||||
color: #b84d65;
|
|
||||||
font-size: clamp(11px, 2.778vw, 13px);
|
|
||||||
font-weight: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.productName {
|
|
||||||
margin: 15px 0 0;
|
|
||||||
color: #231719;
|
|
||||||
font-size: clamp(28px, 7.407vw, 40px);
|
|
||||||
font-weight: 950;
|
|
||||||
letter-spacing: -0.045em;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.productPrice {
|
|
||||||
margin: 10px 0 0;
|
|
||||||
color: #ff4f86;
|
|
||||||
font-size: clamp(25px, 6.667vw, 36px);
|
|
||||||
font-weight: 950;
|
|
||||||
letter-spacing: -0.04em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visuallyHidden {
|
.visuallyHidden {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
@@ -239,69 +182,55 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tierSelector {
|
.tierSelector {
|
||||||
grid-column: 1 / -1;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
margin: 2px 0 0;
|
min-height: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
border: 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 {
|
.tierList {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
max-height: 176px;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 2px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierOption {
|
.tierOption {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr) auto 28px;
|
min-height: 50px;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto 20px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 7px;
|
||||||
min-height: 72px;
|
box-sizing: border-box;
|
||||||
padding: 12px 14px 12px 16px;
|
padding: 7px 8px 7px 10px;
|
||||||
border: 1px solid rgba(112, 71, 65, 0.12);
|
border: 1px solid rgba(112, 71, 65, 0.12);
|
||||||
border-radius: 20px;
|
border-radius: 15px;
|
||||||
background: rgba(255, 255, 255, 0.68);
|
background: rgba(255, 255, 255, 0.72);
|
||||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition:
|
transition:
|
||||||
border-color 0.18s ease,
|
border-color 0.16s ease,
|
||||||
background 0.18s ease,
|
background 0.16s ease,
|
||||||
box-shadow 0.18s ease,
|
box-shadow 0.16s ease,
|
||||||
transform 0.18s ease;
|
transform 0.16s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierOption[data-selected="true"] {
|
.tierOption[data-selected="true"] {
|
||||||
border-color: var(--color-accent, #f84d96);
|
border-color: var(--color-accent, #f84d96);
|
||||||
background:
|
background: #fff4f8;
|
||||||
linear-gradient(105deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 243, 0.9)),
|
|
||||||
#ffffff;
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 12px 28px rgba(248, 77, 150, 0.16),
|
0 7px 17px rgba(248, 77, 150, 0.13),
|
||||||
inset 3px 0 0 var(--color-accent, #f84d96);
|
inset 2px 0 0 var(--color-accent, #f84d96);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierOption[data-unavailable="true"],
|
|
||||||
.tierSelector:disabled .tierOption {
|
.tierSelector:disabled .tierOption {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
opacity: 0.68;
|
||||||
|
|
||||||
.tierOption[data-unavailable="true"] {
|
|
||||||
filter: grayscale(0.25);
|
|
||||||
opacity: 0.56;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tierSelector:disabled .tierOption {
|
|
||||||
opacity: 0.72;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierInput {
|
.tierInput {
|
||||||
@@ -317,8 +246,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tierOption:has(.tierInput:focus-visible) {
|
.tierOption:has(.tierInput:focus-visible) {
|
||||||
outline: 3px solid rgba(248, 77, 150, 0.28);
|
outline: 3px solid rgba(248, 77, 150, 0.26);
|
||||||
outline-offset: 3px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierDetails,
|
.tierDetails,
|
||||||
@@ -328,79 +257,72 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierDetails {
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tierName {
|
.tierName {
|
||||||
|
display: -webkit-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #2a1b1e;
|
color: #2a1b1e;
|
||||||
font-family: var(--font-athelas), Georgia, serif;
|
font-family: var(--font-athelas), Georgia, serif;
|
||||||
font-size: clamp(17px, 4.259vw, 21px);
|
font-size: clamp(13px, 3.7vw, 16px);
|
||||||
font-weight: 750;
|
font-weight: 750;
|
||||||
letter-spacing: -0.02em;
|
letter-spacing: -0.015em;
|
||||||
line-height: 1.05;
|
line-height: 1.05;
|
||||||
text-overflow: ellipsis;
|
-webkit-box-orient: vertical;
|
||||||
white-space: nowrap;
|
-webkit-line-clamp: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierPriceBlock {
|
.tierPriceBlock {
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
gap: 3px;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierPrice {
|
.tierPrice {
|
||||||
color: #d23f79;
|
color: #d23f79;
|
||||||
font-size: clamp(14px, 3.519vw, 17px);
|
font-size: clamp(12px, 3.2vw, 14px);
|
||||||
font-weight: 950;
|
font-weight: 900;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierUnavailable {
|
|
||||||
color: #8f7376;
|
|
||||||
font-size: 10px;
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tierCheck {
|
.tierCheck {
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 25px;
|
width: 19px;
|
||||||
height: 25px;
|
height: 19px;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
border: 1px solid rgba(111, 76, 73, 0.2);
|
border: 1px solid rgba(111, 76, 73, 0.2);
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tierCheck svg {
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.tierOption[data-selected="true"] .tierCheck {
|
.tierOption[data-selected="true"] .tierCheck {
|
||||||
border-color: var(--color-accent, #f84d96);
|
border-color: var(--color-accent, #f84d96);
|
||||||
background: var(--color-accent, #f84d96);
|
background: var(--color-accent, #f84d96);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
box-shadow: 0 5px 14px rgba(248, 77, 150, 0.26);
|
|
||||||
}
|
|
||||||
|
|
||||||
.statusMessage {
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.catalogStatus {
|
.catalogStatus {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
min-height: 180px;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
place-content: center;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-top: 20px;
|
padding: 20px;
|
||||||
padding: 22px;
|
|
||||||
border: 1px solid rgba(112, 71, 65, 0.1);
|
border: 1px solid rgba(112, 71, 65, 0.1);
|
||||||
border-radius: 24px;
|
border-radius: 22px;
|
||||||
background: rgba(255, 255, 255, 0.78);
|
background: rgba(255, 255, 255, 0.78);
|
||||||
color: #76575c;
|
color: #76575c;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
line-height: 1.5;
|
line-height: 1.45;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.catalogStatus p {
|
.catalogStatus p {
|
||||||
|
max-width: 270px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,11 +340,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.productSkeleton {
|
.productSkeleton {
|
||||||
min-height: 260px;
|
min-height: 174px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeletonImage,
|
.skeletonImage,
|
||||||
.skeletonCopy span {
|
.skeletonList span {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
100deg,
|
100deg,
|
||||||
rgba(205, 172, 157, 0.14) 20%,
|
rgba(205, 172, 157, 0.14) 20%,
|
||||||
@@ -436,50 +358,32 @@
|
|||||||
.skeletonImage {
|
.skeletonImage {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
border-radius: clamp(24px, 6.667vw, 32px);
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeletonCopy {
|
.skeletonList {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 12px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeletonCopy span {
|
.skeletonList span {
|
||||||
display: block;
|
display: block;
|
||||||
height: 18px;
|
min-height: 50px;
|
||||||
border-radius: 999px;
|
border-radius: 15px;
|
||||||
}
|
|
||||||
|
|
||||||
.skeletonCopy span:nth-child(2) {
|
|
||||||
width: 78%;
|
|
||||||
height: 38px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skeletonCopy span:nth-child(3) {
|
|
||||||
width: 56%;
|
|
||||||
height: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.statusMessage {
|
|
||||||
margin-top: 14px;
|
|
||||||
color: #b2474f;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 720;
|
|
||||||
line-height: 1.45;
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.paymentMethodSlot {
|
.paymentMethodSlot {
|
||||||
margin-top: clamp(18px, 5.185vw, 28px);
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkoutSlot {
|
.checkoutSlot {
|
||||||
margin-top: clamp(18px, 5.185vw, 28px);
|
flex: 0 0 auto;
|
||||||
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkoutButton {
|
.checkoutButton {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 58px;
|
min-height: 52px;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background:
|
background:
|
||||||
@@ -488,12 +392,12 @@
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: clamp(16px, 4.074vw, 19px);
|
font-size: clamp(15px, 4vw, 18px);
|
||||||
font-weight: 940;
|
font-weight: 900;
|
||||||
letter-spacing: -0.01em;
|
letter-spacing: -0.01em;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 18px 40px rgba(255, 83, 137, 0.28),
|
0 14px 30px rgba(255, 83, 137, 0.24),
|
||||||
0 8px 18px rgba(37, 23, 27, 0.18);
|
0 6px 14px rgba(37, 23, 27, 0.15);
|
||||||
transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
|
transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +405,7 @@
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
filter: grayscale(0.25);
|
filter: grayscale(0.25);
|
||||||
opacity: 0.62;
|
opacity: 0.62;
|
||||||
box-shadow: 0 10px 24px rgba(77, 52, 55, 0.12);
|
box-shadow: 0 8px 20px rgba(77, 52, 55, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkoutButton:not(:disabled):active {
|
.checkoutButton:not(:disabled):active {
|
||||||
@@ -509,51 +413,146 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.checkoutError {
|
.checkoutError {
|
||||||
margin: 10px 0 0;
|
margin: 7px 0 0;
|
||||||
color: #b2474f;
|
color: #b2474f;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
font-weight: 720;
|
font-weight: 700;
|
||||||
line-height: 1.45;
|
line-height: 1.35;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 380px) {
|
@media (max-width: 350px) {
|
||||||
.productCard {
|
.shell {
|
||||||
grid-template-columns: 1fr;
|
padding-right: calc(var(--app-safe-right, 0px) + 11px);
|
||||||
text-align: center;
|
padding-left: calc(var(--app-safe-left, 0px) + 11px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.coffeeStage {
|
.header {
|
||||||
width: min(100%, 220px);
|
grid-template-columns: 40px minmax(0, 1fr) 40px;
|
||||||
justify-self: center;
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerIdentity {
|
||||||
|
gap: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerTitle {
|
||||||
|
max-width: 170px;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productCard {
|
||||||
|
grid-template-columns: 82px minmax(0, 1fr);
|
||||||
|
gap: 7px;
|
||||||
|
padding: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierOption {
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto 18px;
|
||||||
|
gap: 5px;
|
||||||
|
padding-right: 6px;
|
||||||
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tierName {
|
.tierName {
|
||||||
white-space: normal;
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierPrice {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierCheck {
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-height: 700px) {
|
||||||
|
.shell {
|
||||||
|
padding-top: calc(var(--app-safe-top, 0px) + 9px);
|
||||||
|
padding-bottom: calc(var(--app-safe-bottom, 0px) + 9px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
min-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerAvatar {
|
||||||
|
width: 38px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purchaseFlow {
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.supportPrompt {
|
||||||
|
min-height: 0;
|
||||||
|
margin-top: 7px;
|
||||||
|
padding: 7px 11px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productCard {
|
||||||
|
grid-template-columns: 92px minmax(0, 1fr);
|
||||||
|
padding: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierList {
|
||||||
|
max-height: 148px;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierOption,
|
||||||
|
.skeletonList span {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkoutButton {
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-height: 600px) {
|
||||||
|
.supportPrompt {
|
||||||
|
display: -webkit-box;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productCard {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.coffeeStage,
|
||||||
|
.skeletonImage {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productSkeleton {
|
||||||
|
min-height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tierList {
|
||||||
|
max-height: 146px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.checkoutButton:not(:disabled):hover {
|
.checkoutButton:not(:disabled):hover,
|
||||||
transform: translateY(-1px);
|
.tierSelector:not(:disabled) .tierOption:hover {
|
||||||
}
|
|
||||||
|
|
||||||
.tierSelector:not(:disabled)
|
|
||||||
.tierOption:not([data-unavailable="true"]):hover {
|
|
||||||
border-color: rgba(248, 77, 150, 0.42);
|
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes floatIn {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
from {
|
.skeletonImage,
|
||||||
opacity: 0;
|
.skeletonList span {
|
||||||
transform: translateY(18px) scale(0.98);
|
animation: none;
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0) scale(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,10 +561,3 @@
|
|||||||
background-position: -120% 0;
|
background-position: -120% 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.skeletonImage,
|
|
||||||
.skeletonCopy span {
|
|
||||||
animation: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+43
-56
@@ -1,7 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, type CSSProperties } from "react";
|
import { useEffect, type CSSProperties } from "react";
|
||||||
import { Sparkles } from "lucide-react";
|
|
||||||
|
|
||||||
import { BackButton, CharacterAvatar } from "@/app/_components";
|
import { BackButton, CharacterAvatar } from "@/app/_components";
|
||||||
import { MobileShell } from "@/app/_components/core";
|
import { MobileShell } from "@/app/_components/core";
|
||||||
@@ -25,10 +24,7 @@ import { useUserState } from "@/stores/user/user-context";
|
|||||||
import { TipCheckoutButton } from "./tip-checkout-button";
|
import { TipCheckoutButton } from "./tip-checkout-button";
|
||||||
import { TipGiftProductSelector } from "./tip-gift-product-selector";
|
import { TipGiftProductSelector } from "./tip-gift-product-selector";
|
||||||
import { TipProductImage } from "./tip-product-image";
|
import { TipProductImage } from "./tip-product-image";
|
||||||
import {
|
import { getGiftImageSources } from "./tip-screen.helpers";
|
||||||
formatGiftPrice,
|
|
||||||
getGiftImageSources,
|
|
||||||
} from "./tip-screen.helpers";
|
|
||||||
import { TipSuccessView } from "./tip-success-view";
|
import { TipSuccessView } from "./tip-success-view";
|
||||||
import { useTipSupportPrompt } from "./use-tip-support-prompt";
|
import { useTipSupportPrompt } from "./use-tip-support-prompt";
|
||||||
import styles from "./tip-screen.module.css";
|
import styles from "./tip-screen.module.css";
|
||||||
@@ -214,8 +210,6 @@ export function TipScreen({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className={styles.bgImage} aria-hidden="true" />
|
<div className={styles.bgImage} aria-hidden="true" />
|
||||||
<div className={styles.bgGlowOne} aria-hidden="true" />
|
|
||||||
<div className={styles.bgGlowTwo} aria-hidden="true" />
|
|
||||||
|
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<BackButton
|
<BackButton
|
||||||
@@ -224,32 +218,32 @@ export function TipScreen({
|
|||||||
ariaLabel="Back to character home"
|
ariaLabel="Back to character home"
|
||||||
analyticsKey="tip.back_to_splash"
|
analyticsKey="tip.back_to_splash"
|
||||||
/>
|
/>
|
||||||
<span className={styles.headerPill}>{character.copy.tipHeader}</span>
|
<div className={styles.headerIdentity}>
|
||||||
</header>
|
<div className={styles.headerAvatar}>
|
||||||
|
|
||||||
<section className={styles.hero} aria-labelledby="tip-title">
|
|
||||||
<div className={styles.avatarRing}>
|
|
||||||
<CharacterAvatar
|
<CharacterAvatar
|
||||||
src={character.assets.avatar}
|
src={character.assets.avatar}
|
||||||
alt={character.displayName}
|
alt={character.displayName}
|
||||||
size="100%"
|
size="100%"
|
||||||
imageSize={88}
|
imageSize={44}
|
||||||
priority
|
priority
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className={styles.eyebrow}>A little sweetness for today</p>
|
<h1 id="tip-title" className={styles.headerTitle}>
|
||||||
<h1 id="tip-title" className={styles.title}>
|
|
||||||
{character.copy.tipTitle}
|
{character.copy.tipTitle}
|
||||||
</h1>
|
</h1>
|
||||||
|
</div>
|
||||||
|
<span className={styles.headerBalance} aria-hidden="true" />
|
||||||
|
</header>
|
||||||
|
|
||||||
<p
|
<p
|
||||||
className={`${styles.subtitle} ${
|
className={`${styles.supportPrompt} ${
|
||||||
supportPrompt.isReady ? styles.subtitleReady : ""
|
supportPrompt.isReady ? styles.supportPromptReady : ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{supportPrompt.prompt}
|
{supportPrompt.prompt}
|
||||||
</p>
|
</p>
|
||||||
</section>
|
|
||||||
|
|
||||||
|
<div className={styles.purchaseFlow}>
|
||||||
{payment.isLoadingPlans ? (
|
{payment.isLoadingPlans ? (
|
||||||
<section
|
<section
|
||||||
className={`${styles.productCard} ${styles.productSkeleton}`}
|
className={`${styles.productCard} ${styles.productSkeleton}`}
|
||||||
@@ -257,38 +251,31 @@ export function TipScreen({
|
|||||||
aria-busy="true"
|
aria-busy="true"
|
||||||
>
|
>
|
||||||
<div className={styles.skeletonImage} />
|
<div className={styles.skeletonImage} />
|
||||||
<div className={styles.skeletonCopy}>
|
<div className={styles.skeletonList}>
|
||||||
<span />
|
<span />
|
||||||
<span />
|
<span />
|
||||||
<span />
|
<span />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
) : selectedProduct ? (
|
) : selectedProduct ? (
|
||||||
<section className={styles.productCard} aria-label="Gift products">
|
<>
|
||||||
|
<section
|
||||||
|
className={styles.productCard}
|
||||||
|
aria-label="Gift products"
|
||||||
|
>
|
||||||
<div className={styles.coffeeStage}>
|
<div className={styles.coffeeStage}>
|
||||||
<TipProductImage
|
<TipProductImage
|
||||||
key={selectedProduct.planId}
|
key={selectedProduct.planId}
|
||||||
sources={getGiftImageSources(selectedProduct, selectedCategory)}
|
sources={getGiftImageSources(
|
||||||
|
selectedProduct,
|
||||||
|
selectedCategory,
|
||||||
|
)}
|
||||||
alt={selectedProduct.planName}
|
alt={selectedProduct.planName}
|
||||||
className={styles.coffeeImage}
|
className={styles.coffeeImage}
|
||||||
priority
|
priority
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.productCopy}>
|
|
||||||
<span className={styles.productBadge}>
|
|
||||||
<Sparkles size={14} aria-hidden="true" />
|
|
||||||
{selectedCategory?.name ?? "Gift"}
|
|
||||||
</span>
|
|
||||||
<h2 className={styles.productName}>{selectedProduct.planName}</h2>
|
|
||||||
<p className={styles.productPrice}>
|
|
||||||
{formatGiftPrice(
|
|
||||||
selectedProduct.amountCents,
|
|
||||||
selectedProduct.currency,
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<TipGiftProductSelector
|
<TipGiftProductSelector
|
||||||
disabled={isSelectionDisabled}
|
disabled={isSelectionDisabled}
|
||||||
products={visibleProducts}
|
products={visibleProducts}
|
||||||
@@ -296,9 +283,28 @@ export function TipScreen({
|
|||||||
selectedPlanId={payment.selectedPlanId}
|
selectedPlanId={payment.selectedPlanId}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
) : null}
|
|
||||||
|
|
||||||
{showCatalogError || showEmptyCatalog ? (
|
<PaymentMethodSelector
|
||||||
|
config={paymentMethodConfig}
|
||||||
|
value={payment.payChannel}
|
||||||
|
density="compact"
|
||||||
|
disabled={isPaymentBusy}
|
||||||
|
className={styles.paymentMethodSlot}
|
||||||
|
analyticsKey="tip.payment_method"
|
||||||
|
onChange={handlePaymentMethodChange}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className={styles.checkoutSlot}>
|
||||||
|
<TipCheckoutButton
|
||||||
|
giftCategory={payment.selectedGiftCategory}
|
||||||
|
giftPlanId={payment.selectedPlanId || null}
|
||||||
|
disabled={!canCreateOrder}
|
||||||
|
onOrder={handleOrder}
|
||||||
|
returnPath={returnPath}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : showCatalogError || showEmptyCatalog ? (
|
||||||
<section className={styles.catalogStatus} role="status">
|
<section className={styles.catalogStatus} role="status">
|
||||||
<p>
|
<p>
|
||||||
{showCatalogError
|
{showCatalogError
|
||||||
@@ -317,25 +323,6 @@ export function TipScreen({
|
|||||||
) : null}
|
) : null}
|
||||||
</section>
|
</section>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<PaymentMethodSelector
|
|
||||||
config={paymentMethodConfig}
|
|
||||||
value={payment.payChannel}
|
|
||||||
disabled={isPaymentBusy || !selectedProduct}
|
|
||||||
caption="GCash by default in the Philippines"
|
|
||||||
className={styles.paymentMethodSlot}
|
|
||||||
analyticsKey="tip.payment_method"
|
|
||||||
onChange={handlePaymentMethodChange}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.checkoutSlot}>
|
|
||||||
<TipCheckoutButton
|
|
||||||
giftCategory={payment.selectedGiftCategory}
|
|
||||||
giftPlanId={payment.selectedPlanId || null}
|
|
||||||
disabled={!canCreateOrder}
|
|
||||||
onOrder={handleOrder}
|
|
||||||
returnPath={returnPath}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</MobileShell>
|
</MobileShell>
|
||||||
|
|||||||
Reference in New Issue
Block a user