
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
scroll-visibility-js
Advanced tools
ES6 module that monitors elements in the document and flags them whenever they enter the viewport.
To add this package to your next project, simply download /view.js or run npm install scroll-visibility-js –save-dev and import it.
When importing and initializing the package, you can invoke one of two modules: "_util" (obj) or "ScrollView" (class).
import { ScrollView, _util as scroll } from 'scroll-visibility-js';
const newScrollObject = new ScrollView({
callback: () => console.log(this), // this represents the inview element
offset: 0,
repeat: true
});
const element1 = document.getElementById('demo');
const element2 = document.getElementById('demo');
scroll.fromTop(element1); // returns boolean
scroll.progress(element1); // returns num from 0 to 100
scroll.overlap(element1, element2 ); // returns boolean
scroll.scrollPostion(); // returns pixel quantity
scroll.visibility(element2); // returns boolean
By default, the module targets data-scrollvisibility elements and inserts their initial values as the animation-driving class. For instance, the element <a href="#" data-scrollvisibility="fadeIn"></a> will become <a href="#" class="fadeIn" data-scrollvisibility="true"></a> once in the viewport. Thus, it's best to structure your scss file in the following manner to perform scroll-based effects:
[data-scrollvisibility]{
opacity: 0;
visibility: hidden;
&.fadeIn {
transition: all 350ms ease-in-out;
transform: translateY(100px);
}
}
[data-scrollvisibility="true"]{
opacity: 1;
visibility: visible;
&.fadeIn {
transform: translateY(0);
}
}
FAQs
ES6 module that monitors elements in the document and flags them whenever they enter the viewport.
We found that scroll-visibility-js 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.