Skip to content

Instantly share code, notes, and snippets.

@jlgerber
Last active December 21, 2016 08:03
Show Gist options
  • Save jlgerber/7057329ff182295fbec7 to your computer and use it in GitHub Desktop.
Save jlgerber/7057329ff182295fbec7 to your computer and use it in GitHub Desktop.
custom neon animation behavior...not working
<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