Timeline ANIMATION

Click to play

Parallel Play

Add a child animation to a timeline with fixed time:

myTimeline.add(animInit, fixedTime);

fixedTime:

Type example Info
number 500 Starts at 500ms, reagardless of the animtion position in the timeline

CODE EXAMPLE

let anim = new Timeline({
    duration: 800,
    autoreset: true
})
.add({
    type: 'tween',
    targets: '.square.el-1',
    keys: { left: '+=250' },
    duration: 500,
    endDelay: 1300
}, 0)
.add({
    type: 'tween',
    targets: '.circle.el-1',
    keys: { left: '+=250' },
    endDelay: 500
}, 500)
.add({
    type: 'tween',
    targets: '.square.el-2',
    keys: { left: '+=250' }
})
.add({
    type: 'tween',
    targets: '.circle.el-2',
    keys: { left: '+=250' },
    endDelay: 1000
}, 0)

$1('#demo').on('click', () => {
    anim.play()
})