chore: 加个preview

This commit is contained in:
Junhui Chen 2025-09-12 15:06:39 +08:00
parent 7adf475b8f
commit 776824b51d

View File

@ -47,3 +47,38 @@ struct BlindBoxLottieOnceView: UIViewRepresentable {
//
}
}
#if DEBUG
struct BlindBoxLottieOnceView_Previews: PreviewProvider {
static var previews: some View {
Group {
VStack(spacing: 16) {
Text("Opening • x1.0")
.font(.caption)
.foregroundColor(.gray)
BlindBoxLottieOnceView(name: "opening", animationSpeed: 1.0) {
print("Opening completed")
}
.frame(width: 300, height: 300)
.background(Color.themeTextWhiteSecondary)
}
.previewDisplayName("Opening • 1.0x")
VStack(spacing: 16) {
Text("Opening • x1.5")
.font(.caption)
.foregroundColor(.gray)
BlindBoxLottieOnceView(name: "opening", animationSpeed: 1.5) {
print("Opening completed (1.5x)")
}
.frame(width: 300, height: 300)
.background(Color.themeTextWhiteSecondary)
}
.previewDisplayName("Opening • 1.5x")
}
.padding()
.background(Color.themeTextWhiteSecondary)
}
}
#endif