OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview Defines fade animations similar to Polymer's fade-in-animation |
| 7 * and fade-out-animation, but with Settings-specific timings. |
| 8 */ |
| 9 Polymer({ |
| 10 is: 'settings-fade-in-animation', |
| 11 |
| 12 behaviors: [Polymer.NeonAnimationBehavior], |
| 13 |
| 14 configure: function(config) { |
| 15 var node = config.node; |
| 16 this._effect = new KeyframeEffect( |
| 17 node, |
| 18 [ |
| 19 {'opacity': '0'}, |
| 20 {'opacity': '1'}, |
| 21 ], |
| 22 /** @type {!KeyframeEffectOptions} */ ({ |
| 23 duration: settings.animation.Timing.DURATION, |
| 24 easing: settings.animation.Timing.EASING, |
| 25 fill: 'both', |
| 26 })); |
| 27 return this._effect; |
| 28 } |
| 29 }); |
| 30 |
| 31 Polymer({ |
| 32 is: 'settings-fade-out-animation', |
| 33 |
| 34 behaviors: [Polymer.NeonAnimationBehavior], |
| 35 |
| 36 configure: function(config) { |
| 37 var node = config.node; |
| 38 this._effect = new KeyframeEffect( |
| 39 node, |
| 40 [ |
| 41 {'opacity': '1'}, |
| 42 {'opacity': '0'}, |
| 43 ], |
| 44 /** @type {!KeyframeEffectOptions} */ ({ |
| 45 duration: settings.animation.Timing.DURATION, |
| 46 easing: settings.animation.Timing.EASING, |
| 47 fill: 'both', |
| 48 })); |
| 49 return this._effect; |
| 50 } |
| 51 }); |
OLD | NEW |