-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🤖 upgrade [email protected] (#15)
* chore: 🤖 upgrade [email protected] * docs: ✏️ update READMEs * chore: 🤖 add the dev script in README * chore: 🤖 update pnpm lock file * fix: 🐛 update in the animation loop
- Loading branch information
Showing
14 changed files
with
52,754 additions
and
1,679 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"linked": [["@lottiefiles/dotlottie-*"]], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
|
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
# dotlottie-web | ||
# dotlottie-web monorepo | ||
|
||
This is the monorepo for the dotlottie-web package. | ||
|
||
## Packages | ||
|
||
- [@lottiefiles/dotlottie-web](./packages/web/README.md) |
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 |
---|---|---|
@@ -1 +1,91 @@ | ||
# dotlottie-web | ||
# @lottiefiles/dotlottie-web | ||
|
||
A javascript library for rendering lottie and [dotLottie](https://dotlottie.io) animations in the browser. | ||
|
||
> **Note:** This package is currently in beta and the apis are subject to change. | ||
## Table of Contents | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Options](#options) | ||
- [Methods](#methods) | ||
- [Development](#development) | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @lottiefiles/dotlottie-web | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<canvas id="my-canvas"></canvas> | ||
``` | ||
|
||
```js | ||
import { DotLottie } from '@lottiefiles/dotlottie-web'; | ||
|
||
const dotLottie = new DotLottie({ | ||
autoplay: true, | ||
loop: true, | ||
canvas: document.getElementById('my-canvas'), | ||
src: "path/to/animation.json", | ||
}); | ||
``` | ||
|
||
## Options | ||
|
||
| Option | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| autoplay | boolean | false | Whether to start playing the animation immediately | | ||
| loop | boolean | false | Whether to loop the animation | | ||
| canvas | HTMLCanvasElement | null | The canvas element to render the animation to | | ||
| src | string | null | The path to the animation file | | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| play() | Play the animation | | ||
| pause() | Pause the animation | | ||
| stop() | Stop the animation | | ||
|
||
## Development | ||
|
||
### Setup | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
### Run Dev Server | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
### Build | ||
|
||
```bash | ||
pnpm build | ||
``` | ||
|
||
### Build WASM (optional) | ||
|
||
> **Note:** This step is necessary only if you wish to update the src/renderer.cpp file or the thorvg version being used. If not, you can skip this step. | ||
Using Docker (Recommended): | ||
|
||
```bash | ||
pnpm build:wasm:docker | ||
``` | ||
|
||
Using Emscripten SDK: | ||
|
||
Make sure you have the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html) installed. | ||
|
||
```bash | ||
pnpm build:wasm /path/to/emsdk/ | ||
``` |
Oops, something went wrong.