MOVIMIENTO / iOS / NATIVESCRIPT VUE
Sigue el movimiento.
Una cadena de resortes conectada a tu toque.
El movimiento detrás.
Jolt 0.1.0-rc.11El ejemplo de API, extraído del guía. Consulta la demo completa para la interfaz y los controles.
TypeScript · NativeScript
import { bind, motionScope, motionValue, set, springValue } from '@rafaelaugusto/jolt'
const scope = motionScope()
const pointer = motionValue(0)
const first = scope.add(springValue(pointer, { stiffness: 260, damping: 24 }))
const second = scope.add(springValue(first, { stiffness: 260, damping: 24 }))
scope.use(() => bind(cursor, { x: first }))
scope.use(() => bind(trailingCursor, { x: second }))
set(pointer, 180)
set(pointer, -40) // preserves each follower's position and velocity
// On page/component disposal:
scope.dispose()