nativescript-effects
Advanced tools
Comparing version 0.2.4 to 0.3.0
{ | ||
"name": "nativescript-effects", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"main": "tns-effects.js", | ||
@@ -26,3 +26,9 @@ "description": "A NativeScript plugin that extend animations to include common animation scenarios.", | ||
], | ||
"contributors": [], | ||
"contributors": [ | ||
{ | ||
"name": "Steve McNiven-Scott", | ||
"email": "steve@sitefinitysteve.com", | ||
"url": "https://github.com/sitefinitysteve" | ||
} | ||
], | ||
"author": { | ||
@@ -29,0 +35,0 @@ "name": "Alexander Ziskind", |
@@ -108,3 +108,7 @@ # NativeScript Effects | ||
---- | ||
## .shake() ![](./screenshots/new_70.png) | ||
Description: *Shake the view back and forth a few times, like a headshake "no"* | ||
---- | ||
@@ -111,0 +115,0 @@ ## .show([duration]) |
@@ -228,2 +228,21 @@ //nativescript-effects | ||
return fx.nativeSpring(animation); | ||
} | ||
} | ||
//.shake( ) | ||
viewModule.View.prototype.shake = function() { | ||
var view = this; | ||
return new Promise(function (resolve, reject) { | ||
view.animate({ translate: { x: -20, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) | ||
.then(function () { return view.animate({ translate: { x: 20, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: -20, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: 20, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: -10, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: 10, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: -5, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: 5, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { return view.animate({ translate: { x: 0, y: 0}, duration: 60, curve: enums.AnimationCurve.linear}) }) | ||
.then(function () { | ||
return resolve(view); | ||
}); | ||
}); | ||
} |
@@ -20,3 +20,5 @@ declare module "ui/core/view" { | ||
spring(duration?: string | number, animation?:any): Promise<void>; | ||
shake(): Promise<void>; | ||
} | ||
} |
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
28424
12
361
222