Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2025-12-17 16:49:01 -06:00
parent 1b6401f468
commit 4dda80a900
6 changed files with 94 additions and 44 deletions

View File

@ -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;

View File

@ -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" : {

View File

@ -51,6 +51,9 @@ enum Design {
// Blackjack-specific
static let tableHeight: CGFloat = 280
// Settings - use CasinoDesign values
static let checkmark: CGFloat = CasinoDesign.Size.checkmark
}
}

View File

@ -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
}
}

View File

@ -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))
}
}
}
}

View File

@ -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