
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
universal-parallax
Advanced tools
Easy parallax plugin using pure javascript. Cross browser compatibility, including mobile platforms (iOS, Android). Support for opaque backgrounds.
Easy parallax plugin using pure javascript. Cross browser compatibility, including mobile platforms (iOS, Android). Support for opaque backgrounds.
$ npm i universal-parallax -S
Include the script at the bottom of your project
<script src="node_modules/universal-parallax/dist/universal-parallax.min.js"></script>
Choose between:
<head>
section<link href="node_modules/universal-parallax/dist/universal-parallax.min.css" rel="stylesheet">
.parallax__container {
position: absolute;
clip: rect(0, auto, auto, 0);
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -100;
}
.parallax {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
transform: translate3d(0,0,0);
/* BG behaviour */
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
:zap: BG behaviour in seperate class gives more flexibility controlling them
If <section>
is your container, make the parallax element inside it
<section>
<div class="parallax" data-parallax-image="path/to/your_image">
</section>
:zap: You can also use background-image
to define your image instead of using data-parallax-image=""
Initialize the JS function
new universalParallax().init();
That's it! :checkered_flag:
You can change the parallax speed; the higher the number, the slower the parallax effect
new universalParallax().init({
speed: 6.0
});
:zap: speed: 1
is the minimum value before the background image is fixed
Transparency can be added and it won't affect the opacity of your content.
.parallax {
opacity: 0.5;
}
FAQs
Easy parallax plugin using vanilla javascript. Works on mobile devices (really). Lightweight (2kb). Cross browser compatibility
The npm package universal-parallax receives a total of 17 weekly downloads. As such, universal-parallax popularity was classified as not popular.
We found that universal-parallax 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.