SwiftUI app against master API: link, profiles, browse, live TV, favorites sync, and TestFlight-ready assets. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
2.5 KiB
Swift
59 lines
2.5 KiB
Swift
import SwiftUI
|
|
|
|
enum McColors {
|
|
static let bg = Color(red: 0.035, green: 0.035, blue: 0.038)
|
|
static let bgElevated = Color(red: 0.075, green: 0.075, blue: 0.082)
|
|
static let surface = Color(red: 0.12, green: 0.12, blue: 0.13)
|
|
static let surfaceSoft = Color(red: 0.16, green: 0.16, blue: 0.175)
|
|
static let accent = Color(red: 0.898, green: 0.035, blue: 0.078)
|
|
static let accentSoft = Color(red: 0.898, green: 0.035, blue: 0.078).opacity(0.22)
|
|
static let text = Color(red: 0.96, green: 0.96, blue: 0.97)
|
|
static let textDim = Color(red: 0.62, green: 0.62, blue: 0.66)
|
|
static let danger = Color(red: 1.0, green: 0.42, blue: 0.42)
|
|
static let success = Color(red: 0.275, green: 0.827, blue: 0.412)
|
|
static let footer = Color(red: 0.05, green: 0.05, blue: 0.055).opacity(0.94)
|
|
}
|
|
|
|
enum McFonts {
|
|
static let brand = Font.system(size: 40, weight: .black, design: .rounded)
|
|
static let title = Font.system(size: 26, weight: .bold, design: .rounded)
|
|
static let headline = Font.system(size: 17, weight: .semibold, design: .rounded)
|
|
static let body = Font.system(size: 15, weight: .regular, design: .rounded)
|
|
static let caption = Font.system(size: 12, weight: .medium, design: .rounded)
|
|
}
|
|
|
|
struct McPrimaryButtonStyle: ButtonStyle {
|
|
func makeBody(configuration: Configuration) -> some View {
|
|
configuration.label
|
|
.font(McFonts.headline)
|
|
.foregroundStyle(.white)
|
|
.padding(.horizontal, 22)
|
|
.padding(.vertical, 13)
|
|
.background(
|
|
LinearGradient(
|
|
colors: [
|
|
McColors.accent,
|
|
McColors.accent.opacity(0.82),
|
|
],
|
|
startPoint: .topLeading,
|
|
endPoint: .bottomTrailing
|
|
)
|
|
.opacity(configuration.isPressed ? 0.75 : 1),
|
|
in: Capsule()
|
|
)
|
|
.shadow(color: McColors.accent.opacity(0.35), radius: configuration.isPressed ? 2 : 10, y: 4)
|
|
.scaleEffect(configuration.isPressed ? 0.98 : 1)
|
|
.animation(.easeOut(duration: 0.15), value: configuration.isPressed)
|
|
}
|
|
}
|
|
|
|
struct McSecondaryButtonStyle: ButtonStyle {
|
|
func makeBody(configuration: Configuration) -> some View {
|
|
configuration.label
|
|
.font(McFonts.headline)
|
|
.foregroundStyle(McColors.text)
|
|
.padding(.horizontal, 18)
|
|
.padding(.vertical, 12)
|
|
.background(McColors.surfaceSoft.opacity(configuration.isPressed ? 0.7 : 1), in: Capsule())
|
|
}
|
|
}
|