This package has been deprecated

Author message:

rename

polymate-view

0.1.5 • Public • Published

Polymate - Lottie Animation View for Polymer 2

Published on webcomponents.org GitHub issues GitHub stars GitHub license

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:

Example2 Example1 Example3 Example4

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

View documentation, FAQ, help, examples, and more at airbnb.io/lottie

Demo

<style> 
  #demo {
     --polymate-view-width: 400px;
  }
</style>
<polymate-view id="demo" path="demo/motorcycle.json" autoplay loop show-controllers></polymate-view>

Installation

Install through npm:

npm install --save polymate-view

Install through bower:

bower install --save polymate-view

Usage

  1. Import the polymate view component
<link rel="import" href="../polymate-view/polymate-view.html">
  1. Initialize

Download animation json from LottieFiles.com or use some json from demo folder

  • Using path, autoplay and loop
<polymate-view id="loader" 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>

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 Bodymoving Documentation

Related Projects

Contribution

Appreciate your contributions and suggestions.

License

MIT

Package Sidebar

Install

npm i polymate-view

Weekly Downloads

0

Version

0.1.5

License

MIT

Unpacked Size

7.67 MB

Total Files

28

Last publish

Collaborators

  • johnreemar