
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Lightweight, dependency-free scroll animations using the Intersection Observer API. Simple, performant, and highly customizable.
prefers-reduced-motionnpm install scrollq
<link rel="stylesheet" href="node_modules/scrollq/dist/scrollQ.min.css" />
<script type="module">
import { initScrollQ } from "scrollq";
initScrollQ();
</script>
<!-- Add animations -->
<div data-q="fade-up">Animates on scroll</div>
<div data-q="slide-left" data-q-delay="200">Delayed animation</div>
initScrollQ({
threshold: 0.5, // When element is 50% visible (0-1)
reverse: false, // Enable reverse animations
rootMargin: "-50px", // Offset trigger area
duration: "0.6s", // Default animation duration
easing: "ease-out", // Default timing function
fromY: "7rem", // Default vertical distance
fromX: "7rem", // Default horizontal distance
selector: "[data-q]", // Custom selector
});
Option 1: Cleanup specific instance
const cleanup = initScrollQ();
// Later, when component unmounts:
cleanup();
Option 2: Cleanup all instances globally
import { initScrollQ, destroyScrollQ } from "scrollq";
initScrollQ();
// Later, to clean up everything:
destroyScrollQ();
| Type | Description |
|---|---|
fade | Simple fade in |
fade-up | Fade in from below |
fade-down | Fade in from above |
fade-left | Fade in from right |
fade-right | Fade in from left |
scale | Fade + scale up |
slide-up | Slide from below (no fade) |
slide-down | Slide from above (no fade) |
slide-left | Slide from right (no fade) |
slide-right | Slide from left (no fade) |
| Attribute | Default | Description |
|---|---|---|
data-q | - | Animation type (required) |
data-q-threshold | 0.5 | Trigger visibility (0.0-1.0) |
data-q-offset | - | Viewport offset (%, px, vh, rem) |
data-q-from | 7rem | Animation distance |
data-q-duration | 0.6s | Animation duration |
data-q-easing | ease-out | Timing function |
data-q-delay | - | Delay in milliseconds |
data-q-reverse | false | Reverse on scroll up |
:root {
--q-duration: 0.8s;
--q-easing: cubic-bezier(0.4, 0, 0.2, 1);
--q-from-y: 5rem;
--q-from-x: 5rem;
}
Staggered list:
<ul>
<li data-q="fade-up" data-q-delay="100">First</li>
<li data-q="fade-up" data-q-delay="200">Second</li>
<li data-q="fade-up" data-q-delay="300">Third</li>
</ul>
Trigger at viewport middle:
<div data-q="fade-up" data-q-offset="-50%">Centered trigger</div>
Reverse animations:
<div data-q="scale" data-q-reverse>Reverses when scrolling up</div>
Custom animation:
<div data-q="fade-up" data-q-from="10rem" data-q-duration="1s" data-q-easing="ease-in-out">
Smooth long-distance fade
</div>
ScrollQ uses the Intersection Observer API to watch elements. When visible, it adds the q-active class to trigger CSS transitions.
Behavior:
data-q-reverse, animations reverse when scrolling upprefers-reduced-motion for accessibilityChrome 51+, Firefox 55+, Safari 12.1+, Edge 15+
npm install
npm run build # Builds dist files
File sizes: 1.6KB JS + 1.5KB CSS (minified)
MIT License - feel free to use in personal and commercial projects.
Created by Kevin Terry
Inspired by AOS and the need for a super simple, modern scroll animation solution.
FAQs
Lightweight scroll-triggered animations using Intersection Observer API
We found that scrollq demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.