animation.js 3.78 KB
/**
 * @author: Gustavo Rodrigues
 * @email: gugateider@gmail.com 
 * Edit the array 'animationArr' below accordingly to the creative 
 * animation you wish to achieve
 * Each item of the array corresponds to each frame. 
 * If you have an object within this item called 'child', 
 * javascript will animate that child, otherwise will animate the 
 * entire "section"
 */
var tweenDuration = .07;
var animationArr  = [[
					// Frame 1 
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 },
						complete: "startGenericAnimation"
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration						
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0.45 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0.8 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0.25 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0.5 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration						
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0.15 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0.3 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0.05 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0.2 },
						overlap: "-=" + tweenDuration
					},
					{
						type: 'to',
						child: '#ambientlight',
						duration: tweenDuration,
						object: { opacity: 0 }
					},
					{
						type: 'to',
						child: '#signexit',
						duration: tweenDuration,
						object: { opacity: 0 },
						overlap: "-=" + tweenDuration
					}
					]];