diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 4385b78..577da57 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -19,4 +19,5 @@ jobs: - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_PUBLISH_TOKEN }} + package: dist access: 'public' diff --git a/package.json b/package.json index 93cc8f3..733d409 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tari-project/tari-tower", - "version": "0.0.1", + "version": "0.0.2", "private": false, "description": "the tower animation used in Tari Universe", "homepage": "https://github.com/tari-project/tari-tower#readme", @@ -24,7 +24,7 @@ "default": "./dist/main.js" } }, - "main": "lib/main.ts", + "main": "dist/main.js", "files": [ "/dist" ], diff --git a/public/README.md b/public/README.md new file mode 100644 index 0000000..ccb6238 --- /dev/null +++ b/public/README.md @@ -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`
**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) |