Last active
February 7, 2018 00:40
-
-
Save bre7/30111c57574468f1eb989ac73b01b5a0 to your computer and use it in GitHub Desktop.
Just getting started with Framer & CoffeeScript. This a a loop animation which modifies a layer's opacity
This file contains hidden or 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
class OpacityLoopAnimation | |
constructor: (options={}) -> | |
fadeInAnimation = new Animation({ | |
layer: options.layer, | |
properties: { | |
opacity: 1.00 | |
} | |
time: 1 | |
curve: Bezier.easeIn | |
}) | |
@mainAnimation = fadeInAnimation | |
fadeOutAnimation = fadeInAnimation.reverse() | |
fadeInAnimation.onAnimationEnd -> | |
fadeOutAnimation.start() | |
fadeOutAnimation.onAnimationEnd -> | |
fadeInAnimation.start() | |
start: -> | |
@mainAnimation.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: