How to install Anime.js
Created
Anime.js is a lightweight JavaScript animation library with a simple, yet powerful API. It works with CSS properties, SVG, DOM attributes and JavaScript Objects.
Installation
You can download the latest version of Anime.js from the GitHub releases or use a Anime.js CDN.
Cloning a repository
You can clone a repository from GitHub.com to your local computer.
Cloning with HTTPS URLs
git clone https://github.com/juliangarnier/anime.git
Cloning with SSH URLs
git clone [email protected]:juliangarnier/anime.git
Cloning with GitHub CLI
gh repo clone juliangarnier/anime
Install via NPM package
Run the following command to locally install the package and its dependencies with NPM.
Downloading and installing packages locally
npm i animejs
npm install animejs
yarn add animejs
Downloading and installing packages globally
npm i -g animejs
yarn global add animejs
Install Specific Version of a Package
npm install [email protected]
yarn add [email protected]
Bower
bower install animejs
Usage
//ES6 modules
import anime from 'animejs/lib/anime.es.js';
//CommonJS
const anime = require('animejs');
//Hello world
anime({
targets: 'div',
translateX: 250,
rotate: '1turn',
backgroundColor: '#FFF',
duration: 800
});