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

twk-scroll-animations

v0.1.4

Published

GSAP-powered scroll animations library

Readme

TWK Scroll Animations

A GSAP-powered scroll animations library that makes it easy to add scroll-triggered animations to your website.

It works with TailwindCSS 3 reading the Tailwind config file to get the breakpoints.

Installation

npm install twk-scroll-animations gsap

Dependencies

Usage

import twkScrollAnimations from 'twk-scroll-animations';

// Initialize basic
const scrollAnimations = new twkScrollAnimations()

// Initialize with optional custom breakpoints
const scrollAnimations = new twkScrollAnimations({
    screens: {
        xs: '480px',
        sm: '640px',
        md: '768px',
        lg: '1024px',
        xl: '1280px',
        '2xl': '1536px'
    }
});


// In your HTML
<div twk-aos="fade-up">
Animated content: fade-up on all screens with default duration.
</div>

<div twk-aos="fade-up" twk-aos-duration="800" twk-aos-delay="200" twk-aos-ease="power2.inOut">
Animated content: with duration, delay and ease.
</div>

<div twk-aos="fade-right" twk-aos-xl="fade-left">
Animated content: fade-left on XL screens and up, fade-right on smaller screens.
</div>

Available Animations

  • fade-in
  • fade-up
  • fade-down
  • fade-left
  • fade-right
  • slide-up
  • slide-down
  • slide-left
  • slide-right
  • mask-right
  • mask-sides

Adding Custom Animations

import twkScrollAnimations, { gsapEffects } from 'twk-scroll-animations'

// Add your custom animation before initializing
gsapEffects.push({
    id: "custom-zoom-in", // This will be the name used in twk-aos attribute
    animate: 'fromTo',
    props1: {
        scale: 0.5,
        autoAlpha: 0
    },
    props2: {
        scale: 1,
        autoAlpha: 1
    }
});

// Initialize after adding custom animations
const scrollAnimations = new twkScrollAnimations();

Animation Properties

The animation object structure:

  • id: String - The name of your animation
  • animate: String - Can be 'from', 'to', or 'fromTo'
  • props1: Object - Initial properties (or 'from' properties for fromTo)
  • props2: Object - Final properties (only for fromTo animations)

You can use any GSAP properties in your animations, such as:

  • scale
  • rotation
  • x, y
  • autoAlpha
  • opacity
  • skew
  • And more!

Accessibility and Performance

Reduced Motion Support

The library automatically respects user's prefers-reduced-motion setting. When a user has enabled reduced motion in their system preferences, animations will be disabled to ensure a comfortable browsing experience.

No JavaScript Fallback

If JavaScript is disabled or not supported, the library gracefully falls back to displaying content without animations. This ensures that your website remains fully functional and accessible across all browsing environments.

Attributes

  • twk-aos: Animation name
  • twk-aos-duration: Animation duration in milliseconds
  • twk-aos-delay: Animation delay in milliseconds
  • twk-aos-trigger: Custom trigger position
  • twk-aos-ease: Custom easing function
  • twk-aos-stagger: Stagger value for child elements
  • twk-aos-marker: Enable GSAP markers for debugging

License

This project is licensed under the MIT License. See the LICENSE file for details.

MIT License Highlights

  • Commercial use allowed
  • Modifications permitted
  • Distribution allowed
  • Private use allowed
  • No warranty provided