0.0.3 • Published 2 years ago

@gausszhou/animation v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Animation

Make tween easier to use

Live Demo

Preview Address: Transport

Usage

npm i @gausszhou/animation
import animation from "@gausszhou/animation";

const eleBall = document.querySelectorAll("i")[0]
eleBall.onclick = function () {
  if (isMoving == true) {
    return;
  }
  animation(
    0,
    800 - 42,
    (value: string | number): void => {
      eleBall.style.transform = "translateX(" + value + "px)";
    },
    animationType,
    600
  );
};

Code Reference

https://github.com/zhangxinxu/Tween