Improve drag and drop animation.
This commit is contained in:
Binary file not shown.
@@ -39,9 +39,11 @@ export function ArrangePhase({ view, you, send }: Props) {
|
|||||||
const locked = you.ready
|
const locked = you.ready
|
||||||
|
|
||||||
// The arrow buttons reorder `order` and the cards glide to their new slot.
|
// The arrow buttons reorder `order` and the cards glide to their new slot.
|
||||||
// Drag-and-drop reorders instantly instead: a drag fires continuously, so
|
// A drag reorders live too, and the neighbors the dragged card passes should
|
||||||
// animating every crossing looks frantic — we suppress it while dragging.
|
// glide into the gap it opens — so animation stays on. Only the dragged card
|
||||||
const arrangeAnim = useCardAnimations(order, (c) => c.id, !dragging)
|
// itself is excluded (`dragId`): its inner wrapper already tracks the finger,
|
||||||
|
// so FLIP-sliding its box on top of that would fight the follow transform.
|
||||||
|
const arrangeAnim = useCardAnimations(order, (c) => c.id, true, dragId ?? undefined)
|
||||||
|
|
||||||
// Resync only if the deck's actual contents changed — every broadcast
|
// Resync only if the deck's actual contents changed — every broadcast
|
||||||
// creates a fresh array, and blindly resetting would wipe an in-progress
|
// creates a fresh array, and blindly resetting would wipe an in-progress
|
||||||
|
|||||||
Reference in New Issue
Block a user