Made curve a dancer in HTML5 canvas - 魔幻线条
Made curve a dancer in HTML5 canvas.
$ npm install curvejsimport curvejs from 'curvejs'Or get it by the cdn and link curve.min.js in your HTML:
Then start to dance:
…var curve = new Curve({
points: [277, 327, 230, 314, 236, 326, 257, 326],
data: {angle: 0, r:5 ,step:Math.PI / 50 },
motion: curvejs.motion.dance
})In this motion directory, there are already some built-in motion. you can submit your motion and then create a pull request to the project.
Format and specification of your motion:
/**
* move motion.
*
* @param {points}
* @param {data}
* data rule example:
* [1, 0.2, -3, 0.7, 0.5, 0.3, -1, 1]
*/
export default function (points, data) {
points.forEach(function (item, index) {
points[index] += data[index]
})
}The group id is 179181560. Welcome to join the group.
Copyright (c) 2017-present, dntzhang & AlloyTeam
No open issues yet, or sync has not completed.