Fix opponent swap animation instant shrink on mobile portrait

Let overlay card start at deck size and smoothly scale down to opponent
card size during the arc, instead of instantly shrinking before animating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken 2026-02-22 21:00:20 -05:00
parent 55006d6ff4
commit a0bb28d5eb

View File

@ -2807,16 +2807,7 @@ class GolfGame {
// Use unified swap animation // Use unified swap animation
if (window.cardAnimations) { if (window.cardAnimations) {
// For opponent swaps, size the held card to match the opponent card const heldRect = window.cardAnimations.getHoldingRect();
// rather than the deck size (default holding rect uses deck dimensions,
// which looks oversized next to small opponent cards on mobile)
const holdingRect = window.cardAnimations.getHoldingRect();
const heldRect = holdingRect ? {
left: holdingRect.left,
top: holdingRect.top,
width: sourceRect.width,
height: sourceRect.height
} : null;
window.cardAnimations.animateUnifiedSwap( window.cardAnimations.animateUnifiedSwap(
discardCard, // handCardData - card going to discard discardCard, // handCardData - card going to discard