Skip to content

Commit

Permalink
Merge pull request #178 from dstockwell/effects
Browse files Browse the repository at this point in the history
Move style updates after effect creation
  • Loading branch information
dstoc committed May 11, 2016
2 parents bc4bb92 + 3720edd commit c007398
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 52 deletions.
8 changes: 4 additions & 4 deletions animations/scale-down-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
configure: function(config) {
var node = config.node;

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

var scaleProperty = 'scale(0, 0)';
if (config.axis === 'x') {
scaleProperty = 'scale(0, 1)';
Expand All @@ -57,6 +53,10 @@
{'transform': scaleProperty}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

return this._effect;
}

Expand Down
8 changes: 4 additions & 4 deletions animations/scale-up-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
configure: function(config) {
var node = config.node;

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

var scaleProperty = 'scale(0)';
if (config.axis === 'x') {
scaleProperty = 'scale(0, 1)';
Expand All @@ -57,6 +53,10 @@
{'transform': 'scale(1, 1)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-down-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(0%)'},
{'transform': 'translateY(100%)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '50% 0');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(0%)'},
{'transform': 'translateY(100%)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-from-bottom-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(100%)'},
{'transform': 'translateY(0)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '50% 0');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(100%)'},
{'transform': 'translateY(0)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-from-left-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translateX(-100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '0 50%');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translateX(-100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-from-right-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translateX(100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '0 50%');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translateX(100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-from-top-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(-100%)'},
{'transform': 'translateY(0%)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '50% 0');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(-100%)'},
{'transform': 'translateY(0%)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-left-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'none'},
{'transform': 'translateX(-100%)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '0 50%');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'none'},
{'transform': 'translateX(-100%)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-right-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'none'},
{'transform': 'translateX(100%)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '0 50%');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'none'},
{'transform': 'translateX(100%)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
10 changes: 5 additions & 5 deletions animations/slide-up-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
configure: function(config) {
var node = config.node;

this._effect = new KeyframeEffect(node, [
{'transform': 'translate(0)'},
{'transform': 'translateY(-100%)'}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
} else {
this.setPrefixedProperty(node, 'transformOrigin', '50% 0');
}

this._effect = new KeyframeEffect(node, [
{'transform': 'translate(0)'},
{'transform': 'translateY(-100%)'}
], this.timingFromConfig(config));

return this._effect;
}

Expand Down
8 changes: 4 additions & 4 deletions animations/transform-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
var transformFrom = config.transformFrom || 'none';
var transformTo = config.transformTo || 'none';

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

this._effect = new KeyframeEffect(node, [
{'transform': transformFrom},
{'transform': transformTo}
], this.timingFromConfig(config));

if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}

return this._effect;
}

Expand Down

0 comments on commit c007398

Please sign in to comment.