mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-14 13:30:23 +00:00
this is ebtter?
This commit is contained in:
parent
6488c345c8
commit
a834e41570
2 changed files with 20 additions and 13 deletions
|
|
@ -31,7 +31,7 @@
|
|||
- [x] Streams support (Jellyfin/Plex like servers)
|
||||
- [x] External Metadata providers (TMDB, AniList)
|
||||
- [x] Background playback and Picture-in-Picture (PiP) support
|
||||
- [x] External media player support (VLC, Infuse, Outplayer, nPlayer, SenPlayer, IINA)
|
||||
- [x] External media player support (VLC, Infuse, Outplayer, nPlayer, SenPlayer, IINA, TracyPlayer)
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
|||
|
|
@ -8,16 +8,18 @@
|
|||
import SwiftUI
|
||||
|
||||
struct Shimmer: ViewModifier {
|
||||
@State private var phase: CGFloat = 0
|
||||
@State private var phase: CGFloat = -1
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.modifier(AnimatedMask(phase: phase).animation(
|
||||
Animation.linear(duration: 1.5)
|
||||
.repeatForever(autoreverses: false)
|
||||
))
|
||||
.modifier(AnimatedMask(phase: phase)
|
||||
.animation(
|
||||
Animation.linear(duration: 1.2)
|
||||
.repeatForever(autoreverses: false)
|
||||
)
|
||||
)
|
||||
.onAppear {
|
||||
phase = 0.8
|
||||
phase = 1.5
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -33,21 +35,26 @@ struct Shimmer: ViewModifier {
|
|||
content
|
||||
.overlay(
|
||||
GeometryReader { geo in
|
||||
let width = geo.size.width
|
||||
let shimmerStart = phase - 0.25
|
||||
let shimmerEnd = phase + 0.25
|
||||
Rectangle()
|
||||
.fill(
|
||||
LinearGradient(
|
||||
gradient: Gradient(stops: [
|
||||
.init(color: .clear, location: phase - 0.3),
|
||||
.init(color: .white.opacity(0.5), location: phase),
|
||||
.init(color: .clear, location: phase + 0.3)
|
||||
.init(color: Color.white.opacity(0.05), location: shimmerStart - 0.15),
|
||||
.init(color: Color.white.opacity(0.25), location: shimmerStart),
|
||||
.init(color: Color.white.opacity(0.85), location: phase),
|
||||
.init(color: Color.white.opacity(0.25), location: shimmerEnd),
|
||||
.init(color: Color.white.opacity(0.05), location: shimmerEnd + 0.15)
|
||||
]),
|
||||
startPoint: .leading,
|
||||
endPoint: .trailing
|
||||
)
|
||||
)
|
||||
.rotationEffect(.degrees(30))
|
||||
.offset(x: -geo.size.width)
|
||||
.offset(x: geo.size.width * 2 * phase)
|
||||
.blur(radius: 8)
|
||||
.rotationEffect(.degrees(20))
|
||||
.offset(x: -width * 0.7 + width * 2 * phase)
|
||||
}
|
||||
)
|
||||
.mask(content)
|
||||
|
|
|
|||
Loading…
Reference in a new issue