Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
angular-parallax-es6
Advanced tools
Lightweight and performant parallax scrolling for angular.js
Lightweight and highly performant AngularJS directive for parallax scrolling. Script is just 1.6K and about 40K gzipped with dependencies.
Uses requestAnimationFrame
and translate3d
for GPU accelerated, smooth transitions.
$ bower install ng-parallax
AngularJS and angular-scroll.
Include module and dependencies.
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<script src="//oblador.github.io/angular-scroll/0.6.2/angular-scroll.min.js"></script>
<script src="//oblador.github.io/angular-parallax/angular-parallax.min.js"></script>
Define transitions and expose to template.
angular.module('myApp', ['duParallax']).
controller('MyCtrl', function($scope, parallaxHelper){
$scope.background = parallaxHelper.createAnimator(-0.3);
}
);
Apply parallax scrolling with the du-parallax
attribute, define y
position with the transition named background
.
<section ng-controller="MyCtrl">
<img src="img.png" du-parallax y="background" alt="" />
</section>
createAnimator
Convenience method for creating animator closures.
parallaxHelper.createAnimator(easingFactor, max, min, offset);
Attributes can be literals or a function called with a parameter object containing scrollY
, elemX
, elemY
. The function should return the change in pixels relative to the objects current position if associated with y or x, otherwise the desired new value.
<img src="img.png" du-parallax y="accelleratedScroll" x="moveInFromLeft" opacity="fadeIn" rotation="'35deg'" alt="" />
The custom animator should return an object with camelCased CSS properties like this:
$scope.invertColors = function(elementPosition) {
var factor = -0.4;
var pos = Math.min(Math.max(elementPosition.elemY*factor, 0), 255);
var bg = 255-pos;
return {
backgroundColor: 'rgb(' + bg + ', ' + bg + ', ' + bg + ')',
color: 'rgb(' + pos + ', ' + pos + ', ' + pos + ')'
};
}
<div du-parallax custom="invertColors">[loads of text…]</div>
Check out oblador.github.io/angular-parallax or view the source at example/index.html.
$ npm install
$ gulp
Licensed under the MIT License
FAQs
Lightweight and performant parallax scrolling for angular.js
The npm package angular-parallax-es6 receives a total of 1 weekly downloads. As such, angular-parallax-es6 popularity was classified as not popular.
We found that angular-parallax-es6 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.