OLD | NEW |
(Empty) | |
| 1 <link rel="import" href="polymer-animation.html"> |
| 2 <polymer-element name="polymer-translate" extends="polymer-animation" attributes
="fromX fromY toX toY"> |
| 3 <template> |
| 4 </template> |
| 5 <script> |
| 6 Polymer('polymer-translate', { |
| 7 fromX: '0', |
| 8 fromY: '0', |
| 9 toX: '0', |
| 10 toY: '0', |
| 11 fromXChanged: function() { |
| 12 this.generate(); |
| 13 }, |
| 14 fromYChanged: function() { |
| 15 this.generate(); |
| 16 }, |
| 17 toXChanged: function() { |
| 18 this.generate(); |
| 19 }, |
| 20 toYChanged: function() { |
| 21 this.generate(); |
| 22 }, |
| 23 generate: function() { |
| 24 this.keyframes = [ |
| 25 {transform: 'translate3d(' + this.fromX + ',' + this.fromY + ', 0)'}, |
| 26 {transform: 'translate3d(' + this.toX + ',' + this.toY + ', 0)'} |
| 27 ]; |
| 28 } |
| 29 }); |
| 30 </script> |
| 31 </polymer-element> |
OLD | NEW |