Created
August 22, 2016 07:06
-
-
Save OrenBochman/c6c51ac2e75a7711e8a5c57e00001d00 to your computer and use it in GitHub Desktop.
Polymer: basic animated element
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
//implement NeonAnimatableBehavior behavior | |
// or Polymer.NeonAnimationRunnerBehavior if also reponsible for running the animation (ctrl) | |
Polymer({ | |
is: 'my-animatable', | |
behaviors: [ | |
Polymer.NeonAnimationRunnerBehavior //I am reponsible for running the animation | |
], | |
properties: { | |
animationConfig: { | |
value: function() { | |
return { | |
// provided by neon-animation/animations/scale-down-animation.html | |
name: 'scale-down-animation', | |
node: this //which node to use for the baisc animation | |
} | |
} | |
} | |
}, | |
listeners: { | |
// this event is fired when the animation finishes | |
'neon-animation-finish': '_onNeonAnimationFinish' | |
}, | |
animate: function() { | |
// run scale-down-animation | |
this.playAnimation(); | |
}, | |
_onNeonAnimationFinish: function() { | |
console.log('animation done!'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
preview