diff --git a/Blackjack/Blackjack/Views/Table/DealerHandView.swift b/Blackjack/Blackjack/Views/Table/DealerHandView.swift index a302c89..501c80a 100644 --- a/Blackjack/Blackjack/Views/Table/DealerHandView.swift +++ b/Blackjack/Blackjack/Views/Table/DealerHandView.swift @@ -61,6 +61,14 @@ struct DealerHandView: View { } } .zIndex(Double(index)) + .transition( + .asymmetric( + insertion: .move(edge: .top) + .combined(with: .opacity) + .combined(with: .scale(scale: Design.Scale.slightShrink)), + removal: .scale.combined(with: .opacity) + ) + ) } // Show placeholder for second card in European mode (no hole card) @@ -70,6 +78,7 @@ struct DealerHandView: View { } } } + .animation(.spring(duration: Design.Animation.springDuration, bounce: Design.Animation.springBounce), value: hand.cards.count) .overlay(alignment: .bottom) { // Result badge - overlayed so it doesn't add height to the view if let result = hand.cards.count >= 2 && showHoleCard ? handResultText : nil { diff --git a/Blackjack/Blackjack/Views/Table/PlayerHandView.swift b/Blackjack/Blackjack/Views/Table/PlayerHandView.swift index 79bfc33..946c7ae 100644 --- a/Blackjack/Blackjack/Views/Table/PlayerHandView.swift +++ b/Blackjack/Blackjack/Views/Table/PlayerHandView.swift @@ -131,9 +131,18 @@ struct PlayerHandView: View { } } .zIndex(Double(index)) + .transition( + .asymmetric( + insertion: .move(edge: .top) + .combined(with: .opacity) + .combined(with: .scale(scale: Design.Scale.slightShrink)), + removal: .scale.combined(with: .opacity) + ) + ) } } } + .animation(.spring(duration: Design.Animation.springDuration, bounce: Design.Animation.springBounce), value: hand.cards.count) .padding(.horizontal, Design.Spacing.medium) .padding(.vertical, Design.Spacing.medium) .background(