Skip to content

Getting Started

lucefer edited this page Jun 2, 2017 · 3 revisions

开始 & 安装

Node(CommonJS)

#安装
npm install bezier-animation
// 使用bezier
var bezier = require('bezier-animation')
//初始化bezier对象
var animation=new bezierAnimation(1,
    'linear',
    function(p1,p2){console.log("p1,p2",p1,p2)}
);
//播放动画
animation.play();

RequireJS(AMD)

// 配置 bezier 路径
require.config({
    paths: {
        bezier: 'https://lucefer.github.io/bezier/dist/bezier-animation'
    }
})
// 加载 Mock
require(['bezier'], function(bezier){
    // 使用 bezier
    var animation = new bezier(
        1,
        "linear",
        function(p1,p2){
            console.log("p1,p2",p1,p2)
        }
    )
    animation.play()
})

Clone this wiki locally