@pandolajs/animationframe

1.0.0 • Public • Published

animationFrame

A requestAnimationFrame and cancelAnimationFrame compatible javascript library which provide base support for the animation.

Usage

ES6 and beyond

  import animationFrame from '@pandolajs/animationframe'

  const { raf, caf, highResTimestamp } = animationFrame

  // raf: requestAnimationFrame
  // caf: cancelAnimationFrame
  // highResTimestamp

UMD

  <script src="https://path.to.animationframe" />
  <script>
    window.animationFrame.raf()
    window.animationFrame.caf()
    window.animationFrame.highResTimestamp()
  </script>

APIs

{ raf: Function | window.requestAnimationFrame caf: Function | window.cancelAnimationFrame highResTimestamp: Function | window.performance.now() }

Package Sidebar

Install

npm i @pandolajs/animationframe

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

9.34 kB

Total Files

7

Last publish

Collaborators

  • cherrylong
  • sizhao