Skip to content

API ​

  • createMotionInspector — 可选的开发检查、本地批次、所有权、绑定图和可重复的弹簧调整。

动画 ​

target 是一个视图或任何持有视图的东西(模板引用、ElementRef)。 animate()、decay()、stop()、set() 和序列步骤也接受目标数组。

animate() 选项还接受 haptic:light、medium、heavy、{ style, times } 或 false。反馈支持 iOS 和 Android,尊重设备设置。

动画 ​

什么animate()、decay()、sequence()和一个序列的步骤返回:await呢,读取finished,或者调用stop()。当播放到最后时,它会解析为 true;当它被停止或接管时,它会解析为 false,并且取消永远不会拒绝。序列设置/回调错误可以在取消其其他工作后拒绝 finished。

animate() 和 decay() 返回 PlaybackAnimation:基本生命周期加上 pause()、play()、可写 progress 和只读 paused/duration。序列和效果句柄保留基本 Animation 合同。

转变 ​

  • 弹簧:'smooth' | 'snappy' | 'bouncy'、{ bounce, duration, velocity } 或 { stiffness, damping, mass, velocity }。
  • 补间: { duration, ease, times, easeTrack }.
  • 时序: delay, repeat, repeatType: 'loop' | 'reverse', repeatDelay, stagger: number | { each, from }.
  • 层:layer: 'name' 在属性的其他动画之上播放; stop(target, properties, { layer }) 停止一层。
  • 每个属性:映射到其自身转换的任何属性名称。
  • 相对关键帧:{ relative: true } 添加平移/旋转偏移并将比例/不透明度乘以其起始值。

助手 ​

definePreset(name, preset)、presets、springs、origamiSpring({ friction, tension })、cubicBezier。有关注册和键入的名称,请参阅 自定义预设。

Vue ​

@rafaelaugusto/jolt/vue 是 NativeScript-Vue 3 的单独入口点:vAnimate (v-animate)、vPress (v-press)、JoltTransition、transitionHooks(props)、 useMotionScope()、useReducedMotion()、useKeyboard()、useMotionValue()、useBinding()、useScrollValue() 和 install(app),也是 app.use() 的默认导出。型号:AnimateValue、PressValue、TransitionProps。请参阅 Vue 指南。

类型 ​

Step、SequenceOptions、SequencePosition、JoltConfig、KeyframeProperty、ScrollLinkedOptions、KeyboardOptions、ItemsOptions、ColorValue、 ColorKeyframes、Keyframes、Transition、Spring、Tween、Preset、Presets、PresetName、SpringName、Easing、 Animation、Target、DecayVelocity、DecayOptions、SymbolEffect、SymbolEffectName、SymbolEffectOptions、ShimmerOptions、LiquidOptions、LiquidEffect、 LoaderOptions、LoaderStyle、TextOptions、RollOptions、RevealOptions、ConcealOptions、Haptic、HapticOptions、HapticStyle、ConfettiOptions、 ParticleOptions 和其余的从包中导出。 configure({ timeScale }) 设置随后开始的动画的全局播放速度。 configure({ timeScale, reducedMotion }) 为随后启动的动画设置全局播放速度和简化运动首选项('user'、'always' 或 'never')。 reducedMotion() and onReducedMotion(callback) 阅读并观察该偏好。

类型 ​

基于 MIT 许可证发布。