0.1.5 • Published 6 years ago

polymate-view v0.1.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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