mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 08:32:00 +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 isLoading = true
|
||||||
@State private var error: Error?
|
@State private var error: Error?
|
||||||
@State private var isAnimating = false
|
@State private var isAnimating = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
Group {
|
||||||
if isLoading {
|
if isLoading {
|
||||||
|
|
@ -230,7 +230,7 @@ struct ContributorsView: View {
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.foregroundColor(
|
.foregroundColor(
|
||||||
contributor.login == "IBH-RAD" ? Color(hexTwo: "#41127b") :
|
contributor.login == "IBH-RAD" ? Color(hexTwo: "#41127b") :
|
||||||
.accentColor
|
.accentColor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,21 +313,25 @@ struct AnimatedText: View {
|
||||||
let text: String
|
let text: String
|
||||||
let primaryColor: Color
|
let primaryColor: Color
|
||||||
let secondaryColor: Color
|
let secondaryColor: Color
|
||||||
@State private var gradientPosition: CGFloat = 0.0
|
@State private var isAnimating = false
|
||||||
|
|
||||||
var body: some View {
|
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)
|
Text(text)
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.foregroundStyle(animatedGradient)
|
.foregroundStyle(
|
||||||
|
LinearGradient(
|
||||||
|
colors: [
|
||||||
|
primaryColor,
|
||||||
|
secondaryColor,
|
||||||
|
primaryColor
|
||||||
|
],
|
||||||
|
startPoint: isAnimating ? .trailing : .leading,
|
||||||
|
endPoint: isAnimating ? .leading : .trailing
|
||||||
|
)
|
||||||
|
)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
gradientPosition = 0.0
|
withAnimation(.linear(duration: 2.0).repeatForever(autoreverses: false)) {
|
||||||
withAnimation(Animation.linear(duration: 2.0).repeatForever(autoreverses: false)) {
|
isAnimating = true
|
||||||
gradientPosition = 1.0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue