Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
nativescript-effects
Advanced tools
A NativeScript plugin that extend animations to include common animation scenarios.
A NativeScript plugin that adds commonly used animation effects to views. This includes the nativescript-animation-spring as one of the effects so no need to get that plugin if you get this one.
$ tns plugin add nativescript-effects
This command automatically installs the necessary files, as well as stores nativescript-effects as a dependency in your project's package.json
file.
To use the animation effects plugin you must first require()
its module. After you require()
the module you have access to its APIs.
var tnsfx = require('nativescript-effects');
Then get a reference to the view you want to animate and call one of the functions listed below. This view can be any child of the NativeScript View class such as Button, Label, etc.
var myLabel = page.getViewById('lblMessage');
myLabel.fadeIn()
.then(function(){
myLabel.fadeOut(10000);
});
All extensions listed below return a Promise that will call it's then
function once finished successfully.
Description: Display the view by fading it to opaque.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
Description: Hide the view by fading it to transparent.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
Description: Gradually adjust the opacity of the view.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
opacity (default: 1)
Type: Number
A number between 0.0 and 1.0
Description: Display or hide the view by animating its opacity.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
Description: Display the view with a sliding motion in a certain direction.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
direction (default: 'up')
Type: String
A constant representing the direction to float. Can be 'up', 'down', 'left', 'right'
Description: Hide the view with a sliding motion in a certain direction.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
direction (default: 'down')
Type: String
A constant representing the direction to float. Can be 'up', 'down', 'left', 'right'
Description: Hide the view.
duration (default: 1)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
Description: Display the view.
duration (default: 1)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
Description: Display the view with a sliding motion.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
distance (default: -100)
Type: Number
A number determining how many points the view will slide.
Description: Hide the view with a sliding motion.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
distance (default: -100)
Type: Number
A number determining how many points the view will slide.
Description: Moves the view with a spring like bouncing motion.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
animation (default: see default object below)
Type: Object
An animation definition object as described in the "Spring Animation" section below.
Default animation:
animation = {
translate: {
x: 0,
y: -100
},
scale: {
x: 2,
y: 2
},
duration: msDuration,
delay: 0,
dampingRatio: 0.3,
velocity: 2.0,
options: null
};
###Spring Animation options
The full set of options is documented on the Apple developer site. Modifying these options gives a different spring-like effect. Here is an example function call for the screenshot above (although it looks much smoother on the emulator or the actual device since the GIF is not 60 frames per second).
###Example Usage
myView.spring(10000, {
translate: {
x: 0,
y: -100
},
scale: {
x: 2,
y: 2
},
delay: 0,
dampingRatio: 0.3,
velocity: 2.0,
options: null,
});
Description: Display or hide the view.
duration (default: 400)
Type: Number or String
A string or number determining how long the animation will run. Number is milliseconds. String is a constant value 'fast' or 'slow'.
FAQs
A NativeScript plugin that provides animation effects. Also includes extended animations to include common animation scenarios.
The npm package nativescript-effects receives a total of 6 weekly downloads. As such, nativescript-effects popularity was classified as not popular.
We found that nativescript-effects demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.