Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rotateX and rotateY api #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,26 @@ Move.prototype.rotate = function(n){
return this.transform('rotate(' + n + 'deg)');
};

/**
*
* @param {Number} n
* @returns {Move} for chaining
* @api public
*/
Move.prototype.rotateX = function(n){
return this.transform('rotateX(' + n + 'deg)');
};

/**
*
* @param {Number} n
* @returns {Move} for chaining
* @api public
*/
Move.prototype.rotateY = function(n){
return this.transform('rotateY(' + n + 'deg)');
};

/**
* Set transition easing function to to `fn` string.
*
Expand Down
34 changes: 27 additions & 7 deletions move.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ require.helper.semVerSort = function(a, b) {

/**
* Find and require a module which name starts with the provided name.
* If multiple modules exists, the highest semver is used.
* If multiple modules exists, the highest semver is used.
* This function can only be used for remote dependencies.

* @param {String} name - module name: `user~repo`
* @param {Boolean} returnPath - returns the canonical require path if true,
* @param {Boolean} returnPath - returns the canonical require path if true,
* otherwise it returns the epxorted module
*/
require.latest = function (name, returnPath) {
Expand All @@ -83,7 +83,7 @@ require.latest = function (name, returnPath) {
semVerCandidates.push({version: version, name: moduleName});
} else {
otherCandidates.push({version: version, name: moduleName});
}
}
}
}
if (semVerCandidates.concat(otherCandidates).length === 0) {
Expand Down Expand Up @@ -327,7 +327,7 @@ CssEmitter.prototype.bind = function(fn){

/**
* Unbind CSS events
*
*
* @api public
*/

Expand All @@ -340,7 +340,7 @@ CssEmitter.prototype.unbind = function(fn){

/**
* Fire callback only once
*
*
* @api public
*/

Expand Down Expand Up @@ -960,6 +960,26 @@ Move.prototype.rotate = function(n){
return this.transform('rotate(' + n + 'deg)');
};

/**
*
* @param {Number} n
* @returns {Move} for chaining
* @api public
*/
Move.prototype.rotateX = function(n){
return this.transform('rotateX(' + n + 'deg)');
};

/**
*
* @param {Number} n
* @returns {Move} for chaining
* @api public
*/
Move.prototype.rotateY = function(n){
return this.transform('rotateY(' + n + 'deg)');
};

/**
* Set transition easing function to to `fn` string.
*
Expand Down Expand Up @@ -1079,8 +1099,8 @@ Move.prototype.set = function(prop, val){
}
} else {
this.transition(prop);
this._props[prop] = val;
}
this._props[prop] = val;
}
return this;
};

Expand Down