// // WerkoutTheme.swift // Werkout_ios // // Design system: iOS 26 Liquid Glass + Industrial Gym Aesthetic // import SwiftUI // MARK: - Design Tokens enum WerkoutTheme { // MARK: Colors static let background = Color.black static let surfaceCard = Color(white: 0.09) static let surfaceElevated = Color(white: 0.12) static let accent = Color("appColor") static let accentNeon = Color(red: 0.75, green: 0.35, blue: 1.0) static let success = Color(red: 0.0, green: 0.9, blue: 0.5) static let danger = Color(red: 1.0, green: 0.25, blue: 0.3) static let warning = Color(red: 1.0, green: 0.75, blue: 0.0) static let textPrimary = Color.white static let textSecondary = Color(white: 0.55) static let textMuted = Color(white: 0.35) static let divider = Color(white: 0.15) // MARK: Typography static let heroTitle = Font.system(size: 34, weight: .black, design: .rounded) static let sectionTitle = Font.system(size: 20, weight: .heavy, design: .rounded) static let cardTitle = Font.system(size: 17, weight: .bold) static let bodyText = Font.system(size: 15, weight: .medium) static let caption = Font.system(size: 12, weight: .semibold) static let stat = Font.system(size: 48, weight: .black, design: .monospaced) // MARK: Spacing static let xs: CGFloat = 4 static let sm: CGFloat = 8 static let md: CGFloat = 16 static let lg: CGFloat = 24 static let xl: CGFloat = 32 // MARK: Corner Radius static let cardRadius: CGFloat = 16 static let buttonRadius: CGFloat = 12 static let badgeRadius: CGFloat = 8 static let pillRadius: CGFloat = 20 } // MARK: - Reusable View Modifiers struct WerkoutCardModifier: ViewModifier { func body(content: Content) -> some View { content .padding(WerkoutTheme.md) .background(WerkoutTheme.surfaceCard) .clipShape(RoundedRectangle(cornerRadius: WerkoutTheme.cardRadius, style: .continuous)) .overlay( RoundedRectangle(cornerRadius: WerkoutTheme.cardRadius, style: .continuous) .strokeBorder(WerkoutTheme.divider, lineWidth: 0.5) ) } } struct WerkoutButtonModifier: ViewModifier { var color: Color = WerkoutTheme.accent func body(content: Content) -> some View { content .font(.system(size: 16, weight: .bold)) .foregroundStyle(.white) .padding(.horizontal, WerkoutTheme.lg) .padding(.vertical, WerkoutTheme.sm + 4) .background(color) .clipShape(RoundedRectangle(cornerRadius: WerkoutTheme.buttonRadius, style: .continuous)) } } struct WerkoutTextFieldModifier: ViewModifier { func body(content: Content) -> some View { content .padding(12) .background(WerkoutTheme.surfaceCard) .clipShape(RoundedRectangle(cornerRadius: WerkoutTheme.buttonRadius, style: .continuous)) .overlay( RoundedRectangle(cornerRadius: WerkoutTheme.buttonRadius, style: .continuous) .strokeBorder(WerkoutTheme.accent.opacity(0.3), lineWidth: 1) ) .foregroundStyle(WerkoutTheme.textPrimary) } } extension View { func werkoutCard() -> some View { modifier(WerkoutCardModifier()) } func werkoutButton(color: Color = WerkoutTheme.accent) -> some View { modifier(WerkoutButtonModifier(color: color)) } func werkoutTextField() -> some View { modifier(WerkoutTextFieldModifier()) } } // MARK: - Button Style struct WerkoutActionButtonStyle: ButtonStyle { var color: Color = WerkoutTheme.accent func makeBody(configuration: Configuration) -> some View { configuration.label .font(.system(size: 16, weight: .bold)) .foregroundStyle(.white) .padding(.horizontal, WerkoutTheme.lg) .padding(.vertical, WerkoutTheme.sm + 4) .background(color) .clipShape(RoundedRectangle(cornerRadius: WerkoutTheme.buttonRadius, style: .continuous)) .scaleEffect(configuration.isPressed ? 0.95 : 1.0) .animation(.easeInOut(duration: 0.15), value: configuration.isPressed) } }