4 <title>core-animation
</title>
5 <script src=
"../platform/platform.js"></script>
6 <link rel=
"import" href=
"core-animation.html">
7 <link rel=
"import" href=
"core-animation-group.html">
9 <!-- <link rel="import" href="polymer-blink.html">
10 <link rel="import" href="polymer-bounce.html">
11 <link rel="import" href="polymer-fadein.html">
12 <link rel="import" href="polymer-fadeout.html">
13 <link rel="import" href="polymer-flip.html">
14 <link rel="import" href="polymer-shake.html">
19 font-family: Helvetica, sans-serif;
22 display: inline-block;
23 background-color: dimgrey;
31 display: inline-block;
32 background-color: darkgrey;
42 <div id=
"target">animated!
</div>
44 <div class=
"animations">
46 <core-animation id=
"raw" duration=
"1000">
48 <core-animation-keyframe>
49 <core-animation-prop name=
"opacity" value=
"1">
50 </core-animation-prop>
51 </core-animation-keyframe>
52 <core-animation-keyframe>
53 <core-animation-prop name=
"opacity" value=
"0.3">
54 </core-animation-prop>
55 </core-animation-keyframe>
56 <core-animation-keyframe>
57 <core-animation-prop name=
"opacity" value=
"1">
58 </core-animation-prop>
59 </core-animation-keyframe>
62 <core-animation-group type=
"seq">
64 <core-animation duration=
"300">
65 <core-animation-keyframe>
66 <core-animation-prop name=
"opacity" value=
"1">
67 </core-animation-prop>
68 </core-animation-keyframe>
69 <core-animation-keyframe>
70 <core-animation-prop name=
"opacity" value=
"0.3">
71 </core-animation-prop>
72 </core-animation-keyframe>
73 <core-animation-keyframe>
74 <core-animation-prop name=
"opacity" value=
"1">
75 </core-animation-prop>
76 </core-animation-keyframe>
78 <core-animation duration=
"300">
79 <core-animation-keyframe>
80 <core-animation-prop name=
"transform" value=
"scale(1)">
81 </core-animation-prop>
82 </core-animation-keyframe>
83 <core-animation-keyframe>
84 <core-animation-prop name=
"transform" value=
"scale(1.2)">
85 </core-animation-prop>
86 </core-animation-keyframe>
87 <core-animation-keyframe>
88 <core-animation-prop name=
"transform" value=
"scale(1)">
89 </core-animation-prop>
90 </core-animation-keyframe>
92 </core-animation-group>
94 <core-animation id=
"custom-animation" duration=
"500">custom
</core-animation>
96 <core-animation duration=
"1000" iterations=
"Infinity" direction=
"alternate">
98 <core-animation-keyframe>
99 <core-animation-prop name=
"opacity" value=
"1">
100 </core-animation-prop>
101 </core-animation-keyframe>
102 <core-animation-keyframe>
103 <core-animation-prop name=
"opacity" value=
"0.3">
104 </core-animation-prop>
105 </core-animation-keyframe>
107 <!-- <polymer-bounce duration="1000">bounce</polymer-bounce>
108 <polymer-shake>shake</polymer-shake>
109 <polymer-flip>flip X</polymer-flip>
110 <polymer-flip axis="y">flip Y</polymer-flip>
111 <polymer-blink>blink</polymer-blink>
112 <polymer-fadein>fade in</polymer-fadein>
115 var customAnimationFn = function(timeFraction
, target
) {
116 if (timeFraction
< 1) {
117 target
.textContent
= timeFraction
;
119 target
.textContent
= 'animated!';
123 document
.addEventListener('polymer-ready', function() {
124 document
.querySelector('.animations').addEventListener('click',
126 var animation
= e
.target
;
127 if (animation
.id
=== 'custom-animation') {
128 animation
.customEffect
= customAnimationFn
;
130 animation
.target
= target
;
133 document
.getElementById('raw').addEventListener(
134 'core-animation-finish', function(e
) {
135 console
.log('finish!');