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-scroll-fade-animation

v0.5.4

Published

react scroll fade animation component

Downloads

162

Readme

🖱 React Scroll Fade Animation

NPM package for React Scroll Animation !

It is made with Hooks from React-Typescript.

You can use this with several animations by SIMPLE CODES.

💁🏻‍♂️ DEMO

👀 Provide Animations (will be updated for more functions later)

import ScrollAnimate from 'react-scroll-fade-animation

  • Fade Bottom to Top ⬆️
  • Fade Top to Bottom ⬇️
  • Fade Left to Right ➡️
  • Fade Right to Left ⬅️
  • Fade & Bounce Bottom to Top ⬆️
  • Fade & Bounce Top to Bottom ⬇️
  • Fade & Bounce Left to Right ➡️
  • Fade & Bounce Right to Left ⬅️

import ObserveAnimate from 'react-scroll-fade-animation/observe

  • set offset then you can set displaying path

Other functions are added later!

💡 HOW TO USE

🛠 Install

npm i react-scroll-fade-animation

or

yarn add react-scroll-fade-animation

📚 Import and Use

import React from 'react';
import ScrollAnimate from 'react-scroll-fade-animation';

export default function App() {
  return (
    <div>
      <div
        style={{
          height: '100vh',
          border: '1px solid gray',
        }}
      >
        top blank
      </div>

      {/* This Element shows on Scroll */}
      <ScrollAnimate path={'bottom-bounce'}>{/* Insert Your Item ! */}</ScrollAnimate>

      <div
        style={{
          height: '100vh',
          border: '1px solid gray',
        }}
      >
        bottom blank
      </div>
    </div>
  );
}

This Component appears in middle of Viewport.

But you can custom Duration, Delay and Wrapper Style.

🏭 Props

Import Scroll

import ScrollAnimate from 'react-scroll-fade-animation';

| Prop Name | Required | Default Value | Type | Description | | :----------: | :------: | :-----------: | :-----: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | path | X | top | string | You can choose 'top','bottom','left','right','top-bounce','bottom-bounce','left-bounce','right-bounce' (low cases). It means appearance direction [example of 'top', it shows 'bottom' 👉 'top'] | | delay | X | 0 | number | Milliseconds | | duration | X | 1200 | number | Milliseconds | | offsetHeight | X | 0 | number | You can adjust the scroll height at which items are displayed. Both negative and positive numbers are possible. If the set value is negative, it is displayed faster, and if it is positive, it is displayed later. | | reAnimate | X | false | boolean | If the setting value is true, the item disappears if it moves back to the top of the view. If you scroll down the screen again, the animation that shows the item works again. Default(false) is not showing animation again. |

Import Observe

import ScrollAnimate from 'react-scroll-fade-animation/observe';

| Prop Name | Required | Default Value | Type | Description | | :-------: | :------: | :------------------: | :----------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | delay | X | 0 | number | Milliseconds | | duration | X | 1200 | number | Milliseconds | | offset | X | { x: 0, y: 0, z: 0 } | Object | You can adjust the transition position at which items are displayed. | | reAnimate | X | false | boolean | If the setting value is true, the item disappears if it moves back to the top of the view. If you scroll down the screen again, the animation that shows the item works again. Default(false) is not showing animation again. | | threshold | X | 0.7 | number or number[] | It refers to the percentage of the item appearing in the viewport. 0.7 means that 70% of the items wrapped in scroll component are displayed in the viewport. |

🍔 Example

import React from 'react';
import ScrollAnimationItem from 'react-scroll-fade-animation';

const ScrollItem = ({ title }) => (
  <ScrollAnimationItem
    path={'left'}
    delay={100}
    duration={1500}
    style={{
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center',
    }}
  >
    {title}
  </ScrollAnimationItem>
);

export const ScrollWrapper = ({ itemList }) => (
  <>
    {itemList.map(item => (
      <ScrollItem key={title} title={title} />
    ))}
  </>
);

more Examples are in DEMO

🧑🏻‍💻 Contribute

If you have a nice idea or something to modify codes or bugs, you can make Issue or Pull Request everytime!