Code Monkey home page Code Monkey logo

lottie-wc's Introduction

Built With Stencil

Lottie Animation Web Component

This is a dead simple lottie animation web component, compiled with Stencil.

<lottie-animation src="./assets/lottie_logo.json" autoplay loop controls></lottie-animation>
<script src='https://unpkg.com/lottie-wc/dist/lottie.js'></script>

It's intentionally minimal design so that you can apply your own design language to this.

Lottie Animation Example

Using this component

Script tag

  • Publish to NPM
  • Put a script tag similar to this <script src='https://unpkg.com/lottie-wc/dist/lottie.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install lottie-wc --save
  • Put a script tag similar to this <script src='node_modules/lottie-wc/dist/lottie.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install lottie-wc --save
  • Add { name: 'lottie-wc' } to your collections
  • Then you can use the element anywhere in your template, JSX, html etc

Developing

To start building a new web component using Stencil, clone this repo to a new directory:

git clone https://github.com/splitinfinities/lottie-wc.git lottie-wc
cd lottie-wc
git remote rm origin

and run:

npm install
npm start

To watch for file changes during develop, run:

npm run dev

To build the component for production, run:

npm run build

To run the unit tests for the components, run:

npm test

Need help? Check out our docs here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.