Last active
December 21, 2016 08:03
-
-
Save jlgerber/7057329ff182295fbec7 to your computer and use it in GitHub Desktop.
custom neon animation behavior...not working
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
<link rel="import" href="../../bower_components/polymer/polymer.html"> | |
<link rel="import" href="../../bower_components/neon-animation/neon-animation-behavior.html"> | |
<!-- <link rel="import" href="../../bower_components/web-animations-js/web-animations.html"> --> | |
/* | |
grow-width-animation | |
config: { | |
node:<the node to operate on> | |
width: <string> the width in pixels to end on. | |
} | |
*/ | |
<dom-module id="grow-width-animation"> | |
<script> | |
(function(){ | |
Polymer({ | |
is:'grow-width-animation', | |
behaviors: [ | |
Polymer.NeonAnimationBehavior | |
], | |
configure: function(config) { | |
var node = config.node; | |
this._effect = new KeyframeEffect(node, [ | |
{'width': '0px'}, | |
{'width': config.width} | |
], this.timingFromConfig(config)); | |
return this._effect; | |
} | |
}); | |
}()); | |
</script> | |
</dom-module> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment