Skip to content

Instantly share code, notes, and snippets.

@ryonakae
Last active September 4, 2017 05:27
Show Gist options
  • Save ryonakae/3b688799d12bf9c30ba21f819d7e5ae8 to your computer and use it in GitHub Desktop.
Save ryonakae/3b688799d12bf9c30ba21f819d7e5ae8 to your computer and use it in GitHub Desktop.
'use strict'
import gsap from 'gsap'
import TimelinePlus from './TimelinePlus'
TimelinePlus.parallel([
TimelinePlus.serial([
TweenMax.to(spans[0], 0.7, {x: 400, ease: Expo.easeInOut}),
TweenMax.to(spans[1], 0.9, {x: 400, ease: Expo.easeInOut})
]),
TimelinePlus.parallel([
TweenMax.to(spans[2], 0.7, {x: 400, ease: Expo.easeInOut}),
TweenMax.to(spans[3], 0.9, {x: 400, ease: Expo.easeInOut})
]).delay(0.5)
])
export default {
serial: (array) => {
const tl = new TimelineMax()
array.forEach((value) => {
tl.add(value)
})
return tl
},
parallel: (array) => {
return new TimelineMax().add(array)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment