|
80 | 80 | duration: options.duration
|
81 | 81 | },
|
82 | 82 | animation = {};
|
83 |
| - if (typeof options.translateX != "undefined") { |
84 |
| - var translateXOptions = mergeOptions(options.translateX, globalOptions); |
85 |
| - animation.translateX = new Scene($this, translateXOptions, windowHeight); |
| 83 | + if (typeof options.x != "undefined") { |
| 84 | + var xOptions = mergeOptions(options.x, globalOptions); |
| 85 | + animation.x = new Scene($this, xOptions, windowHeight); |
86 | 86 | }
|
87 |
| - if (typeof options.translateY != "undefined") { |
88 |
| - var translateYOptions = mergeOptions(options.translateY, globalOptions); |
89 |
| - animation.translateY = new Scene($this, translateYOptions, windowHeight); |
| 87 | + if (typeof options.y != "undefined") { |
| 88 | + var yOptions = mergeOptions(options.y, globalOptions); |
| 89 | + animation.y = new Scene($this, yOptions, windowHeight); |
90 | 90 | }
|
91 |
| - if (typeof options.translateZ != "undefined") { |
92 |
| - var translateZOptions = mergeOptions(options.translateZ, globalOptions); |
93 |
| - animation.translateZ = new Scene($this, translateZOptions, windowHeight); |
| 91 | + if (typeof options.z != "undefined") { |
| 92 | + var zOptions = mergeOptions(options.z, globalOptions); |
| 93 | + animation.z = new Scene($this, zOptions, windowHeight); |
94 | 94 | }
|
95 | 95 | if (typeof options.scale != "undefined") {
|
96 | 96 | var scaleOptions = mergeOptions(options.scale, globalOptions, 1);
|
|
100 | 100 | var rotateOptions = mergeOptions(options.rotate, globalOptions);
|
101 | 101 | animation.rotate = new Scene($this, rotateOptions, 360);
|
102 | 102 | }
|
103 |
| - if (animation.translateX || animation.translateY || animation.translateZ || animation.scale || animation.rotate) { |
| 103 | + if (animation.x || animation.y || animation.z || animation.scale || animation.rotate) { |
104 | 104 | animation.transform = new Transform(new TransformMatrix());
|
105 | 105 | }
|
106 | 106 |
|
|
146 | 146 | animation = animations[i];
|
147 | 147 | if (animation.transform) {
|
148 | 148 | TransformMatrix.fromEl(this, animation.transform.matrix);
|
149 |
| - if (animation.translateX && animation.translateX.updateState()) { |
150 |
| - animation.transform.setTranslateX(animation.translateX.value()); |
| 149 | + if (animation.x && animation.x.updateState()) { |
| 150 | + animation.transform.setTranslateX(animation.x.value()); |
151 | 151 | }
|
152 |
| - if (animation.translateY && animation.translateY.updateState()) { |
153 |
| - animation.transform.setTranslateY(animation.translateY.value()); |
| 152 | + if (animation.y && animation.y.updateState()) { |
| 153 | + animation.transform.setTranslateY(animation.y.value()); |
154 | 154 | }
|
155 |
| - if (animation.translateZ && animation.translateZ.updateState()) { |
156 |
| - animation.transform.setTranslateZ(animation.translateZ.value()); |
| 155 | + if (animation.z && animation.z.updateState()) { |
| 156 | + animation.transform.setTranslateZ(animation.z.value()); |
157 | 157 | }
|
158 | 158 | if (animation.scale && animation.scale.updateState()) {
|
159 | 159 | animation.transform.setScale(animation.scale.value());
|
|
315 | 315 | this.rotate = angle;
|
316 | 316 | },
|
317 | 317 | toString: function() {
|
318 |
| - var translateX = (typeof this.translateX != "undefined" ? this.translateX : this.matrix.getTranslateX()).toFixed(2), |
319 |
| - translateY = (typeof this.translateY != "undefined" ? this.translateY : this.matrix.getTranslateY()).toFixed(2), |
320 |
| - translateZ = (typeof this.translateZ != "undefined" ? this.translateZ : this.matrix.getTranslateZ()).toFixed(2), |
| 318 | + var x = (typeof this.translateX != "undefined" ? this.translateX : this.matrix.getTranslateX()).toFixed(2), |
| 319 | + y = (typeof this.translateY != "undefined" ? this.translateY : this.matrix.getTranslateY()).toFixed(2), |
| 320 | + z = (typeof this.translateZ != "undefined" ? this.translateZ : this.matrix.getTranslateZ()).toFixed(2), |
321 | 321 | scale = (typeof this.scale != "undefined" ? this.scale : this.matrix.getScale()),
|
322 | 322 | rotate = (typeof this.rotate != "undefined" ? this.rotate : this.matrix.getRotation()),
|
323 |
| - string = 'translate3d('+translateX+'px, '+translateY+'px, '+translateZ+'px)'; |
| 323 | + string = 'translate3d('+x+'px, '+y+'px, '+z+'px)'; |
324 | 324 | if (scale != 1) {
|
325 | 325 | string += ' scale('+scale+')';
|
326 | 326 | }
|
|
0 commit comments