mirror of
https://github.com/yattee/yattee.git
synced 2025-04-29 08:20:33 +05:30
Controls gradient
This commit is contained in:
parent
bdb1f032a9
commit
3de18da7a7
@ -213,6 +213,7 @@ struct PlayerControls: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder var controlsBackground: some View {
|
@ViewBuilder var controlsBackground: some View {
|
||||||
|
ZStack {
|
||||||
if player.musicMode,
|
if player.musicMode,
|
||||||
let url = controlsBackgroundURL
|
let url = controlsBackgroundURL
|
||||||
{
|
{
|
||||||
@ -223,6 +224,15 @@ struct PlayerControls: View {
|
|||||||
} else if player.videoForDisplay == nil {
|
} else if player.videoForDisplay == nil {
|
||||||
Color.black
|
Color.black
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if model.presentingControls {
|
||||||
|
Rectangle()
|
||||||
|
.fill(
|
||||||
|
LinearGradient(stops: gradientStops, startPoint: .top, endPoint: .bottom)
|
||||||
|
)
|
||||||
|
.transition(.opacity)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var controlsBackgroundURL: URL? {
|
var controlsBackgroundURL: URL? {
|
||||||
@ -235,6 +245,15 @@ struct PlayerControls: View {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var gradientStops: [Gradient.Stop] {
|
||||||
|
[
|
||||||
|
Gradient.Stop(color: .black.opacity(0.3), location: 0.0),
|
||||||
|
Gradient.Stop(color: .clear, location: 0.33),
|
||||||
|
Gradient.Stop(color: .clear, location: 0.66),
|
||||||
|
Gradient.Stop(color: .black.opacity(0.3), location: 1)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
var timeline: some View {
|
var timeline: some View {
|
||||||
TimelineView(context: .player).foregroundColor(.primary)
|
TimelineView(context: .player).foregroundColor(.primary)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user