Skip to content
/ lumiere Public

Animation wrapper based on rAF (requestAnimationFrame)

License

Notifications You must be signed in to change notification settings

kiltjs/lumiere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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/89944193/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

});

About

Animation wrapper based on rAF (requestAnimationFrame)

Resources

License

Stars

Watchers

Forks

Packages

No packages published