|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <title>Polymer Animation Components</title> |
| 5 | + <link rel="import" href="polymer-animation.html"> |
| 6 | + <link rel="import" href="polymer-animation-group.html"> |
| 7 | + <link rel="import" href="polymer-blink.html"> |
| 8 | + <link rel="import" href="polymer-bounce.html"> |
| 9 | + <link rel="import" href="polymer-fadein.html"> |
| 10 | + <link rel="import" href="polymer-fadeout.html"> |
| 11 | + <link rel="import" href="polymer-flip.html"> |
| 12 | + <link rel="import" href="polymer-shake.html"> |
| 13 | + <script src="../../polymer/polymer.js"></script> |
| 14 | + <style> |
| 15 | + body { |
| 16 | + text-align: center; |
| 17 | + font-family: Helvetica, sans-serif; |
| 18 | + } |
| 19 | + div#target { |
| 20 | + display: inline-block; |
| 21 | + background-color: dimgrey; |
| 22 | + border-radius: 5px; |
| 23 | + padding: 5px 10px; |
| 24 | + margin: 50px; |
| 25 | + font-size: 30px; |
| 26 | + color: white; |
| 27 | + } |
| 28 | + div.animations > * { |
| 29 | + display: inline-block; |
| 30 | + background-color: darkgrey; |
| 31 | + border-radius: 5px; |
| 32 | + padding: 5px 10px; |
| 33 | + margin: 5px; |
| 34 | + color: white; |
| 35 | + } |
| 36 | + </style> |
| 37 | + </head> |
| 38 | + <body> |
| 39 | + <div id="target">animated!</div> |
| 40 | + <div class="animations"> |
| 41 | + <polymer-animation duration="1"> |
| 42 | + raw |
| 43 | + <polymer-animation-prop name="opacity" easing="ease-in-out"> |
| 44 | + <polymer-animation-keyframe value="1"></polymer-animation-keyframe> |
| 45 | + <polymer-animation-keyframe value="0.3"></polymer-animation-keyframe> |
| 46 | + <polymer-animation-keyframe value="1"></polymer-animation-keyframe> |
| 47 | + </polymer-animation-prop> |
| 48 | + </polymer-animation> |
| 49 | + <polymer-animation-group type="seq"> |
| 50 | + raw group |
| 51 | + <polymer-animation duration="0.3"> |
| 52 | + <polymer-animation-prop name="opacity" easing="ease-in-out"> |
| 53 | + <polymer-animation-keyframe value="1"></polymer-animation-keyframe> |
| 54 | + <polymer-animation-keyframe value="0.3"></polymer-animation-keyframe> |
| 55 | + <polymer-animation-keyframe value="1"></polymer-animation-keyframe> |
| 56 | + </polymer-animation-prop> |
| 57 | + </polymer-animation> |
| 58 | + <polymer-animation duration="0.3"> |
| 59 | + <polymer-animation-prop name="transform" easing="ease-in-out"> |
| 60 | + <polymer-animation-keyframe value="scale(1)"></polymer-animation-keyframe> |
| 61 | + <polymer-animation-keyframe value="scale(1.2)"></polymer-animation-keyframe> |
| 62 | + <polymer-animation-keyframe value="scale(1)"></polymer-animation-keyframe> |
| 63 | + </polymer-animation-prop> |
| 64 | + </polymer-animation> |
| 65 | + </polymer-animation-group> |
| 66 | + <polymer-bounce duration="1">bounce</polymer-bounce> |
| 67 | + <polymer-shake>shake</polymer-shake> |
| 68 | + <polymer-shake duration="Infinity">shake forever</polymer-shake> |
| 69 | + <polymer-flip>flip X</polymer-flip> |
| 70 | + <polymer-flip axis="y">flip Y</polymer-flip> |
| 71 | + <polymer-blink>blink</polymer-blink> |
| 72 | + <polymer-fadein>fade in</polymer-fadein> |
| 73 | + <polymer-fadeout>fade out</polymer-fadeout> |
| 74 | + </div> |
| 75 | + <script> |
| 76 | + document.addEventListener('WebComponentsReady', function() { |
| 77 | + document.querySelector('.animations').addEventListener('click', |
| 78 | + function(e) { |
| 79 | + var animation = e.target; |
| 80 | + animation.target = target; |
| 81 | + animation.play(); |
| 82 | + }); |
| 83 | + }); |
| 84 | + </script> |
| 85 | + </body> |
| 86 | +</html> |
0 commit comments