CasinoGames/Baccarat/Theme/DesignConstants.swift

206 lines
6.2 KiB
Swift

//
// DesignConstants.swift
// Baccarat
//
// Design system constants for consistent styling across the app.
//
import SwiftUI
/// Design constants for the Baccarat app.
enum Design {
// MARK: - Spacing
enum Spacing {
static let xxSmall: CGFloat = 2
static let xSmall: CGFloat = 4
static let small: CGFloat = 8
static let medium: CGFloat = 12
static let large: CGFloat = 16
static let xLarge: CGFloat = 20
static let xxLarge: CGFloat = 24
static let xxxLarge: CGFloat = 32
}
// MARK: - Corner Radii
enum CornerRadius {
static let small: CGFloat = 8
static let medium: CGFloat = 10
static let large: CGFloat = 12
static let xLarge: CGFloat = 14
static let xxLarge: CGFloat = 20
static let xxxLarge: CGFloat = 28
}
// MARK: - Base Font Sizes
// These are base values for use with @ScaledMetric in views.
// They will scale automatically based on user accessibility settings.
enum BaseFontSize {
static let xxSmall: CGFloat = 7
static let xSmall: CGFloat = 9
static let small: CGFloat = 10
static let body: CGFloat = 12
static let medium: CGFloat = 14
static let large: CGFloat = 16
static let xLarge: CGFloat = 18
static let xxLarge: CGFloat = 20
static let title: CGFloat = 32
static let largeTitle: CGFloat = 36
static let display: CGFloat = 70
}
// MARK: - Icon Sizes
enum IconSize {
static let small: CGFloat = 12
static let medium: CGFloat = 16
static let large: CGFloat = 22
static let xLarge: CGFloat = 60
static let xxLarge: CGFloat = 70
}
// MARK: - Component Sizes
enum Size {
static let chipSmall: CGFloat = 36
static let chipMedium: CGFloat = 50
static let cardWidthSmall: CGFloat = 45
static let cardWidthMedium: CGFloat = 55
static let cardWidthLarge: CGFloat = 65
static let valueBadge: CGFloat = 26
static let checkmark: CGFloat = 22
static let tableAspectRatio: CGFloat = 1.6
}
// MARK: - Animation
enum Animation {
static let springDuration: Double = 0.4
static let springBounce: Double = 0.3
static let fadeInDuration: Double = 0.3
static let cardFlipDuration: Double = 0.5
}
// MARK: - Opacity
enum Opacity {
static let disabled: Double = 0.5
static let subtle: Double = 0.1
static let light: Double = 0.3
static let medium: Double = 0.5
static let strong: Double = 0.7
static let heavy: Double = 0.8
static let nearOpaque: Double = 0.85
}
// MARK: - Line Widths
enum LineWidth {
static let thin: CGFloat = 1
static let medium: CGFloat = 2
static let thick: CGFloat = 3
static let heavy: CGFloat = 4
}
// MARK: - Shadow
enum Shadow {
static let radiusSmall: CGFloat = 3
static let radiusMedium: CGFloat = 6
static let radiusLarge: CGFloat = 10
static let radiusXLarge: CGFloat = 12
static let radiusXXLarge: CGFloat = 30
}
}
// MARK: - App Colors
extension Color {
// MARK: - Table Colors
enum Table {
static let feltDark = Color(red: 0.0, green: 0.28, blue: 0.12)
static let feltLight = Color(red: 0.0, green: 0.35, blue: 0.18)
static let backgroundDark = Color(red: 0.01, green: 0.12, blue: 0.06)
static let backgroundLight = Color(red: 0.03, green: 0.25, blue: 0.12)
static let baseDark = Color(red: 0.02, green: 0.15, blue: 0.08)
}
// MARK: - Border Colors
enum Border {
static let goldLight = Color(red: 0.85, green: 0.7, blue: 0.35)
static let goldDark = Color(red: 0.65, green: 0.5, blue: 0.2)
static let gold = Color(red: 0.7, green: 0.55, blue: 0.25)
static let silver = Color(red: 0.6, green: 0.6, blue: 0.65)
}
// MARK: - Betting Zone Colors
enum BettingZone {
// Player (Blue)
static let playerLight = Color(red: 0.1, green: 0.25, blue: 0.55)
static let playerDark = Color(red: 0.05, green: 0.15, blue: 0.4)
static let playerMaxLight = Color(red: 0.08, green: 0.18, blue: 0.4)
static let playerMaxDark = Color(red: 0.04, green: 0.1, blue: 0.28)
// Banker (Red)
static let bankerLight = Color(red: 0.55, green: 0.12, blue: 0.12)
static let bankerDark = Color(red: 0.4, green: 0.08, blue: 0.08)
static let bankerMaxLight = Color(red: 0.4, green: 0.1, blue: 0.1)
static let bankerMaxDark = Color(red: 0.28, green: 0.06, blue: 0.06)
// Tie (Green)
static let tie = Color(red: 0.1, green: 0.45, blue: 0.25)
static let tieMax = Color(red: 0.08, green: 0.32, blue: 0.18)
}
// MARK: - Button Colors
enum Button {
static let goldLight = Color(red: 1.0, green: 0.85, blue: 0.3)
static let goldDark = Color(red: 0.9, green: 0.7, blue: 0.2)
static let destructive = Color(red: 0.6, green: 0.2, blue: 0.2)
}
// MARK: - Chip Colors
enum Chip {
static let gold = Color(red: 0.8, green: 0.65, blue: 0.2)
}
// MARK: - Modal Colors
enum Modal {
static let backgroundLight = Color(red: 0.12, green: 0.12, blue: 0.14)
static let backgroundDark = Color(red: 0.08, green: 0.08, blue: 0.1)
}
// MARK: - Settings Colors
enum Settings {
static let background = Color(red: 0.08, green: 0.12, blue: 0.08)
}
}
// MARK: - Localized Strings Helper
extension String {
/// Returns a localized string for the given key.
static func localized(_ key: String) -> String {
String(localized: String.LocalizationValue(key))
}
/// Returns a localized string with format arguments.
static func localized(_ key: String, _ arguments: CVarArg...) -> String {
let format = String(localized: String.LocalizationValue(key))
return String(format: format, arguments: arguments)
}
}