summaryrefslogtreecommitdiff
path: root/Jel/Views/Item/ItemHeaderView.swift
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-01-11 20:44:49 -0500
committerShav Kinderlehrer <[email protected]>2024-01-11 20:44:49 -0500
commit6b8d3372d21149ed0efb4d43bf0cab44bd24f9a4 (patch)
treea6c393738b67dd753efe839aff59193da94b7bb3 /Jel/Views/Item/ItemHeaderView.swift
parent6edc39791a577a500c92f32361cf1e7d2590ec37 (diff)
downloadjel-6b8d3372d21149ed0efb4d43bf0cab44bd24f9a4.tar.gz
jel-6b8d3372d21149ed0efb4d43bf0cab44bd24f9a4.zip
Implement peopleView
Diffstat (limited to 'Jel/Views/Item/ItemHeaderView.swift')
-rw-r--r--Jel/Views/Item/ItemHeaderView.swift52
1 files changed, 52 insertions, 0 deletions
diff --git a/Jel/Views/Item/ItemHeaderView.swift b/Jel/Views/Item/ItemHeaderView.swift
new file mode 100644
index 0000000..4c2bbe3
--- /dev/null
+++ b/Jel/Views/Item/ItemHeaderView.swift
@@ -0,0 +1,52 @@
+//
+// ItemHeaderView.swift
+// Jel
+//
+// Created by zerocool on 12/23/23.
+//
+
+import SwiftUI
+import JellyfinKit
+
+struct ItemHeaderView: View {
+ var item: BaseItemDto
+
+ let overlayGradientMask = LinearGradient(gradient: Gradient(stops: [
+ .init(color: .clear, location: 0),
+ .init(color: .black, location: 0.3),
+ ]), startPoint: .bottom, endPoint: .top)
+ let overlayGradient = LinearGradient(gradient: Gradient(stops: [
+ .init(color: .black, location: 0),
+ .init(color: .clear, location: 0.5)
+ ]), startPoint: .bottom, endPoint: .top)
+
+ var body: some View {
+ ZStack(alignment: .bottom) {
+ StickyHeaderView(minHeight: 400) {
+ ItemIconView(item: item, imageType: "Backdrop", contentMode: .fill)
+ .setCornerRadius(0)
+ .overlay(overlayGradient)
+ }
+
+ HStack {
+ ItemIconView(item: item, imageType: "Logo", width: 200, height: 100, placeHolder: AnyView(Text(item.name ?? "Unknown").font(.title).bold().truncationMode(.middle)))
+ .setCornerRadius(0)
+ .shadow(radius: 10)
+ .frame(alignment: .leading)
+ Spacer()
+ ItemInfoView(item: item)
+ }
+ .padding([.leading, .trailing])
+ }
+// .scrollTransition {content, phase in
+// content
+// .scaleEffect(phase.isIdentity ? 1 : 2)
+// .opacity(phase.isIdentity ? 1 : 0.1)
+// .blur(radius: phase.isIdentity ? 0 : 50)
+// }
+ }
+}
+
+// #Preview {
+// ItemHeaderView(item: BaseItemDto())
+// }