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

gatsby-plugin-scroll-reveal

v0.0.7

Published

Animate DOM elements on scroll changes.

Downloads

3,486

Readme

gatsby-plugin-scroll-reveal ✨

npm version License: MIT

Gatsby plugin to animate DOM elements on scroll. Using Sal (Scroll Animation Library) focus on performance less than 2.8kb, written in vanilla Javascript.

To see how to use advanced options visit Sal's docs.

Note: Supported IE11

Install

yarn add gatsby-plugin-scroll-reveal

or

npm install --save gatsby-plugin-scroll-reveal

How to use

  1. Include the plugin in your gatsby-config.js file.
  2. Add your custom options object (optional)
// in gatsby-config.js
plugins: [
  `gatsby-plugin-scroll-reveal`
];

Note: If you are using Gatsby Plugin Transition Link add this plugin first in the config.

Options

Here is a full list of options with their default values you can use to configure this plugin.

// in gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-scroll-reveal`,
    options: {
        threshold: 1, // Percentage of an element's area that needs to be visible to launch animation
        once: true, // Defines if animation needs to be launched once
        disable: false, // Flag for disabling animations
        
        // Advanced Options
        selector: '[data-sal]', // Selector of the elements to be animated
        animateClassName: 'sal-animate', // Class name which triggers animation
        disabledClassName: 'sal-disabled', // Class name which defines the disabled state
        rootMargin: '0% 50%', // Corresponds to root's bounding box margin
        enterEventName: 'sal:in', // Enter event name
        exitEventName: 'sal:out', // Exit event name
    }
  }
];

Usage

It will look for all HTML elements with a data-sal attribute and launch their animation when in viewport.

  • data-sal - attribute with the animation name as value - required
  • data-sal-duration - changes duration of the animation - optional
  • data-sal-delay - adds delay to the animation - optional
  • data-sal-easing - sets easing for the animation - optional

For example:

<div
  data-sal="slide-up"
  data-sal-delay="300"
  data-sal-easing="ease"
></div>

The library supports:

  • fade
  • slide-up
  • slide-down
  • slide-left
  • slide-right
  • zoom-in
  • zoom-out
  • flip-up
  • flip-down
  • flip-left
  • flip-right

Gatsby v1

This plugin is not compatible anymore with Gatsby v1, you should update to the version 2.0.0.

Collaborate

We are open to new functionalities or fix bugs. If you want to collaborate to improve this plugin, just make a pull request 🤗

License

Created by Soluble Studio. Released under the MIT License.