feat: 引入ready状态的lottie动画

This commit is contained in:
Junhui Chen 2025-09-10 15:19:24 +08:00
parent c4ed6c1116
commit b036f3d18e
2 changed files with 9 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ struct BlindBoxView: View {
withAnimation(.spring(response: 2.0, dampingFraction: 0.5, blendDuration: 0.8)) {
self.scale = 1.0
}
}
}
// MARK: - Computed Properties
@ -410,7 +410,7 @@ struct BlindBoxView: View {
VStack(spacing: 20) {
switch animationPhase {
case .loading:
LottieView(name: "loading", isPlaying: animationPhase == .loading && !showScalingOverlay)
LottieView(name: "ready", isPlaying: animationPhase == .loading && !showScalingOverlay)
.frame(width: 300, height: 300)
// .onAppear {
// DispatchQueue.main.asyncAfter(deadline: .now() + 6) {
@ -422,7 +422,7 @@ struct BlindBoxView: View {
case .ready:
ZStack {
LottieView(name: "data", isPlaying: animationPhase == .ready && !showScalingOverlay)
LottieView(name: "ready", isPlaying: animationPhase == .ready && !showScalingOverlay)
.frame(width: 300, height: 300)
// Add a transparent overlay to capture taps
@ -454,7 +454,7 @@ struct BlindBoxView: View {
case .opening:
ZStack {
if !showMedia {
LottieView(name: "open", loopMode: .playOnce, isPlaying: !showMedia)
LottieView(name: "ready", loopMode: .playOnce, isPlaying: !showMedia)
.frame(width: 300, height: 300)
.scaleEffect(scale)
}
@ -497,8 +497,11 @@ struct BlindBoxView: View {
case .none:
//
Color.clear
LottieView(name: "ready", loopMode: .loop, isPlaying: true)
.frame(width: 300, height: 300)
.scaleEffect(scale)
// Color.clear
// .frame(width: 300, height: 300)
// SVGImage(svgName: "BlindNone")
// .frame(width: 300, height: 300)
}