Scroll animations for Smooth Scroll Bar
npm install scroll-animationsJavaScript plugin that implement AOS and Relax animations on scrolling with Smooth Scrollbar
- Smooth Scrollbar
- AOS - aos.css
- TweenMax (GSAP - GreenSock Animation Platform)
1. Download or git clone
``bash`
git clone https://github.com/BiserStoilov/scroll-animations.git
`
1. Install dependencies
bash`
npm install
`
1. Run demo
bash`
npm run demo
`
1. Build production with dependencies
bash`
npm run build
1. Run plugin
`html`
`javascript`
import scrollAnimations from 'path/to/scroll-animations/src/index';
const sa = scrollAnimations({
element: '#scroll-animation-content'
});
1. Public methods
`javascript`
// Get Smooth Scrollbar instance
const smoothScrollBar = sa.getScrollBar();
// Destroy
sa.destroy();
`
1. Smoot ScrollBar Methods
javascript`
const sa = scrollAnimations({
element: '#scroll-animation-content'
});
const smoothScrollBar = sa.getScrollBar();
const element = document.querySelector('#your-element');
smoothScrollBar.addListener(() => {
console.log(smoothScrollBar.isVisible(element));
});
`bash``
npm i scroll-animations