chore: 加个preview
This commit is contained in:
parent
7adf475b8f
commit
776824b51d
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user