Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Unified Diff: pkg/polymer/lib/elements/polymer-animation/polymer-shake.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698