-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ce9e12
commit 672accf
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# tari-tower | ||
|
||
Source for the tower animation used in [_Tari Universe_](https://github.com/tari-project/universe). | ||
|
||
### Installation | ||
|
||
```bash | ||
npm i @tari-project/tari-tower | ||
``` | ||
|
||
## Usage | ||
|
||
Initialise | ||
|
||
```tsx | ||
import { loadTowerAnimation } from '@tari-project/tari-tower'; | ||
|
||
loadTowerAnimation(); | ||
``` | ||
|
||
Available methods: | ||
|
||
| name | args | description | | ||
| ------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- | | ||
| `loadTowerAnimation` | **canvasId**: `string` <br/> **offset?**: `number` | initialise all the animation logic + canvas | | ||
| `removeTowerAnimation` | `none` | stop the animation and remove canvas | | ||
| `setAnimationState` | **id**: `'start'\|'stop'\|'fail'\|'sucess'\|'sucess2'\|'sucess3'` <br/> **isReplay?:** `boolean` | set the animation state | | ||
| `setAnimationProperties` | properties:`{property:string; value:unknown}[]` | set properties (e.g colours in dark vs light mode) | | ||
|
||
Available values: | ||
|
||
| name | description | | ||
| ---------------------- | --------------------------------------------------------------------------- | | ||
| `animationStatus` | the state of the animation | | ||
| `animationStatusIndex` | the index of the animation state (useful as a trigger in dependencya array) | |