@pandolajs/animationframe

A window.requestAnimationFrame and window.cancelAnimationFrame compatible libaray.

Usage no npm install needed!

<script type="module">
  import pandolajsAnimationframe from 'https://cdn.skypack.dev/@pandolajs/animationframe';
</script>

README

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() }