1.1.5 • Published 6 years ago

future-scroll v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

package template

npm package for smooth scrolling across browsers/mouses

installation

npm i future-scroll

NPM package

how to use

import FutureScroll, { Item } from "future-scroll";

const item = new Item({element});
item.add({
    ease : 0.1,
    render : (element, currentPosition) => {
        //currentPosition is number from 0 to 1
        //use it to animate your element, e.g. transform scale of image
        //use a mapping maths function to do this.
        //e.g. const map = (x, a, b, c, d) => ((x - a) * (d - c)) / (b - a) + c;
    }
});

const fs = new FutureScroll({
    article : document.querySelector(article),
    scrollable : document.querySelector(element),
    items : [item, ...]
})


const anotherItem = new Item({element});
anotherItem.add({
    ease : 0.1,
    render : (element, currentPosition) => {
    }
});
fs.addItem(anotherItem);

demo

Here is a demo

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago