0.10.0 • Published 3 years ago

scrrroll v0.10.0

Weekly downloads
14
License
MIT
Repository
github
Last release
3 years ago

Scrrroll

Simple smooth scrolling.

Install

npm install scrrroll

Example Setup

Javascript

import Scroll from 'scrrroll';

const destination = document.querySelector('.selector'); // Number or HTMLElement
const duration = 400; // Number
const easing = t => t; // Easing function

// Scroll to position/element
Scroll.to(destination, duration, easing).then(() => {});

// Scroll to the top
Scroll.toTop(duration, easing).then(() => {});

// Scroll to the bottom
Scroll.toBottom(duration, easing).then(() => {});

// Scroll an element into view
Scroll.intoView(destination, duration, easing).then(() => {});

// Scroll to the top of an element
Scroll.top(destination, duration, easing).then(() => {});

// Scroll an element into the center of the viewport
Scroll.center(destination, duration, easing).then(() => {});

// Scroll to the bottom of an element
Scroll.bottom(destination, duration, easing).then(() => {});

License

MIT License

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.0

7 years ago

0.1.0

7 years ago