Skip to content

Instantly share code, notes, and snippets.

@mattdesl
Last active August 29, 2015 14:06
Show Gist options
  • Save mattdesl/2ce1764ba23bcf34d0a6 to your computer and use it in GitHub Desktop.
Save mattdesl/2ce1764ba23bcf34d0a6 to your computer and use it in GitHub Desktop.
module.exports = {
name: 'circle',
controls: [
{ name: 'position', keyframes: [
{ time: 0, value: [0, 0] },
{ time: 2, value: [100, 100], ease: 'bounceOut' },
{ time: 4, value: [0, 100], ease: 'cubicIn' }
] },
{ name: 'color', keyframes: [
{ time: 0, value: [255, 255, 255] },
{ time: 2, value: [255, 189, 120], ease: 'cubicIn' },
{ time: 3, value: [100, 189, 100] }
] },
{ name: 'alpha', defaultValue: [0.5] }
]
}
module.exports = function (name, array) {
if (name === 'position')
return { x: array[0], y: array[1] }
else if (name === 'alpha')
return { opacity: array[0] }
.. etc ..
}
var tweenmap = require('tweenlite-map')
for each control
for each keyframe in control
TimelineLite "to" with tweenmap(name, array)
TimelineLite.play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment