mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
parent
5fc633921a
commit
becf87591f
1 changed files with 16 additions and 12 deletions
|
|
@ -132,7 +132,7 @@ struct ContributorsView: View {
|
|||
@State private var isLoading = true
|
||||
@State private var error: Error?
|
||||
@State private var isAnimating = false
|
||||
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if isLoading {
|
||||
|
|
@ -230,7 +230,7 @@ struct ContributorsView: View {
|
|||
.font(.headline)
|
||||
.foregroundColor(
|
||||
contributor.login == "IBH-RAD" ? Color(hexTwo: "#41127b") :
|
||||
.accentColor
|
||||
.accentColor
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -313,21 +313,25 @@ struct AnimatedText: View {
|
|||
let text: String
|
||||
let primaryColor: Color
|
||||
let secondaryColor: Color
|
||||
@State private var gradientPosition: CGFloat = 0.0
|
||||
@State private var isAnimating = false
|
||||
|
||||
var body: some View {
|
||||
let animatedGradient = LinearGradient(
|
||||
colors: [primaryColor, secondaryColor, primaryColor],
|
||||
startPoint: UnitPoint(x: gradientPosition, y: 0.5),
|
||||
endPoint: UnitPoint(x: min(gradientPosition + 0.5, 1.0), y: 0.5)
|
||||
)
|
||||
Text(text)
|
||||
.font(.headline)
|
||||
.foregroundStyle(animatedGradient)
|
||||
.foregroundStyle(
|
||||
LinearGradient(
|
||||
colors: [
|
||||
primaryColor,
|
||||
secondaryColor,
|
||||
primaryColor
|
||||
],
|
||||
startPoint: isAnimating ? .trailing : .leading,
|
||||
endPoint: isAnimating ? .leading : .trailing
|
||||
)
|
||||
)
|
||||
.onAppear {
|
||||
gradientPosition = 0.0
|
||||
withAnimation(Animation.linear(duration: 2.0).repeatForever(autoreverses: false)) {
|
||||
gradientPosition = 1.0
|
||||
withAnimation(.linear(duration: 2.0).repeatForever(autoreverses: false)) {
|
||||
isAnimating = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue