132 lines
4.6 KiB
Swift
132 lines
4.6 KiB
Swift
//
|
|
// DesignConstants.swift
|
|
// Blackjack
|
|
//
|
|
// Centralized design constants for the Blackjack app.
|
|
// Uses CasinoDesign from CasinoKit for shared values, with game-specific overrides.
|
|
//
|
|
|
|
import SwiftUI
|
|
import CasinoKit
|
|
|
|
// MARK: - Design Namespace
|
|
|
|
/// Design constants for the Blackjack app.
|
|
/// Shared constants are imported from CasinoDesign; game-specific values are defined here.
|
|
enum Design {
|
|
|
|
// MARK: - Shared Constants (from CasinoKit)
|
|
|
|
typealias Spacing = CasinoDesign.Spacing
|
|
typealias CornerRadius = CasinoDesign.CornerRadius
|
|
typealias LineWidth = CasinoDesign.LineWidth
|
|
typealias Shadow = CasinoDesign.Shadow
|
|
typealias Opacity = CasinoDesign.Opacity
|
|
typealias Animation = CasinoDesign.Animation
|
|
typealias Scale = CasinoDesign.Scale
|
|
typealias MinScaleFactor = CasinoDesign.MinScaleFactor
|
|
typealias BaseFontSize = CasinoDesign.BaseFontSize
|
|
typealias IconSize = CasinoDesign.IconSize
|
|
|
|
// MARK: - Blackjack-Specific Component Sizes
|
|
|
|
enum Size {
|
|
// Cards - slightly larger than medium for better visibility
|
|
static let cardWidth: CGFloat = 60
|
|
static let cardWidthSmall: CGFloat = CasinoDesign.Size.cardWidthSmall
|
|
static let cardOverlap: CGFloat = CasinoDesign.Size.cardOverlap
|
|
|
|
// Chips - use CasinoDesign values
|
|
static let chipBadgeSize: CGFloat = CasinoDesign.Size.chipBadge
|
|
|
|
// Buttons - use CasinoDesign values
|
|
static let actionButtonHeight: CGFloat = CasinoDesign.Size.actionButtonHeight
|
|
static let actionButtonMinWidth: CGFloat = CasinoDesign.Size.actionButtonMinWidth
|
|
static let bettingZoneHeight: CGFloat = CasinoDesign.Size.bettingZoneHeight
|
|
|
|
// Responsive - use CasinoDesign values
|
|
static let maxContentWidthPortrait: CGFloat = CasinoDesign.Size.maxContentWidthPortrait
|
|
static let maxContentWidthLandscape: CGFloat = CasinoDesign.Size.maxContentWidthLandscape
|
|
static let maxModalWidth: CGFloat = CasinoDesign.Size.maxModalWidth
|
|
|
|
// Blackjack-specific
|
|
static let tableHeight: CGFloat = 280
|
|
|
|
// Settings - use CasinoDesign values
|
|
static let checkmark: CGFloat = CasinoDesign.Size.checkmark
|
|
}
|
|
}
|
|
|
|
// MARK: - Blackjack App Colors
|
|
|
|
extension Color {
|
|
|
|
// MARK: - Table Colors (use CasinoTable from CasinoKit for consistency)
|
|
|
|
/// Typealias for consistent table colors across all games.
|
|
typealias Table = CasinoTable
|
|
|
|
// MARK: - Betting Zone Colors
|
|
|
|
enum BettingZone {
|
|
static let main = Color(red: 0.2, green: 0.4, blue: 0.3)
|
|
static let mainBorder = Color(red: 0.4, green: 0.6, blue: 0.4)
|
|
static let insurance = Color(red: 0.5, green: 0.4, blue: 0.2)
|
|
static let insuranceBorder = Color(red: 0.7, green: 0.6, blue: 0.3)
|
|
}
|
|
|
|
// MARK: - Hand Colors
|
|
|
|
enum Hand {
|
|
static let player = Color(red: 0.2, green: 0.5, blue: 0.8)
|
|
static let dealer = Color(red: 0.8, green: 0.3, blue: 0.3)
|
|
static let active = Color.yellow
|
|
static let inactive = Color.white.opacity(CasinoDesign.Opacity.medium)
|
|
}
|
|
|
|
// MARK: - Result Colors
|
|
|
|
enum Result {
|
|
static let win = Color.green
|
|
static let lose = Color.red
|
|
static let push = Color.blue
|
|
static let blackjack = Color.yellow
|
|
}
|
|
|
|
// MARK: - Action Button Colors
|
|
|
|
enum Button {
|
|
static let hit = Color(red: 0.2, green: 0.6, blue: 0.3)
|
|
static let stand = Color(red: 0.6, green: 0.4, blue: 0.1)
|
|
static let doubleDown = Color(red: 0.5, green: 0.3, blue: 0.6)
|
|
static let split = Color(red: 0.3, green: 0.5, blue: 0.7)
|
|
static let surrender = Color(red: 0.6, green: 0.3, blue: 0.3)
|
|
static let insurance = Color(red: 0.7, green: 0.6, blue: 0.2)
|
|
|
|
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)
|
|
}
|
|
|
|
// MARK: - Settings Colors
|
|
|
|
enum Settings {
|
|
static let background = Color(red: 0.08, green: 0.12, blue: 0.18)
|
|
static let cardBackground = Color.white.opacity(CasinoDesign.Opacity.verySubtle)
|
|
static let accent = Color(red: 0.9, green: 0.75, blue: 0.3)
|
|
}
|
|
|
|
// MARK: - Modal Colors
|
|
|
|
enum Modal {
|
|
static let background = Color(red: 0.12, green: 0.18, blue: 0.25)
|
|
static let backgroundLight = Color(red: 0.15, green: 0.2, blue: 0.3)
|
|
static let backgroundDark = Color(red: 0.1, green: 0.15, blue: 0.25)
|
|
}
|
|
|
|
// MARK: - TopBar Colors
|
|
|
|
enum TopBar {
|
|
static let balance = Color(red: 0.95, green: 0.85, blue: 0.4)
|
|
}
|
|
}
|