@kilt/lumiere

1.0.3 • Public • Published

@kilt/lumiere

Animation wrapper based on rAF (requestAnimationFrame)

npm Build Status GitHub license

npm

npm i @kilt/lumiere --save

yarn

yarn add lumiere

Usage

<script src="https://cdn.rawgit.com/kiltjs/lumiere/2449a6f3/dist/lumiere.min.js"></script>
import lumiere from 'lumiere';

var initial_scroll = document.scrollingElement.scrollTop,
    scroll_length = 100; // scroll down 100px

lumiere(400, function (progress) {

  document.scrollingElement.scrollTop = initial_scroll + scroll_length*progress;

}, function (progress) {

  // example of easeInQuad
  return progress*progress;

  // check out https://gist.github.com/gre/1650294 for more easing functions
  // also check out https://github.com/gre/bezier-easing

}).then(function () {

  // animation finished

});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    3
  • 1.0.2
    0
  • 1.0.1
    1

Package Sidebar

Install

npm i @kilt/lumiere

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

12.7 kB

Total Files

9

Last publish

Collaborators

  • jgermade