Skip to content

tari-project/tari-tower

Repository files navigation

tari-tower

Source for the tower animation used in Tari Universe.

Installation

    npm i @tari-project/tari-tower

Usage

Initialise

import { loadTowerAnimation } from '@tari-project/tari-tower';

loadTowerAnimation();

Available methods:

name args description
loadTowerAnimation canvasId: string
offset?: number
initialise all the animation logic + canvas
removeTowerAnimation none stop the animation and remove canvas
setAnimationState id: 'start'|'stop'|'fail'|'sucess'|'sucess2'|'sucess3'
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)

Contributing

Development

note: must be built first to be able to reference the lib locally

    npm ci
    npm run build
    npm run dev
  • make changes in the lib directory
  • export anything you want available in /lib/main.ts
  • update readme

Distribution

  • make sure your tari labs registry PAT is set up
  • bump version in package.json
  • build changes:
    npm run build
  • publish changes:
    npm publish