# polymate

> Lottie Animation View for Polymer 2

Latest version **0.1.7** (published 2018-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install polymate
pnpm add polymate
yarn add polymate
bun add polymate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2018-06-11 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.3 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | John Reemar Dela Rosa |
| Maintainers | johnreemar |
| Keywords | lottie, animation, polymer, after-effects, advanced |

## Links

- npm: https://www.npmjs.com/package/polymate
- Repository: https://github.com/AfterWebX/polymate-view
- Homepage: https://github.com/AfterWebX/polymate-view#readme
- Issues: https://github.com/AfterWebX/polymate-view/issues
- npm.io page: https://npm.io/package/polymate

## Dependencies (1)

- [standard-version](https://npm.io/package/standard-version.md) 4.4.0

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 0.1.7 (latest) — 2018-06-11
- 0.1.6 — 2018-06-11

## README

<h1 align="center">
  Polymate - Lottie Animation View for Polymer 2
</h1>
<p align="center">
  <a href="https://www.webcomponents.org/element/reemardelarosa/polymate" rel="nofollow" class="rich-diff-level-one"><img src="https://camo.githubusercontent.com/e92dc407af2fd15cebe3fb7449c112c0bdc05e63/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f776562636f6d706f6e656e74732e6f72672d7075626c69736865642d626c75652e737667" alt="Published on webcomponents.org" data-canonical-src="https://img.shields.io/badge/webcomponents.org-published-blue.svg"></a>
  <a href="https://github.com/reemardelarosa/polymate/issues" class="rich-diff-level-one"><img src="https://camo.githubusercontent.com/02f594d1a98dd50b63ffe20818b8e26298b251c0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f7265656d617264656c61726f73612f706f6c796d6174652e737667" alt="GitHub issues" data-canonical-src="https://img.shields.io/github/issues/reemardelarosa/polymate.svg" style="max-width:100%;"></a> <a href="https://github.com/reemardelarosa/polymate/stargazers" class="rich-diff-level-one"><img src="https://camo.githubusercontent.com/742c81b6c3c840a3f723409bdb1d8f3e4e34268b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7265656d617264656c61726f73612f706f6c796d6174652e737667" alt="GitHub stars" data-canonical-src="https://img.shields.io/github/stars/reemardelarosa/polymate.svg" style="max-width:100%;"></a>
  <a href="https://raw.githubusercontent.com/reemardelarosa/polymate/master/LICENSE" rel="nofollow"><img src="https://camo.githubusercontent.com/890acbdcb87868b382af9a4b1fac507b9659d9bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667" alt="GitHub license" data-canonical-src="https://img.shields.io/badge/license-MIT-blue.svg" style="max-width:100%;"></a>
</p>

<h2 align="center">
  wrapper of <a href="https://github.com/airbnb/lottie-web">lottie-web</a>
</h2>
<p align="center">
  Lottie is a mobile library for Web,  and iOS that parses <a href="http://www.adobe.com/products/aftereffects.html">Adobe After Effects</a> animations exported as json with <a href="https://github.com/airbnb/lottie-web">Bodymovin</a> and renders them natively on mobile!
</p>
<p align="center">
  For the first time, designers can create <b>and ship</b> beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:
</p>

<p align="center" class="rich-diff-level-zero">
  <img src="/gifs/polymate-preview5.gif" alt="Example2">
  <img src="/gifs/polymate-preview0.gif" alt="Example1">
  <img src="/gifs/polymate-preview1.gif" alt="Example3" style="width: 500px;">
  <img src="/gifs/polymate-preview4.gif" alt="Example4">
</p>

## Why Lottie?


#### Flexible After Effects features
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.

#### Manipulate your animation any way you like
You can go forward, backward, and most importantly you can program your animation to respond to any interaction.

#### Small file sizes
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](https://www.lottiefiles.com/)

## View documentation, FAQ, help, examples, and more at [airbnb.io/lottie](http://airbnb.io/lottie/)

## [Demo](https://www.webcomponents.org/element/AfterWebX/polymate-view?bower)
<!--
```
<custom-element-demo>
  <template>
    <script src="../webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="polymate-view.html">
    <next-code-block></next-code-block>
  </template>
</custom-element-demo>
```
-->
```html
<style> 
  #polymateElement {
     --polymate-view-width: 400px;
  }
</style>
<polymate-view id="polymateElement" path="demo/motorcycle.json" autoplay loop show-controllers></polymate-view>
```

## Installation

Install through npm:
```js
npm install --save polymate
```

Install through bower:
```js
bower install --save polymate
```

## Usage
1. Import the polymate view component
```html
<link rel="import" href="../polymate/polymate-view.html">
```
2. Initialize <polymate-view>
> Download animation json from [LottieFiles.com](https://www.lottiefiles.com/) or use some json from [demo](https://github.com/AfterWebX/polymate/tree/master/demo) folder

- Using path, autoplay and loop
```html
<polymate-view id="polymateElement" path="data.json" autoplay loop></polymate-view>
```
- Using options object
```html
<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>
```
3. Style
- custom vars
```html
<style> 
  #polymateElement {
     --polymate-view-width: 100px;
     --polymate-view-height: 100px;
  }
</style>
```

- font-size
```html
<style>
  #polymateElement {
     font-size: 24px;
  }
</style>
```
## Configuration

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](https://github.com/bodymovin/bodymovin)

## Related Projects

* [Bodymovin](https://github.com/bodymovin/bodymovin) ng-lottie is a wrapper of bodymovin
* [Angular Lottie](https://github.com/chenqingspring/ng-lottie) angular implementation
* [Ionic Lottie](https://github.com/yannbf/ionic-lottie) Thanks for @yannbf demonstrating ng-lottie on ionic3
* [React Lottie](https://github.com/chenqingspring/react-lottie) react implementation
* [Vue Lottie](https://github.com/chenqingspring/vue-lottie) vue implementation
* [React Native Lottie](https://github.com/airbnb/lottie-react-native) react native implementation by airbnb
* [IOS Lottie](https://github.com/airbnb/lottie-ios) ios implementation by airbnb
* [Android Lottie](https://github.com/airbnb/lottie-android) android implementation by airbnb

## Contribution

Appreciate your contributions and suggestions.

## License

MIT

---
_Source: https://npm.io/package/polymate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
