feat: redesign all share cards, remove unused achievement types, fix sport selector
Redesign trip, progress, and achievement share cards with premium sports-media aesthetic. Remove unused milestone/context achievement card types (only used in debug exporter). Fix gold text unreadable in light mode. Fix sport selector to only show stroke on selected sport. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,8 +21,6 @@ enum ShareCardType: String, CaseIterable {
|
||||
case tripSummary
|
||||
case achievementSpotlight
|
||||
case achievementCollection
|
||||
case achievementMilestone
|
||||
case achievementContext
|
||||
case stadiumProgress
|
||||
}
|
||||
|
||||
@@ -124,6 +122,72 @@ struct ShareTheme: Identifiable, Hashable {
|
||||
static func theme(byId id: String) -> ShareTheme {
|
||||
all.first { $0.id == id } ?? .dark
|
||||
}
|
||||
|
||||
// MARK: - Derived Theme Properties
|
||||
|
||||
/// Glass panel fill — textColor at low opacity
|
||||
var surfaceColor: Color {
|
||||
textColor.opacity(0.08)
|
||||
}
|
||||
|
||||
/// Panel border — textColor at medium-low opacity
|
||||
var borderColor: Color {
|
||||
textColor.opacity(0.15)
|
||||
}
|
||||
|
||||
/// Glow effect color — accentColor at medium opacity
|
||||
var glowColor: Color {
|
||||
accentColor.opacity(0.4)
|
||||
}
|
||||
|
||||
/// Highlight gradient for accent elements
|
||||
var highlightGradient: [Color] {
|
||||
[accentColor, accentColor.opacity(0.6)]
|
||||
}
|
||||
|
||||
/// Mid-tone color derived from gradient endpoints for richer backgrounds
|
||||
var midGradientColor: Color {
|
||||
gradientColors.count >= 2
|
||||
? gradientColors[0].blendedWith(gradientColors[1], fraction: 0.5)
|
||||
: gradientColors.first ?? .black
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Color Blending Helper
|
||||
|
||||
extension Color {
|
||||
/// Simple blend between two colors at a given fraction (0 = self, 1 = other)
|
||||
func blendedWith(_ other: Color, fraction: Double) -> Color {
|
||||
let f = max(0, min(1, fraction))
|
||||
let c1 = UIColor(self).rgbaComponents
|
||||
let c2 = UIColor(other).rgbaComponents
|
||||
return Color(
|
||||
red: c1.r + (c2.r - c1.r) * f,
|
||||
green: c1.g + (c2.g - c1.g) * f,
|
||||
blue: c1.b + (c2.b - c1.b) * f,
|
||||
opacity: c1.a + (c2.a - c1.a) * f
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private extension UIColor {
|
||||
var rgbaComponents: (r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) {
|
||||
var r: CGFloat = 0
|
||||
var g: CGFloat = 0
|
||||
var b: CGFloat = 0
|
||||
var a: CGFloat = 0
|
||||
|
||||
if getRed(&r, green: &g, blue: &b, alpha: &a) {
|
||||
return (r, g, b, a)
|
||||
}
|
||||
|
||||
var white: CGFloat = 0
|
||||
if getWhite(&white, alpha: &a) {
|
||||
return (white, white, white, a)
|
||||
}
|
||||
|
||||
return (0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Share Errors
|
||||
|
||||
Reference in New Issue
Block a user