
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
react-just-parallax
Advanced tools
React library for scroll and mousemove parallax effect ✨ Open source, production-ready
React Just Parallax is an open source, production-ready library that's designed for all creative developers and more.
npm install react-just-parallax
import { MouseParallax, ScrollParallax } from "react-just-parallax";
export const MyComponent = () => (
<>
<MouseParallax>
<p>I'm reacting to mouse move</p>
</MouseParallax>
<ScrollParallax>
<p>I'm reacting to scroll</p>
</ScrollParallax>
</>
);
Name | Type | Default | Description |
---|---|---|---|
strength | number | 0.14 | Parallax offset multiplier. Moving mouse by 10 pixels will move element position by 10px * strength |
lerpEase | number | 0.06 | Determines how quick the interpolation between offset values occurs (the higher the quicker) |
isAbsolutelyPositioned | boolean | false | If the element you want to use parallax on is positioned absolutely, set this prop to true |
zIndex | number | null | null | Specify element's outer container z-index (useful while using isAbsolutelyPositioned prop) |
shouldPause | boolean | true | Stops element from reacting to scroll and interpolating offset if it is out of view |
enableOnTouchDevice | boolean | false | Turns on/off parallax effect on touch devices |
scrollContainerRef | React.MutableRefObject | null | null | Use when element is situated in scrollable element other than window |
parallaxContainerRef | React.MutableRefObject | null | null | By default, element reacts to mousemove on window. You can specify any other container using this prop to make element react only within given container |
shouldResetPosition | boolean | false | Resets element's position if cursor leaves window or leaves parallaxContainerRef |
Name | Type | Default | Description |
---|---|---|---|
strength | number | 0.14 | Parallax offset multiplier. Scrolling by 10 pixels will move element position by 10px * strength |
lerpEase | number | 0.06 | Determines how quick the interpolation between offset values occurs (the higher the quicker) |
isAbsolutelyPositioned | boolean | false | If the element you want to use parallax on is positioned absolutely, set this prop to true |
zIndex | number | null | null | Specify element's outer container z-index (useful while using isAbsolutelyPositioned prop) |
shouldPause | boolean | true | Stops element from reacting to scroll and interpolating offset if it is out of view |
enableOnTouchDevice | boolean | true | Turns on/off parallax effect on touch devices |
isHorizontal | boolean | false | Enable if using horizontal scrolling |
scrollContainerRef | React.MutableRefObject | null | null | Use when element is situated in scrollable element other than window |
It's sometimes necessary to update values such as element's position or sizes on demand, for example if the DOM structure changes.
Library can't know of this kind of changes so it is not able to handle it by itself, and that's when we need to use ScrollParallaxHandle
to update them manually.
import { ScrollParallax, ScrollParallaxHandle } from "react-just-parallax";
export const MyComponent = () => {
const [display, setDisplay] = useState(true);
const scrollParallaxRef = useRef<ScrollParallaxHandle | null>(null);
useEffect(() => {
scrollParallaxRef.current?.updateValues();
}, [display]);
return (
<>
<ScrollParallax ref={scrollParallaxRef}>
<p>I'm reacting to scroll</p>
</ScrollParallax>
{display && (
<button onClick={() => setDisplay((false)}>
Disappear me
</button>
)}
</>
);
};
FAQs
React library for scroll and mousemove parallax effect ✨ Open source, production-ready
The npm package react-just-parallax receives a total of 1,615 weekly downloads. As such, react-just-parallax popularity was classified as popular.
We found that react-just-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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.