Skip to content

Commit

Permalink
完善用法说明
Browse files Browse the repository at this point in the history
  • Loading branch information
hxg2050 committed Dec 11, 2023
1 parent bcca898 commit c9f5fd7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```sh
npm install hease
```

```ts
import { hease, EASE } from 'hease';
// 播放,并注册相关事件
const ani = hease(0, 1, 2000, EASE.linear)
.onUpdate((val) => {
console.log(val);
})
.onComplate(() => {
console.log('动画播放完成');
})
.play();
// 停止动画
ani.stop();
// 立即完成动画
ani.complete();
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hease",
"private": false,
"version": "0.0.4",
"version": "0.1.0",
"repository": "https://github.com/hxg2050/hease.git",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down
6 changes: 3 additions & 3 deletions src/hease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _Hease extends EE {
* 目标状态
*/
to() {

}

/**
Expand All @@ -51,12 +51,12 @@ class _Hease extends EE {
repeat() {

}

/**
* 播放动画
*/
play() {

}

/**
Expand Down

0 comments on commit c9f5fd7

Please sign in to comment.