yes, i tried do this, anyway i solved my problem.
for some reason this dont work and animation twitches
tl.to('.js-smoke', {
opacity:.4,
x: 0,
duration: 1.5,
onComplete: () => {
const tl2 = gsap.timeline({ repeat: -1 })
const target = '.js-smoke'
tl2.to(target, {
duration: 1.2,
opacity: 1,
})
tl2.to(target, {
duration: 4,
x: -650,
ease: 'none'
}, '=')
tl2.to(target, {
opacity: 0,
duration: 1.2,
}, '-=2')
}
}, 'Sametime')
but this work perfect
tl.to('.js-smoke', {
x: 0,
duration: 1.5,
onComplete: () => {
const tl2 = gsap.timeline({ repeat: -1 })
const target = '.js-smoke'
tl2.to(target, {
duration: 1.2,
opacity: 1,
})
tl2.to(target, {
duration: 4,
x: -650,
ease: 'none'
}, '=')
tl2.to(target, {
opacity: 0,
duration: 1.2,
}, '-=2')
}
}, 'Sametime')
tl.to('.js-smoke', {
opacity: .4
}, '=')
idk may be noone checked my codepen, but i lost for this 2 days