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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-animate-on-scroll-animate.css

v1.0.5

Published

A react hook that uses intersecton observer API and classes from https://animate.style/. The animations are triggered when the element if in view of the viewport.

Downloads

315

Readme

REACT ANIMATE ON SCROLL HOOK

useAnimationOnScroll(scrollElem || null, {noRepeat : false})

How to use

  1. Install packages
npm install react-animate-on-scroll-animate.css animate.css --save
  1. Import the hook to the file you want to use animations in and also impport animate.css
import "animate.css"
import useAnimationOnScroll from "react-animate-on-scroll-animate.css"
  1. Start using in your animation
import "animate.css"
import useAnimationOnScroll from "react-animate-on-scroll-animate.css"
import {useRef} from "react";

//vertically scrollable component whose children should be animated.
export default function Component() {
    const scrollElem = useRef(null)
    useAnimationOnScroll(scrollElem || null, {noRepeat : false})
    return (
        //add ref
        //specify the element which when it appears in the viewport triggers the animation
        //add animation-settings attributes to the elements to be animated.
        //Add animate__onscroll class to the classList of the element to be animated.
        <div ref={scrollElem}>
            <div className="animate-onscroll-trigger">
                <p animation-settings="animate__fadeInDown animate__slower" className="animate__onscroll" >
                    hello world
                </p>
            </div>
        </div>
    )
}

The value of the animation-settings attributes are to be the animate.css animaton classes except from and animate__animated class.

Live Samples

S/N | Live link| Source code | Note ----|----------|---------|-- 1 | My Portfolio's home page | here | This project originated from here. I wrote it initially while building my portfolio.

Note

I might not update this project in the future because of time. There are lot of features it could have. I am only publishing this because I do not want to keep on moving files just to use my code. I want to use via npm install instead. It is 3:23 am 4/11/2024. I need sleep. I have a project I am working on simultaneously. Happy coding. Made with 🫡. Bye for now. Please make a pull request.