From 4dda80a90038fc5a598b7af866e50ec959402197 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 17 Dec 2025 16:49:01 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- Baccarat.xcodeproj/project.pbxproj | 2 + Blackjack/Resources/Localizable.xcstrings | 8 -- Blackjack/Theme/DesignConstants.swift | 3 + Blackjack/Views/BlackjackTableView.swift | 4 +- Blackjack/Views/SettingsView.swift | 113 +++++++++++++----- .../CasinoKit/Theme/CasinoDesign.swift | 8 +- 6 files changed, 94 insertions(+), 44 deletions(-) diff --git a/Baccarat.xcodeproj/project.pbxproj b/Baccarat.xcodeproj/project.pbxproj index 7401db5..c3c74c1 100644 --- a/Baccarat.xcodeproj/project.pbxproj +++ b/Baccarat.xcodeproj/project.pbxproj @@ -504,6 +504,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CODE_SIGN_ENTITLEMENTS = Blackjack/Blackjack.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -537,6 +538,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CODE_SIGN_ENTITLEMENTS = Blackjack/Blackjack.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; diff --git a/Blackjack/Resources/Localizable.xcstrings b/Blackjack/Resources/Localizable.xcstrings index c64b344..c31507f 100644 --- a/Blackjack/Resources/Localizable.xcstrings +++ b/Blackjack/Resources/Localizable.xcstrings @@ -725,10 +725,6 @@ "comment" : "Accessibility label for the dealer hand when there are no cards visible.", "isCommentAutoGenerated" : true }, - "deck" : { - "comment" : "A unit of measurement for a playing card deck.", - "isCommentAutoGenerated" : true - }, "DECK SETTINGS" : { "localizations" : { "en" : { @@ -751,10 +747,6 @@ } } }, - "decks" : { - "comment" : "The plural form of \"deck\".", - "isCommentAutoGenerated" : true - }, "DISPLAY" : { "localizations" : { "en" : { diff --git a/Blackjack/Theme/DesignConstants.swift b/Blackjack/Theme/DesignConstants.swift index 74ca33f..66e1893 100644 --- a/Blackjack/Theme/DesignConstants.swift +++ b/Blackjack/Theme/DesignConstants.swift @@ -51,6 +51,9 @@ enum Design { // Blackjack-specific static let tableHeight: CGFloat = 280 + + // Settings - use CasinoDesign values + static let checkmark: CGFloat = CasinoDesign.Size.checkmark } } diff --git a/Blackjack/Views/BlackjackTableView.swift b/Blackjack/Views/BlackjackTableView.swift index 55be6d7..3a6117a 100644 --- a/Blackjack/Views/BlackjackTableView.swift +++ b/Blackjack/Views/BlackjackTableView.swift @@ -201,9 +201,9 @@ struct PlayerHandsView: View { case 1, 2: return cardWidth case 3: - return cardWidth * 0.85 + return cardWidth * 0.90 default: // 4+ hands - return cardWidth * 0.75 + return cardWidth * 0.85 } } diff --git a/Blackjack/Views/SettingsView.swift b/Blackjack/Views/SettingsView.swift index 2811529..81b2739 100644 --- a/Blackjack/Views/SettingsView.swift +++ b/Blackjack/Views/SettingsView.swift @@ -172,11 +172,11 @@ struct GameStylePicker: View { HStack { VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) { Text(style.displayName) - .font(.system(size: Design.BaseFontSize.body, weight: .medium)) + .font(.system(size: Design.BaseFontSize.large, weight: .semibold)) .foregroundStyle(.white) Text(style.description) - .font(.system(size: Design.BaseFontSize.small)) + .font(.system(size: Design.BaseFontSize.body)) .foregroundStyle(.white.opacity(Design.Opacity.medium)) .lineLimit(2) } @@ -185,16 +185,28 @@ struct GameStylePicker: View { if selection == style { Image(systemName: "checkmark.circle.fill") + .font(.system(size: Design.Size.checkmark)) .foregroundStyle(Color.Settings.accent) + } else { + Circle() + .strokeBorder(Color.white.opacity(Design.Opacity.light), lineWidth: Design.LineWidth.medium) + .frame(width: Design.Size.checkmark, height: Design.Size.checkmark) } } - .padding(.vertical, Design.Spacing.small) + .padding() + .background( + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .fill(selection == style ? Color.Settings.accent.opacity(Design.Opacity.subtle) : Color.clear) + ) + .overlay( + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .strokeBorder( + selection == style ? Color.Settings.accent.opacity(Design.Opacity.medium) : Color.white.opacity(Design.Opacity.subtle), + lineWidth: Design.LineWidth.thin + ) + ) } .buttonStyle(.plain) - - if style != BlackjackStyle.allCases.last { - Divider().background(Color.white.opacity(Design.Opacity.hint)) - } } } } @@ -206,27 +218,45 @@ struct DeckCountPicker: View { @Binding var selection: DeckCount var body: some View { - LazyVGrid(columns: [ - GridItem(.flexible()), - GridItem(.flexible()), - GridItem(.flexible()) - ], spacing: Design.Spacing.small) { + VStack(spacing: Design.Spacing.medium) { ForEach(DeckCount.allCases) { count in Button { selection = count } label: { - VStack(spacing: Design.Spacing.xxSmall) { - Text("\(count.rawValue)") - .font(.system(size: Design.BaseFontSize.xLarge, weight: .bold)) - Text(count.rawValue == 1 ? "deck" : "decks") - .font(.system(size: Design.BaseFontSize.xSmall)) + HStack { + VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) { + Text(count.displayName) + .font(.system(size: Design.BaseFontSize.large, weight: .semibold)) + .foregroundStyle(.white) + + Text(count.description) + .font(.system(size: Design.BaseFontSize.body)) + .foregroundStyle(.white.opacity(Design.Opacity.medium)) + } + + Spacer() + + if selection == count { + Image(systemName: "checkmark.circle.fill") + .font(.system(size: Design.Size.checkmark)) + .foregroundStyle(Color.Settings.accent) + } else { + Circle() + .strokeBorder(Color.white.opacity(Design.Opacity.light), lineWidth: Design.LineWidth.medium) + .frame(width: Design.Size.checkmark, height: Design.Size.checkmark) + } } - .foregroundStyle(selection == count ? .black : .white) - .frame(maxWidth: .infinity) - .padding(.vertical, Design.Spacing.medium) + .padding() .background( - RoundedRectangle(cornerRadius: Design.CornerRadius.small) - .fill(selection == count ? Color.Settings.accent : Color.white.opacity(Design.Opacity.subtle)) + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .fill(selection == count ? Color.Settings.accent.opacity(Design.Opacity.subtle) : Color.clear) + ) + .overlay( + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .strokeBorder( + selection == count ? Color.Settings.accent.opacity(Design.Opacity.medium) : Color.white.opacity(Design.Opacity.subtle), + lineWidth: Design.LineWidth.thin + ) ) } .buttonStyle(.plain) @@ -249,28 +279,51 @@ struct TableLimitsPicker: View { HStack { VStack(alignment: .leading, spacing: Design.Spacing.xxSmall) { Text(limit.displayName) - .font(.system(size: Design.BaseFontSize.body, weight: .medium)) + .font(.system(size: Design.BaseFontSize.large, weight: .semibold)) .foregroundStyle(.white) - Text(limit.description) - .font(.system(size: Design.BaseFontSize.small)) + Text(limit.detailedDescription) + .font(.system(size: Design.BaseFontSize.body)) .foregroundStyle(.white.opacity(Design.Opacity.medium)) } Spacer() + // Limits badge pill + Text(limit.description) + .font(.system(size: Design.BaseFontSize.body, weight: .bold, design: .rounded)) + .foregroundStyle(selection == limit ? .black : Color.Settings.accent) + .padding(.horizontal, Design.Spacing.small) + .padding(.vertical, Design.Spacing.xSmall) + .background( + Capsule() + .fill(selection == limit ? Color.Settings.accent : Color.Settings.accent.opacity(Design.Opacity.hint)) + ) + if selection == limit { Image(systemName: "checkmark.circle.fill") + .font(.system(size: Design.Size.checkmark - 2)) .foregroundStyle(Color.Settings.accent) + } else { + Circle() + .strokeBorder(Color.white.opacity(Design.Opacity.light), lineWidth: Design.LineWidth.medium) + .frame(width: Design.Size.checkmark - 2, height: Design.Size.checkmark - 2) } } - .padding(.vertical, Design.Spacing.small) + .padding() + .background( + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .fill(selection == limit ? Color.Settings.accent.opacity(Design.Opacity.subtle) : Color.clear) + ) + .overlay( + RoundedRectangle(cornerRadius: Design.CornerRadius.medium) + .strokeBorder( + selection == limit ? Color.Settings.accent.opacity(Design.Opacity.medium) : Color.white.opacity(Design.Opacity.subtle), + lineWidth: Design.LineWidth.thin + ) + ) } .buttonStyle(.plain) - - if limit != TableLimits.allCases.last { - Divider().background(Color.white.opacity(Design.Opacity.hint)) - } } } } diff --git a/CasinoKit/Sources/CasinoKit/Theme/CasinoDesign.swift b/CasinoKit/Sources/CasinoKit/Theme/CasinoDesign.swift index f8a4676..11e8894 100644 --- a/CasinoKit/Sources/CasinoKit/Theme/CasinoDesign.swift +++ b/CasinoKit/Sources/CasinoKit/Theme/CasinoDesign.swift @@ -104,10 +104,10 @@ public enum CasinoDesign { public static let chipLarge: CGFloat = 60 /// Default card widths. - public static let cardWidthSmall: CGFloat = 45 - public static let cardWidthMedium: CGFloat = 55 - public static let cardWidthLarge: CGFloat = 65 - public static let cardWidth: CGFloat = 70 + public static let cardWidthSmall: CGFloat = 55 + public static let cardWidthMedium: CGFloat = 65 + public static let cardWidthLarge: CGFloat = 74 + public static let cardWidth: CGFloat = 80 /// Card overlap for stacking. public static let cardOverlap: CGFloat = -15