| Index: pkg/polymer/lib/elements/polymer-animation/polymer-shake.html
|
| diff --git a/pkg/polymer/lib/elements/polymer-animation/polymer-shake.html b/pkg/polymer/lib/elements/polymer-animation/polymer-shake.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8201f2b49d025f6f8ed4ffec1538a51f6440c26f
|
| --- /dev/null
|
| +++ b/pkg/polymer/lib/elements/polymer-animation/polymer-shake.html
|
| @@ -0,0 +1,74 @@
|
| +<link rel="import" href="polymer-animation-group.html">
|
| +<polymer-element name="polymer-shake" extends="polymer-animation-group">
|
| + <template>
|
| + <polymer-animation duration="{{period}}">
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="translateX(0px)">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="{{negTransform}}">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + </polymer-animation>
|
| + <polymer-animation duration="{{shakeDuration}}" iterationCount="{{shakeIterations}}">
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="{{negTransform}}">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="{{posTransform}}">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="{{negTransform}}">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + </polymer-animation>
|
| + <polymer-animation duration="{{period}}">
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="{{negTransform}}">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + <polymer-animation-keyframe>
|
| + <polymer-animation-prop name="transform" value="translateX(0px)">
|
| + </polymer-animation-prop>
|
| + </polymer-animation-keyframe>
|
| + </polymer-animation>
|
| + <content></content>
|
| + </template>
|
| + <script>
|
| + Polymer('polymer-shake', {
|
| + type: 'seq',
|
| + targetSelector: '',
|
| + duration: 0.3,
|
| + magnitude: '10px',
|
| + period: 0.1,
|
| + easing: 'ease-in',
|
| + ready: function() {
|
| + this.super();
|
| + this.magnitudeChanged();
|
| + this.periodChanged();
|
| + },
|
| + durationChanged: function() {
|
| + this.super();
|
| + this.generate();
|
| + },
|
| + magnitudeChanged: function() {
|
| + this.generate();
|
| + },
|
| + periodChanged: function() {
|
| + this.generate();
|
| + },
|
| + generate: function() {
|
| + this.negTransform = 'translateX(-' + this.magnitude + ')';
|
| + this.posTransform = 'translateX(' + this.magnitude + ')';
|
| + this.shakeDuration = this.period * 2;
|
| + this.shakeIterations = this.duration === 'Infinity' ? this.duration : Math.ceil(this.duration / this.shakeDuration);
|
| + },
|
| + get timingProps() {
|
| + return {};
|
| + }
|
| + });
|
| + </script>
|
| +</polymer-element>
|
|
|