Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

Installation

Gavin Rough edited this page Dec 30, 2019 · 4 revisions

The quickest way to get started is to use a template from Glitch or CodePen. If you want to make your own web page or install the Node.js module, read on.

Load the script from the web

You can load the pixel-animator.js file from the web into your own HTML page. The script defines a global variable PixelAnimator. You'll need an element like <div id="my-animation" /> so that the animation has a place to live on the page.

<html>
  <head>
    <script src="https://unpkg.com/pixel-animator/main.js"></script>
  </head>
  <body>
    <div id="my-animation"></div>
    <script>
      // Insert a default animation inside div#my-animation
      PixelAnimator({}, document.getElementById("my-animation"));
    </script>
  </body>
</html>

Install with NPM

First install the package…

$ npm install pixel-animator

then load the module.

const PixelAnimator = require("pixel-animator");

Want to render you animation somewhere other than a web browser? Check out the notes on alternative rendering.

Clone this wiki locally