From 15e963db19c2c84756586459e8563feb11fe3051 Mon Sep 17 00:00:00 2001 From: Austin Smith Date: Sat, 8 Aug 2026 16:33:13 -0700 Subject: [PATCH 1/4] use suit glyphs for royal cards --- .../Views/Cards/Styles/SimpleCardViews.swift | 56 +++---------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift b/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift index c4b609f..95dcb04 100644 --- a/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift +++ b/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift @@ -8,28 +8,6 @@ enum SimpleCardStyle { static let info = CardStyleInfo(title: "Simple", subtitle: "Clean") } -/// Royal artwork anchored to the bottom-right corner of the face, replacing -/// the center suit glyph. Cards without art keep the plain glyph face. -private enum SimpleCardArt { - static func imageName(for card: Card) -> String? { - switch (card.rank, card.suit) { - case (.queen, .hearts): "Simple/QueenOfHearts" - case (.queen, .clubs): "Simple/QueenOfClubs" - case (.queen, .spades): "Simple/QueenOfSpades" - case (.queen, .diamonds): "Simple/QueenOfDiamonds" - case (.jack, .hearts): "Simple/JackOfHearts" - case (.jack, .clubs): "Simple/JackOfClubs" - case (.jack, .spades): "Simple/JackOfSpades" - case (.jack, .diamonds): "Simple/JackOfDiamonds" - case (.king, .hearts): "Simple/KingOfHearts" - case (.king, .clubs): "Simple/KingOfClubs" - case (.king, .spades): "Simple/KingOfSpades" - case (.king, .diamonds): "Simple/KingOfDiamonds" - default: nil - } - } -} - private enum SimplePalette { static let face = Color.white static let red = Color(red: 0.80, green: 0.12, blue: 0.16) @@ -94,32 +72,14 @@ struct SimpleCardFrontView: View { .padding(cardSize.width * 0.08) .frame(width: cardSize.width, height: cardSize.height, alignment: Alignment.top) - if let artName = SimpleCardArt.imageName(for: card) { - // Royal figure planted in the bottom-right corner, dress and - // trailing arm trimmed by the card bounds; sized to stay - // clear of the top marks. Jack artwork carries extra headroom - // in its canvas, so it gets a small extra nudge into the - // corner to line up with the kings and queens. - let isJack = card.rank == .jack - Image(artName) - .resizable() - .scaledToFit() - .frame(width: cardSize.width * 0.88) - .offset(x: cardSize.width * (isJack ? 0.19 : 0.17), - y: cardSize.width * (isJack ? 0.36 : 0.32)) - .frame(width: cardSize.width, height: cardSize.height, alignment: Alignment.bottomTrailing) - .clipShape(RoundedRectangle(cornerRadius: chrome.cornerRadius, style: .continuous)) - .accessibilityHidden(true) - } else { - // Optically centered in the region below the top marks, not - // the full card, so the face doesn't read bottom-heavy. - Image(systemName: card.suit.symbolName) - .font(.system(size: cardSize.width * 0.56, weight: .regular)) - .foregroundStyle(inkColor) - .offset(y: cardSize.width * 0.14) - .frame(width: cardSize.width, height: cardSize.height, alignment: Alignment.center) - .accessibilityHidden(true) - } + // Optically centered in the region below the top marks, not + // the full card, so the face doesn't read bottom-heavy. + Image(systemName: card.suit.symbolName) + .font(.system(size: cardSize.width * 0.56, weight: .regular)) + .foregroundStyle(inkColor) + .offset(y: cardSize.width * 0.14) + .frame(width: cardSize.width, height: cardSize.height, alignment: Alignment.center) + .accessibilityHidden(true) } } } From b25f9e11db3d4b548b67844851f49f8276ef54db Mon Sep 17 00:00:00 2001 From: Austin Smith Date: Sat, 8 Aug 2026 19:19:35 -0700 Subject: [PATCH 2/4] soften simple card face to subtle cream --- ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift b/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift index 95dcb04..41858e2 100644 --- a/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift +++ b/ComputerSolitaire/Views/Cards/Styles/SimpleCardViews.swift @@ -9,7 +9,7 @@ enum SimpleCardStyle { } private enum SimplePalette { - static let face = Color.white + static let face = Color(red: 1.0, green: 0.989, blue: 0.958) static let red = Color(red: 0.80, green: 0.12, blue: 0.16) static let black = Color(red: 0.10, green: 0.10, blue: 0.12) static let backTrim = Color.white.opacity(0.7) From 6672d7dda4026e9a486a7750368c66029b24e9a3 Mon Sep 17 00:00:00 2001 From: Austin Smith Date: Sat, 8 Aug 2026 19:26:02 -0700 Subject: [PATCH 3/4] make simple card style the default --- ComputerSolitaire/Views/Cards/CardView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ComputerSolitaire/Views/Cards/CardView.swift b/ComputerSolitaire/Views/Cards/CardView.swift index 6697c04..28173df 100644 --- a/ComputerSolitaire/Views/Cards/CardView.swift +++ b/ComputerSolitaire/Views/Cards/CardView.swift @@ -17,7 +17,7 @@ enum CardStyle: String, CaseIterable, Identifiable { case simple case pixel - static let defaultValue: CardStyle = .classic + static let defaultValue: CardStyle = .simple var id: String { rawValue } From 722a4fc0558f22ffad0f0f4cd8550e898d3030bb Mon Sep 17 00:00:00 2001 From: Austin Smith Date: Sat, 8 Aug 2026 19:32:29 -0700 Subject: [PATCH 4/4] update card style default test for simple --- ComputerSolitaireTests/Shared/CardStyleTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ComputerSolitaireTests/Shared/CardStyleTests.swift b/ComputerSolitaireTests/Shared/CardStyleTests.swift index 207970e..0db5e05 100644 --- a/ComputerSolitaireTests/Shared/CardStyleTests.swift +++ b/ComputerSolitaireTests/Shared/CardStyleTests.swift @@ -3,9 +3,9 @@ import XCTest @MainActor final class CardStyleTests: XCTestCase { - func testDefaultStyleIsClassic() { - XCTAssertEqual(CardStyle.defaultValue, .classic) - XCTAssertEqual(CardStyle.defaultValue.rawValue, "classic") + func testDefaultStyleIsSimple() { + XCTAssertEqual(CardStyle.defaultValue, .simple) + XCTAssertEqual(CardStyle.defaultValue.rawValue, "simple") } func testOnlyCurrentRawValuesResolveToStyles() {