mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 00:22:12 +00:00
Fixed stretchy header + episode cells
This commit is contained in:
parent
e27de30bae
commit
e1261678f8
2 changed files with 0 additions and 23 deletions
|
|
@ -156,7 +156,6 @@ struct EpisodeCell: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension EpisodeCell {
|
private extension EpisodeCell {
|
||||||
|
|
||||||
var actionButtonsBackground: some View {
|
var actionButtonsBackground: some View {
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
@ -216,14 +215,9 @@ private extension EpisodeCell {
|
||||||
actionButtonsBackground
|
actionButtonsBackground
|
||||||
}
|
}
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.padding(.horizontal, 8)
|
|
||||||
.padding(.vertical, 8)
|
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.background(cellBackground)
|
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 15))
|
|
||||||
.contextMenu { contextMenuContent }
|
.contextMenu { contextMenuContent }
|
||||||
.swipeActions(edge: .trailing) {
|
.swipeActions(edge: .trailing) {
|
||||||
|
|
||||||
Button(action: { downloadEpisode() }) {
|
Button(action: { downloadEpisode() }) {
|
||||||
Label("Download", systemImage: "arrow.down.circle")
|
Label("Download", systemImage: "arrow.down.circle")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,6 @@ struct StretchyHeaderView: View {
|
||||||
if case .success(let response) = result {
|
if case .success(let response) = result {
|
||||||
let uiImage = response.image
|
let uiImage = response.image
|
||||||
backdropImage = uiImage
|
backdropImage = uiImage
|
||||||
let extractedColor = Color.ambientColor(from: uiImage)
|
|
||||||
localAmbientColor = extractedColor
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
alignment: .center
|
alignment: .center
|
||||||
|
|
@ -50,19 +48,6 @@ struct StretchyHeaderView: View {
|
||||||
.clipped()
|
.clipped()
|
||||||
.frame(height: height)
|
.frame(height: height)
|
||||||
.offset(y: offset)
|
.offset(y: offset)
|
||||||
|
|
||||||
LinearGradient(
|
|
||||||
gradient: Gradient(stops: [
|
|
||||||
.init(color: localAmbientColor.opacity(0.0), location: 0.0),
|
|
||||||
.init(color: localAmbientColor.opacity(0.1), location: 0.2),
|
|
||||||
.init(color: localAmbientColor.opacity(0.3), location: 0.7),
|
|
||||||
.init(color: localAmbientColor.opacity(0.6), location: 1.0)
|
|
||||||
]),
|
|
||||||
startPoint: .top,
|
|
||||||
endPoint: .bottom
|
|
||||||
)
|
|
||||||
.frame(height: 100)
|
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 0))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: headerHeight)
|
.frame(height: headerHeight)
|
||||||
|
|
@ -73,8 +58,6 @@ struct StretchyHeaderView: View {
|
||||||
if let response = try? await ImagePipeline.shared.image(for: request) {
|
if let response = try? await ImagePipeline.shared.image(for: request) {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
backdropImage = response
|
backdropImage = response
|
||||||
let extractedColor = Color.ambientColor(from: response)
|
|
||||||
localAmbientColor = extractedColor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue