Comparing version 0.0.2 to 0.0.3
@@ -328,2 +328,3 @@ var require = function (file, cwd) { | ||
var endToEnd = false; | ||
var invert = false; | ||
if (options !== undefined) { | ||
@@ -333,2 +334,5 @@ if ((options.endToEnd !== undefined) && (options.endToEnd === true)) { | ||
} | ||
if ((options.invert !== undefined) && (options.invert === true)) { | ||
invert = true; | ||
} | ||
} | ||
@@ -391,3 +395,7 @@ // you can call it with either Easing(11, 'linear') or Easing(new Array(11), 'linear') | ||
} | ||
if (invert) { | ||
for (var i = 0; i < list.length;i++) { | ||
list[i] = 1 - list[i]; | ||
} | ||
} | ||
return list; | ||
@@ -394,0 +402,0 @@ }; |
10
index.js
@@ -6,2 +6,3 @@ module.exports = exports = Easing; | ||
var endToEnd = false; | ||
var invert = false; | ||
if (options !== undefined) { | ||
@@ -11,2 +12,5 @@ if ((options.endToEnd !== undefined) && (options.endToEnd === true)) { | ||
} | ||
if ((options.invert !== undefined) && (options.invert === true)) { | ||
invert = true; | ||
} | ||
} | ||
@@ -69,4 +73,8 @@ // you can call it with either Easing(11, 'linear') or Easing(new Array(11), 'linear') | ||
} | ||
if (invert) { | ||
for (var i = 0; i < list.length;i++) { | ||
list[i] = 1 - list[i]; | ||
} | ||
} | ||
return list; | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Easing Functions Without the Framework Cruft", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"keywords" : [ | ||
@@ -8,0 +8,0 @@ "easing", |
@@ -0,1 +1,3 @@ | ||
![easing](https://github.com/rook2pawn/node-easing/raw/master/graph.png) | ||
easing | ||
@@ -97,4 +99,13 @@ ====== | ||
If we wanted to go from 0 to 1 back to 0 quadratically, simply call Easing(list,'quadratic',{endToEnd:true}); | ||
If we wanted to go from 0 to 1 back to 0 quadratically, simply call | ||
Easing(list,'quadratic',{endToEnd:true}); | ||
Invert | ||
------ | ||
If we want to go from 1 to 0 (or 1 to 0 back to 1) instead of 0 to 1, say 'linear' style, simply call | ||
Easing(list,'linear',{invert:true}); | ||
You can mix and match these options. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33289
6
428
111