Skip to content

animate.ts is an animation library for Typescript.

Notifications You must be signed in to change notification settings

xing403/animate.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

animate.ts

animate.ts is an animation library for Typescript.

install animate.ts

npm install animate.ts

usage

import animate from 'animate.ts';

function easing(x: number): number {
  return x;
}
// an animation will run for 3 seconds
const stop = animate({
  start: 0,
  end: 1000,
  duration: 3000,
  easing: easing.easeOutBounce,
  onStep: (progress: number, x: number) => {
    console.log("current progress",progress); // 'easing' return value
    console.log("current x",x); // the range of x is form start to end
  }
})

use easing

import easing from "animate.ts/dist/easing.js";

stop animation

// if you want to stop animation after two seconds
setTimeout(stop, 2000)

About

animate.ts is an animation library for Typescript.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published