←返回作品
Motion Playground
8 个 SwiftUI 动效的 Web 复刻——拖滑块、看效果、对照原版 SwiftUI 写法。Motion 与 SwiftUI 的 spring 数学一致,参数互通。
ch. 1 · Animation.spring(duration:bounce:)live
Spring 调参台
拖动 duration 与 bounce,按按钮看物理弹簧——参数与 SwiftUI 完全互通。
ch. 4 · DragGesture.velocity → .interactiveSpringlive
下拉关闭 + velocity 接力
拖一张卡片往下滑——松手时看 translation 与 velocity 决定回弹还是关闭。
ch. 8 · .scrollTransition(.interactive)live
Scroll 跟手 3D 卡片
横向滚动卡片,rotation3D + scale + opacity 跟着 scroll 位置实时变。
ch. 10 · .glassEffect(.regular.tint(...))live
Liquid Glass 折射
浮动玻璃 capsule 在背景图上滑动 + 拖动 tint 看自适应折射。
ch. 8 · .visualEffect { content, geo in ... }live
Parallax 顶图
下拉放大、上滑视差——visualEffect 读 scroll offset 实时调整。
ch. 9 · .symbolEffect(.bounce, value:)live
Symbol Effects 切换
切换 7 种 SF Symbol 动画 case:bounce / pulse / variableColor / breathe / wiggle / rotate / scale。
ch. 7 · Canvas + TimelineView(.animation)live
Canvas 粒子爆发
点画布任意位置触发烟花——TimelineView + Canvas 物理积分,发光叠加 + alphaThreshold。
ch. 11 · Layout protocol + AnyLayoutlive
FlowLayout 标签流
增删 chip 看 spring 动画自动 reflow 换行——自定义 Layout 协议实战。
/