Elementer og afspilningskontrol
Alt hvad animate() returnerer kan pauses, spoles, hastighedsjusteres og afventes som et Promise.
Kode
const anim = animate(
".box",
{ x: 260, rotate: 180, scale: 1.4, borderRadius: "50%" },
{ duration: 1.6, ease: "easeInOut" }
)
anim.pause()
anim.speed = 0.25
anim.time = 0.8 // spol
await anim // afvent
anim.cancel() // tilbage til udgangspunkt