| OLD | NEW |
| (Empty) |
| 1 Polymer({ | |
| 2 is: 'paper-menu-grow-height-animation', | |
| 3 | |
| 4 behaviors: [ | |
| 5 Polymer.NeonAnimationBehavior | |
| 6 ], | |
| 7 | |
| 8 configure: function(config) { | |
| 9 var node = config.node; | |
| 10 var rect = node.getBoundingClientRect(); | |
| 11 var height = rect.height; | |
| 12 | |
| 13 this._effect = new KeyframeEffect(node, [{ | |
| 14 height: (height / 2) + 'px' | |
| 15 }, { | |
| 16 height: height + 'px' | |
| 17 }], this.timingFromConfig(config)); | |
| 18 | |
| 19 return this._effect; | |
| 20 } | |
| 21 }); | |
| 22 | |
| 23 Polymer({ | |
| 24 is: 'paper-menu-grow-width-animation', | |
| 25 | |
| 26 behaviors: [ | |
| 27 Polymer.NeonAnimationBehavior | |
| 28 ], | |
| 29 | |
| 30 configure: function(config) { | |
| 31 var node = config.node; | |
| 32 var rect = node.getBoundingClientRect(); | |
| 33 var width = rect.width; | |
| 34 | |
| 35 this._effect = new KeyframeEffect(node, [{ | |
| 36 width: (width / 2) + 'px' | |
| 37 }, { | |
| 38 width: width + 'px' | |
| 39 }], this.timingFromConfig(config)); | |
| 40 | |
| 41 return this._effect; | |
| 42 } | |
| 43 }); | |
| 44 | |
| 45 Polymer({ | |
| 46 is: 'paper-menu-shrink-width-animation', | |
| 47 | |
| 48 behaviors: [ | |
| 49 Polymer.NeonAnimationBehavior | |
| 50 ], | |
| 51 | |
| 52 configure: function(config) { | |
| 53 var node = config.node; | |
| 54 var rect = node.getBoundingClientRect(); | |
| 55 var width = rect.width; | |
| 56 | |
| 57 this._effect = new KeyframeEffect(node, [{ | |
| 58 width: width + 'px' | |
| 59 }, { | |
| 60 width: width - (width / 20) + 'px' | |
| 61 }], this.timingFromConfig(config)); | |
| 62 | |
| 63 return this._effect; | |
| 64 } | |
| 65 }); | |
| 66 | |
| 67 Polymer({ | |
| 68 is: 'paper-menu-shrink-height-animation', | |
| 69 | |
| 70 behaviors: [ | |
| 71 Polymer.NeonAnimationBehavior | |
| 72 ], | |
| 73 | |
| 74 configure: function(config) { | |
| 75 var node = config.node; | |
| 76 var rect = node.getBoundingClientRect(); | |
| 77 var height = rect.height; | |
| 78 var top = rect.top; | |
| 79 | |
| 80 this.setPrefixedProperty(node, 'transformOrigin', '0 0'); | |
| 81 | |
| 82 this._effect = new KeyframeEffect(node, [{ | |
| 83 height: height + 'px', | |
| 84 transform: 'translateY(0)' | |
| 85 }, { | |
| 86 height: height / 2 + 'px', | |
| 87 transform: 'translateY(-20px)' | |
| 88 }], this.timingFromConfig(config)); | |
| 89 | |
| 90 return this._effect; | |
| 91 } | |
| 92 }); | |
| OLD | NEW |