ease-animate

let everything ease animate

Usage no npm install needed!

<script type="module">
  import easeAnimate from 'https://cdn.skypack.dev/ease-animate';
</script>

README

ease-animate

Build Status

A javascript ease animate library

Usage

install

npm install --save ease-animate

or

<script type="text/javascript" src='./dist/ease-animate.min.js'></script>

run

const animate = new Animate()

dom animate

animate.domAnimate({
  selector: '#ele',
  opts: {top: 200, left: 500},
  duration: 1000,
  onDone () {
    console.log('dom done')
  },
})

scrollbar animate

animate.scrollAnimate({
  targetValue: 0,
  duration: 1000,
  onDone () {
    console.log('scroll done')
  },
})

API

new Animate()

domAnimate()

void domAnimate(opts) dom animation

opts:

selector element selector

opts css attribute and value

[duration] default 500

[easing] ease type, default 'quadInOut'

scrollAnimate()

void animate.scrollAnimate(opts) scrollbar animation

opts:

position target position

[duration] default 500, ms

[easing] default 'circleInOut'

isScrolling

is scrolling

isDomRunning

is dom animating

easing

see ease-generator

demo

here

browser support

excluding ie8-