300 lines
11 KiB
Swift
300 lines
11 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 callout: CGFloat = 13
|
|
static let medium: CGFloat = 14
|
|
static let subheadline: CGFloat = 15
|
|
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 chipSelector: CGFloat = 50
|
|
static let chipBadge: CGFloat = 32
|
|
static let chipBadgeInner: CGFloat = 28
|
|
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
|
|
static let roadMapCell: CGFloat = 16
|
|
static let diamondIcon: CGFloat = 24
|
|
static let topBetRowHeight: CGFloat = 52
|
|
static let mainBetRowHeight: CGFloat = 65
|
|
static let bonusZoneWidth: CGFloat = 80
|
|
}
|
|
|
|
// MARK: - Animation
|
|
|
|
enum Animation {
|
|
static let quick: Double = 0.3
|
|
static let springDuration: Double = 0.4
|
|
static let springBounce: Double = 0.3
|
|
static let cardFlipBounce: Double = 0.2
|
|
static let fadeInDuration: Double = 0.3
|
|
static let cardFlipDuration: Double = 0.5
|
|
static let selectionDuration: Double = 0.2
|
|
static let staggerDelay1: Double = 0.1
|
|
static let staggerDelay2: Double = 0.25
|
|
static let staggerDelay3: Double = 0.4
|
|
}
|
|
|
|
// MARK: - Opacity
|
|
|
|
enum Opacity {
|
|
static let verySubtle: Double = 0.05
|
|
static let subtle: Double = 0.1
|
|
static let selection: Double = 0.15
|
|
static let hint: Double = 0.2
|
|
static let quarter: Double = 0.25
|
|
static let light: Double = 0.3
|
|
static let overlay: Double = 0.4
|
|
static let medium: Double = 0.5
|
|
static let secondary: Double = 0.5
|
|
static let disabled: Double = 0.5
|
|
static let accent: Double = 0.6
|
|
static let strong: Double = 0.7
|
|
static let heavy: Double = 0.8
|
|
static let nearOpaque: Double = 0.85
|
|
static let almostFull: Double = 0.9
|
|
}
|
|
|
|
// MARK: - Scale Effects
|
|
|
|
enum Scale {
|
|
static let shrunk: Double = 0.5
|
|
static let slightShrink: Double = 0.8
|
|
static let normal: Double = 1.0
|
|
static let selected: Double = 1.1
|
|
}
|
|
|
|
// MARK: - Minimum Scale Factor (for text)
|
|
|
|
enum MinScaleFactor {
|
|
static let tight: Double = 0.5
|
|
static let comfortable: Double = 0.6
|
|
static let relaxed: Double = 0.7
|
|
}
|
|
|
|
// MARK: - Line Widths
|
|
|
|
enum LineWidth {
|
|
static let thin: CGFloat = 1
|
|
static let standard: CGFloat = 2
|
|
static let medium: CGFloat = 2
|
|
static let thick: CGFloat = 3
|
|
static let heavy: CGFloat = 4
|
|
}
|
|
|
|
// MARK: - Shadow
|
|
|
|
enum Shadow {
|
|
static let radiusSmall: CGFloat = 2
|
|
static let radiusMedium: CGFloat = 6
|
|
static let radiusLarge: CGFloat = 10
|
|
static let radiusXLarge: CGFloat = 12
|
|
static let radiusXXLarge: CGFloat = 30
|
|
|
|
static let offsetSmall: CGFloat = 1
|
|
static let offsetMedium: CGFloat = 3
|
|
static let offsetLarge: CGFloat = 5
|
|
}
|
|
}
|
|
|
|
// 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)
|
|
static let preview = Color(red: 0.0, green: 0.3, blue: 0.15)
|
|
}
|
|
|
|
// 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)
|
|
|
|
// Dragon Bonus (Purple/Blue gradient)
|
|
static let dragonBonusLight = Color(red: 0.25, green: 0.3, blue: 0.45)
|
|
static let dragonBonusDark = Color(red: 0.15, green: 0.2, blue: 0.35)
|
|
}
|
|
|
|
// 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)
|
|
|
|
// Chip base colors
|
|
static let tenBase = Color(red: 0.2, green: 0.4, blue: 0.8)
|
|
static let tenHighlight = Color(red: 0.3, green: 0.5, blue: 0.9)
|
|
static let twentyFiveBase = Color(red: 0.1, green: 0.6, blue: 0.3)
|
|
static let twentyFiveHighlight = Color(red: 0.2, green: 0.7, blue: 0.4)
|
|
static let fiftyBase = Color(red: 0.8, green: 0.5, blue: 0.1)
|
|
static let fiftyHighlight = Color(red: 0.9, green: 0.6, blue: 0.2)
|
|
static let hundredBase = Color(red: 0.1, green: 0.1, blue: 0.1)
|
|
static let hundredHighlight = Color(red: 0.3, green: 0.3, blue: 0.3)
|
|
static let fiveHundredBase = Color(red: 0.6, green: 0.2, blue: 0.6)
|
|
static let fiveHundredHighlight = Color(red: 0.7, green: 0.3, blue: 0.7)
|
|
static let thousandBase = Color(red: 0.8, green: 0.65, blue: 0.2)
|
|
static let thousandHighlight = Color(red: 0.9, green: 0.75, blue: 0.3)
|
|
static let fiveThousandBase = Color(red: 0.7, green: 0.1, blue: 0.2)
|
|
static let fiveThousandHighlight = Color(red: 0.85, green: 0.2, blue: 0.3)
|
|
static let tenThousandBase = Color(red: 0.2, green: 0.5, blue: 0.5)
|
|
static let tenThousandHighlight = Color(red: 0.3, green: 0.6, blue: 0.6)
|
|
static let twentyFiveThousandBase = Color(red: 0.5, green: 0.3, blue: 0.1)
|
|
static let twentyFiveThousandHighlight = Color(red: 0.65, green: 0.45, blue: 0.2)
|
|
static let fiftyThousandBase = Color(red: 0.75, green: 0.75, blue: 0.8)
|
|
static let fiftyThousandHighlight = Color(red: 0.85, green: 0.85, blue: 0.9)
|
|
static let hundredThousandBase = Color(red: 0.9, green: 0.1, blue: 0.3)
|
|
static let hundredThousandHighlight = Color(red: 1.0, green: 0.2, blue: 0.4)
|
|
|
|
// Accent stripe colors
|
|
static let goldStripe = Color(red: 0.9, green: 0.75, blue: 0.3)
|
|
static let darkStripe = Color(red: 0.2, green: 0.2, blue: 0.3)
|
|
static let goldRubyStripe = Color(red: 0.9, green: 0.85, blue: 0.3)
|
|
}
|
|
|
|
// MARK: - Card Colors
|
|
|
|
enum Card {
|
|
// Card back
|
|
static let backDark = Color(red: 0.6, green: 0.1, blue: 0.15)
|
|
static let backLight = Color(red: 0.4, green: 0.05, blue: 0.1)
|
|
static let patternLight = Color(red: 0.9, green: 0.7, blue: 0.4)
|
|
static let patternDark = Color(red: 0.7, green: 0.5, blue: 0.2)
|
|
static let innerDark = Color(red: 0.5, green: 0.08, blue: 0.12)
|
|
static let innerLight = Color(red: 0.35, green: 0.04, blue: 0.08)
|
|
static let diamondPattern = Color(red: 0.9, green: 0.7, blue: 0.4)
|
|
static let logoText = Color(red: 0.4, green: 0.05, blue: 0.1)
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
}
|
|
|