开始

Popmotion 是什么

Popmotion is a low-level, functional JavaScript motion library.

It allows developers to animate in any JavaScript environment (browser, Node), to any render target (CSS, SVG, Three.js, canvas, etc).

If you want super-simple DOM or React animation, you’re probably after the high-level Pose library. For absolute animation freedom, carry on reading!

In this simple introductory guide we’re going to install Popmotion and use it to animate a DOM element using the tween animation and the DOM styler function.

安装

通过npm安装

npm install popmotion --save

引入

你可以按需引入任何你想要的模块

import { tween } from 'popmotion';