diff --git a/Blackjack/Blackjack/Views/Table/CardStackView.swift b/Blackjack/Blackjack/Views/Table/CardStackView.swift index cef4ea7..af0c525 100644 --- a/Blackjack/Blackjack/Views/Table/CardStackView.swift +++ b/Blackjack/Blackjack/Views/Table/CardStackView.swift @@ -30,22 +30,34 @@ struct CardStackView: View { /// This prevents width changes during dealing by pre-allocating placeholder space. let minimumCardSlots: Int + /// Whether placeholders should use staggered (overlapped) layout like dealt cards. + /// - `true`: Placeholders overlap using `cardSpacing` (use for bordered containers like player hand) + /// - `false`: Placeholders side-by-side (use for borderless containers like dealer hand) + let staggeredPlaceholders: Bool + /// Number of additional placeholders needed to reach minimum slots. private var placeholdersNeeded: Int { max(0, minimumCardSlots - cards.count) } + /// Spacing to use for empty placeholder state + private var placeholderSpacing: CGFloat { + staggeredPlaceholders ? cardSpacing : Design.Spacing.small + } + /// Scaled animation duration based on dealing speed. private var animationDuration: Double { Design.Animation.springDuration * dealingSpeed } var body: some View { - HStack(spacing: cards.isEmpty && placeholdersNeeded > 0 ? Design.Spacing.small : cardSpacing) { + // Use staggered or side-by-side spacing based on configuration + HStack(spacing: cards.isEmpty && placeholdersNeeded > 0 ? placeholderSpacing : cardSpacing) { if cards.isEmpty && placeholdersNeeded > 0 { // Show placeholders when empty - ForEach(0..