Table of Contents
- Lottie
- Intro / Features
- Getting Started
- Creating Incidents
- Adding Incidents in your clip
- Contributing
- License
- Sponsored by
Lottie brings some capabilities of Lottie Library into MotorCortex. Lottie plugin helps you control a lottie file which is a JSON-based animation file format with small size. With this Plugin you can manipulate your lottie any way you like and create unique animations.
The Plugin exposes two Incidents in total:
- Clip
- Play Incident
$ npm install --save @donkeyclip/lottie
# OR
$ yarn add @donkeyclip/lottie
import { loadPlugin } from "@donkeyclip/motorcortex";
import LottieDefinition from "@donkeyclip/lottie";
const Lottie = loadPlugin(LottieDefinition);
const newCustomClip = new Lottie.Clip(
{
path: "https://donkeyclip.github.io/lottie/demo//demo.json",
autoloop: false,
},
{
selector: "#myclip",
}
);
Name | Are | Values |
---|---|---|
path | the path of lottie.json fille | string |
autoloop | autoloop will auto play in loop the lottie animation | bool |
const play = new Lottie.Play(
{
animatedAttrs: {
fraction: 0.5,
},
},
{
duration: 1500,
selector: "!#lottie",
}
);
Name | Are | Values |
---|---|---|
fraction | how many fractions of the clip will be played | num from 0 to 1 |
lottieClip.addIncident(playIncident, startTime);
In general, we follow the "fork-and-pull" Git workflow, so if you want to submit patches and additions you should follow the next steps:
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes