
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
gatsby-plugin-scroll-reveal
Advanced tools
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
yarn add gatsby-plugin-scroll-reveal
or
npm install --save gatsby-plugin-scroll-reveal
gatsby-config.js
file.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.
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
}
}
];
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 - requireddata-sal-duration
- changes duration of the animation - optionaldata-sal-delay
- adds delay to the animation - optionaldata-sal-easing
- sets easing for the animation - optionalFor 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
This plugin is not compatible anymore with Gatsby v1, you should update to the version 2.0.0.
We are open to new functionalities or fix bugs. If you want to collaborate to improve this plugin, just make a pull request 🤗
Created by Soluble Studio. Released under the MIT License.
FAQs
Animate DOM elements on scroll changes.
The npm package gatsby-plugin-scroll-reveal receives a total of 333 weekly downloads. As such, gatsby-plugin-scroll-reveal popularity was classified as not popular.
We found that gatsby-plugin-scroll-reveal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.