Last active
August 29, 2015 14:06
-
-
Save mattdesl/2ce1764ba23bcf34d0a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] } | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (name, array) { | |
if (name === 'position') | |
return { x: array[0], y: array[1] } | |
else if (name === 'alpha') | |
return { opacity: array[0] } | |
.. etc .. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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