npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scrollq

v1.0.2

Published

Lightweight scroll-triggered animations using Intersection Observer API

Readme

ScrollQ

Lightweight, dependency-free scroll animations using the Intersection Observer API. Simple, performant, and highly customizable.

Features

  • 🪶 Lightweight - 1.6KB JS + 1.5KB CSS minified
  • Performant - Native Intersection Observer API
  • 🎨 Flexible - 10 animation variants with full customization
  • Accessible - Respects prefers-reduced-motion

Installation

npm install scrollq

Quick Start

<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>

Global Configuration

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
});

Cleanup (SPAs)

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();

Animations

| 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) |

Customization

Element Attributes

| 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 |

CSS Variables

:root {
  --q-duration: 0.8s;
  --q-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --q-from-y: 5rem;
  --q-from-x: 5rem;
}

Examples

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>

How It Works

ScrollQ uses the Intersection Observer API to watch elements. When visible, it adds the q-active class to trigger CSS transitions.

Behavior:

  • Animations trigger when scrolling down and element enters from bottom
  • With data-q-reverse, animations reverse when scrolling up
  • Elements already scrolled past are automatically activated on page load
  • Respects prefers-reduced-motion for accessibility

Browser Support

Chrome 51+, Firefox 55+, Safari 12.1+, Edge 15+

Development

npm install
npm run build  # Builds dist files

File sizes: 1.6KB JS + 1.5KB CSS (minified)

License

MIT License - feel free to use in personal and commercial projects.

Credits

Created by Kevin Terry

Inspired by AOS and the need for a super simple, modern scroll animation solution.