feat: for tvOS

This commit is contained in:
2026-02-26 22:45:05 +08:00
parent 03b7a8bf25
commit cd8c3afd7d
13 changed files with 208 additions and 6 deletions

View File

@@ -3,9 +3,17 @@ import SwiftUI
struct ContentCardView: View {
let item: ContentItem
#if os(tvOS)
private let cardWidth: CGFloat = 250
#else
private let cardWidth: CGFloat = 140
#endif
private let aspectRatio: CGFloat = 2.0 / 3.0
#if os(tvOS)
@Environment(\.isFocused) private var isFocused
#endif
var body: some View {
VStack(alignment: .leading, spacing: 6) {
//
@@ -54,6 +62,11 @@ struct ContentCardView: View {
}
}
.frame(width: cardWidth)
#if os(tvOS)
.scaleEffect(isFocused ? 1.1 : 1.0)
.shadow(color: isFocused ? .blue.opacity(0.4) : .clear, radius: 10)
.animation(.easeInOut(duration: 0.2), value: isFocused)
#endif
}
@ViewBuilder