mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 23:54:32 +00:00
implement download feature
This commit is contained in:
parent
805f367c44
commit
fc82d5fe05
10 changed files with 533 additions and 78 deletions
|
|
@ -0,0 +1,28 @@
|
|||
import SwiftUI
|
||||
|
||||
struct SpinningCircleDownloadView: View {
|
||||
@State private var isRotating = false
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// Gray track
|
||||
Circle()
|
||||
.stroke(Color.gray.opacity(0.3), lineWidth: 3.5)
|
||||
|
||||
// Blue spinning segment
|
||||
Circle()
|
||||
.trim(from: 0, to: 0.25)
|
||||
.stroke(
|
||||
Color.accentColor,
|
||||
style: StrokeStyle(lineWidth: 3.5, lineCap: .round)
|
||||
)
|
||||
.rotationEffect(Angle(degrees: isRotating ? 360 : 0))
|
||||
.onAppear {
|
||||
withAnimation(.linear(duration: 1).repeatForever(autoreverses: false)) {
|
||||
isRotating = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: 16, height: 16)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue