From 31003110e1ea8c2ceccea000a33cf9548f767165 Mon Sep 17 00:00:00 2001 From: kurihada Date: Thu, 26 Feb 2026 16:33:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=BB=91=E5=8D=A1=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=B7=9D=E7=A6=BB=E8=87=AA=E9=80=82=E5=BA=94=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=EF=BC=8C=E5=B0=8F=E5=B1=8F=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E6=9B=B4=E9=A1=BA=E6=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SwipeableCard.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SwipeableCard.tsx b/src/components/SwipeableCard.tsx index 0b777f3..3e25774 100644 --- a/src/components/SwipeableCard.tsx +++ b/src/components/SwipeableCard.tsx @@ -13,7 +13,8 @@ import RestaurantCard from "./RestaurantCard"; import { Restaurant, SwipeDirection } from "@/types"; const SWIPE_THRESHOLD = 120; -const EXIT_X = 600; +const getExitX = () => + typeof window !== "undefined" ? window.innerWidth * 1.5 : 600; const ROTATION_RANGE = 18; interface SwipeableCardProps { @@ -66,7 +67,8 @@ export default function SwipeableCard({ const flyOut = (direction: SwipeDirection) => { if (isSwiping.current) return; isSwiping.current = true; - const exitX = direction === "right" ? EXIT_X : -EXIT_X; + const exit = getExitX(); + const exitX = direction === "right" ? exit : -exit; animate(x, exitX, { type: "spring", stiffness: 600,