jel/Jel/Views/Library/Item/ItemHeaderView.swift
2023-12-24 02:36:14 -05:00

52 lines
1.3 KiB
Swift

//
// ItemHeaderView.swift
// Jel
//
// Created by zerocool on 12/23/23.
//
import SwiftUI
import JellyfinKit
struct ItemHeaderView: View {
@State var item: BaseItemDto
let overlayGradient = LinearGradient(gradient: Gradient(stops: [
.init(color: .clear, location: 0),
.init(color: .black, location: 0.3),
.init(color: .black, location: 0.7),
.init(color: .clear, location: 1)
]), startPoint: .bottom, endPoint: .top)
var body: some View {
ZStack(alignment: .bottom) {
LibraryIconView(library: item, imageType: "Backdrop", contentMode: .fill)
.hideCaption()
.setCornerRadius(0)
.mask(overlayGradient)
// .padding(.top, 50)
.background {
LibraryIconView(library: item, imageType: "Backdrop", contentMode: .fill)
.hideCaption()
.setCornerRadius(0)
.blur(radius: 50)
}
HStack {
LibraryIconView(library: item, imageType: "Logo", width: 200, height: 100, placeHolder: AnyView(Text(item.name ?? "Unknown").font(.title).bold().truncationMode(.middle)))
.hideCaption()
.setCornerRadius(0)
.shadow(radius: 10)
Spacer()
}
.frame(alignment: .leading)
.padding(.leading)
}
}
}
// #Preview {
// ItemHeaderView(item: BaseItemDto())
// }