wrapper of lottie-web
Lottie is a mobile library for Web, and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile!
For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:
We currently support solids, shape layers, masks, alpha mattes, trim paths, and dash patterns. And we’ll be adding new features on a regular basis.
You can go forward, backward, and most importantly you can program your animation to respond to any interaction.
Bundle vector animations within your app without having to worry about multiple dimensions or large file sizes. Alternatively, you can decouple animation files from your app’s code entirely by loading them from a JSON API.
Download lottie files › lottiefiles.com
View documentation, FAQ, help, examples, and more at airbnb.io/lottie
<style>
#polymateElement {
--polymate-view-width: 400px;
}
</style>
<polymate-view id="polymateElement" path="demo/motorcycle.json" autoplay loop show-controllers></polymate-view>
Install through npm:
npm install --save polymate
Install through bower:
bower install --save polymate
- Import the polymate view component
<link rel="import" href="../polymate/polymate-view.html">
- Initialize
Download animation json from LottieFiles.com or use some json from demo folder
- Using path, autoplay and loop
<polymate-view id="polymateElement" path="data.json" autoplay loop></polymate-view>
- Using options object
<polymate-view id="polymateElement"></polymate-view>
<script>
class PolymateElement extends Polymer.Element {
static get is() { return 'polymate-element'; }
ready() {
super.ready();
this.$.polymateElement.options = {
path: 'data.json',
loop: true,
autoplay: true
};
}
}
window.customElements.define(PolymateElement.is, PolymateElement);
</script>
- Style
- custom vars
<style>
#polymateElement {
--polymate-view-width: 100px;
--polymate-view-height: 100px;
}
</style>
- font-size
<style>
#polymateElement {
font-size: 24px;
}
</style>
You can pass a configuration object through options
property:
- animationData: an Object with the exported animation data.
- path: the relative path to the animation object. (animationData and path are mutually exclusive)
- loop: true / false / number
- autoplay: true / false it will start playing as soon as it is ready
- renderer: 'svg' / 'canvas' / 'html' to set the renderer
More information on lottie-web Documentation
- Bodymovin ng-lottie is a wrapper of bodymovin
- Angular Lottie angular implementation
- Ionic Lottie Thanks for @yannbf demonstrating ng-lottie on ionic3
- React Lottie react implementation
- Vue Lottie vue implementation
- React Native Lottie react native implementation by airbnb
- IOS Lottie ios implementation by airbnb
- Android Lottie android implementation by airbnb
Appreciate your contributions and suggestions.
MIT