3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11 <link rel=
"import" href=
"../polymer/polymer.html">
12 <link rel=
"import" href=
"../iron-meta/iron-meta.html">
17 * Use `Polymer.NeonAnimationBehavior` to implement an animation.
20 Polymer
.NeonAnimationBehavior
= {
25 * Defines the animation timing.
32 easing
: 'cubic-bezier(0.4, 0, 0.2, 1)',
40 registered: function() {
41 new Polymer
.IronMeta({type
: 'animation', key
: this.is
, value
: this.constructor});
45 * Do any animation configuration here.
47 // configure: function(config) {
51 * Returns the animation timing by mixing in properties from `config` to the defaults defined
54 timingFromConfig: function(config
) {
56 for (var property
in config
.timing
) {
57 this.animationTiming
[property
] = config
.timing
[property
];
60 return this.animationTiming
;
64 * Sets `transform` and `transformOrigin` properties along with the prefixed versions.
66 setPrefixedProperty: function(node
, property
, value
) {
68 'transform': ['webkitTransform'],
69 'transformOrigin': ['mozTransformOrigin', 'webkitTransformOrigin']
71 var prefixes
= map
[property
];
72 for (var prefix
, index
= 0; prefix
= prefixes
[index
]; index
++) {
73 node
.style
[prefix
] = value
;
75 node
.style
[property
] = value
;
79 * Called when the animation finishes.
81 complete: function() {}