Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nativescript-effects

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-effects - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

screenshots/new_70.png

10

package.json
{
"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",

4

README.md

@@ -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>;
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc