🎴 Arreglada animación de las cartas - La carta de rol ahora vuelve a su posición al soltarla

This commit is contained in:
Resistencia Dev
2025-12-08 20:49:05 +01:00
parent 6a6cf7628b
commit 31067bc168
2 changed files with 68 additions and 7 deletions

View File

@@ -213,15 +213,9 @@ export default function GameBoard({ gameState, currentPlayerId, actions }: GameB
drag="y"
dragConstraints={{ top: -300, bottom: 0 }}
dragElastic={0.2}
onDragEnd={(e, info) => {
// Reducir umbral a -50 para facilitar
if (info.offset.y < -50) {
setRevealCard(true);
}
}}
dragSnapToOrigin={true}
whileHover={{ scale: 1.02 }}
whileTap={{ scale: 0.98, cursor: 'grabbing' }}
animate={revealCard ? { y: -1000, opacity: 0 } : { y: 0, opacity: 1 }}
className="absolute inset-0 w-full h-full rounded-xl overflow-hidden shadow-2xl z-20 cursor-grab active:cursor-grabbing hover:ring-2 hover:ring-white/50 transition-all"
>
<Image