Skip to content

Commit

Permalink
[Feature] animation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
solchan87 committed Sep 19, 2024
1 parent d31d3d1 commit d790f37
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ public struct BezierProgressBar: View {
.frame(height: self.height)
.frame(minWidth: self.minWidth)
.frame(
width: (proxy.size.width + self.minWidth) * min(self.progress, Constant.maxProgress),
width: (proxy.size.width) * min(self.progress, Constant.maxProgress),
alignment: .leading
)
.animation(self.animation, value: self.progress)
}
}
}
Expand Down Expand Up @@ -95,6 +96,10 @@ extension BezierProgressBar {
private var minWidth: CGFloat {
self.progress.isZero ? 0 : self.height
}

private var animation: Animation {
Animation.timingCurve(0.24, 0.1, 0.24, 1.0, duration: 1.0)
}
}

#Preview {
Expand Down

0 comments on commit d790f37

Please sign in to comment.