Skip to content

Commit

Permalink
chore: 🤖 upgrade [email protected] (#15)
Browse files Browse the repository at this point in the history
* 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
theashraf authored Oct 30, 2023
1 parent 0019538 commit e5dd4b2
Show file tree
Hide file tree
Showing 14 changed files with 52,754 additions and 1,679 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion README.md
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)
92 changes: 91 additions & 1 deletion packages/web/README.md
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/
```
Loading

0 comments on commit e5dd4b2

Please sign in to comment.