This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- < link rel ="import " href ="polymer-animation-keyframe.html ">
2- < polymer-element name ="polymer-animation-prop " attributes ="name value ">
1+ < polymer-element name ="polymer-animation-prop " attributes ="name value " noscript >
32 < script >
43 /**
54 * A CSS property and value to use in a `<polymer-animation-keyframe>`.
1716 * @property value
1817 * @required
1918 */
20- Polymer ( 'polymer-animation-prop' ) ;
2119 </ script >
2220</ polymer-element >
Original file line number Diff line number Diff line change 4646 * @class polymer-animation
4747 */
4848 /**
49- * Fired when an animation completes
50- * @event complete
49+ * Fired when the animation starts
50+ * @event animation-start
51+ *
52+ * Fired when the animation completes
53+ * @event animation-end
54+ *
5155 */
5256 Polymer ( 'polymer-animation' , {
5357 publish : {
145149 //this.animation && console.log('play', this.animation);
146150 if ( this . animation ) {
147151 this . cancel ( ) ;
148- if ( ! this . animation . onend ) {
149- this . animation . onend = this . complete . bind ( this ) ;
150- }
152+ this . bindAnimationEvents ( ) ;
151153 this . player = document . timeline . play ( this . animation ) ;
152- this . player . paused = false ;
153- this . player . currentTime = 0 ;
154154 }
155155 } ) ;
156156 } ,
262262 }
263263 return new KeyframeAnimationEffect ( frames , this . composite ) ;
264264 } ,
265- // intended for user implementation
266- complete : function ( ) {
267- this . fire ( 'complete' ) ;
265+ bindAnimationEvents : function ( ) {
266+ if ( ! this . animation . onstart ) {
267+ this . animation . onstart = this . animationStartHandler . bind ( this ) ;
268+ }
269+ if ( ! this . animation . onend ) {
270+ this . animation . onend = this . animationEndHandler . bind ( this ) ;
271+ }
272+ } ,
273+ animationStartHandler : function ( ) {
274+ this . fire ( 'animation-start' ) ;
275+ } ,
276+ animationEndHandler : function ( ) {
277+ this . fire ( 'animation-end' ) ;
268278 }
269279 } ) ;
270280 } ) ( ) ;
Original file line number Diff line number Diff line change 1+ <!--
2+ Copyright 2013 The Polymer Authors. All rights reserved.
3+ Use of this source code is governed by a BSD-style
4+ license that can be found in the LICENSE file.
5+ -->
6+ < link rel ="import " href ="../polymer-animation/polymer-animation.html ">
7+
8+ < polymer-element name ="polymer-overlay-scale " extends ="polymer-animation ">
9+ < script >
10+ Polymer ( 'polymer-overlay-scale' , {
11+ duration : 0.218 ,
12+ properties : {
13+ opacity : [ '0' , '1' ] ,
14+ transform : [ 'scale(1.05)' , 'scale(1)' ]
15+ }
16+ } ;
17+ </ script >
18+ </ polymer-element >
Original file line number Diff line number Diff line change 1+ <!--
2+ Copyright 2013 The Polymer Authors. All rights reserved.
3+ Use of this source code is governed by a BSD-style
4+ license that can be found in the LICENSE file.
5+ -->
6+ < link rel ="import " href ="../polymer-animation/polymer-animation.html ">
7+
8+ < polymer-element name ="polymer-overlay-slideup " extends ="polymer-animation ">
9+ < script >
10+ Polymer ( 'polymer-overlay-slideup' , {
11+ duration : 0.4 ,
12+ properties : {
13+ opacity : [ '1' , '0' ] ,
14+ transform : [ 'translateY(0)' , 'translateY(-100%)' ]
15+ }
16+ } ;
17+ </ script >
18+ </ polymer-element >
You can’t perform that action at this time.
0 commit comments