
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
criss-cross
Advanced tools
A simple and fast API to manage viewport and DOM elements intersections as you scroll
A simple and fast API to manage viewport and DOM elements intersections as you scroll.
Inspired by scrollmonitor from @stutrek and Kriss Kross
It uses Intersection Observer API, so make sure to add a polyfill.
npm install cross-criss --save-dev
import crissCross from 'criss-cross';
const $el = document.querySelector('.el');
const watcher = crissCross.create($el);
watcher.fullyEnterViewport(item => {
item.$el.classList.add('is-animated');
});
<script src="https://unpkg.com/criss-cross"></script>
<script>
const $el = document.querySelector('.el');
const watcher = crissCross.create($el);
watcher.lock();
watcher.on('exitViewport', item => {
if (item.isBeforeViewport) {
item.$el.classList.add('is-sticky');
}
});
</script>
Coming soon…
Returns a watchItem
(see below)
Type: HTMLElement
string
The DOM element you are "listening to".
If a string is used, it should be a "documentQuerySelectorable" reference.
Type: Object
Type: Number
Object
Default: 0
Refers to rootMargin property.
A number value sets equal top/bottom margins, in pixels.
Positive margins are added to the viewport bounding box, negative are removed.
Type: Number
Default: 0
Type: Number
Default: 0
for now, only the Y axis is supported…
Type: null
HTMLElement
Default: null
Refers to root property.
If the root
is null
, then the bounds of the actual document viewport are used.
Other values (HTMLElement) should be parent of target
.
Kills everything…
Type: Item
The watchItem you want to update the observer.
Type: Object
Same as create()
options parameter…
Returned by crissCross.create()
.
init
destroy
pause
resume
lock
*unlock
*(*) if a watchItem had to be "fixed" (like a sticky header or whatever), we need to "lock" its initial position.
lock()
creates a "ghost" element to keep control of the movements.
Event callbacks receive a
watchItem
as parameter.
"Aliases":
enterViewport
fullyEnterViewport
exitViewport
fullyExitViewport
"Binders":
on
off
one
isInViewport
isFullyInViewport
isBeforeViewport
isAfterViewport
wasInViewport
wasFullyInViewport
wasBeforeViewport
wasAfterViewport
$el
: watched elementobserver
: IntersectionObserver instancemanager
: CrissCross instance[0.0.7] - 2017-11-20
wasIn…
properties on updateFAQs
A simple and fast API to manage viewport and DOM elements intersections as you scroll
The npm package criss-cross receives a total of 0 weekly downloads. As such, criss-cross popularity was classified as not popular.
We found that criss-cross 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
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.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.