html全能效果插件,html5轻量级炫酷js粒子动画库插件

这是一款基于html5 canvas的轻量级炫酷js粒子动画库插件。该js粒子动画库插件可以设置粒子的形状、旋转、分布、颜色等属性,还可以动态添加粒子,效果非常酷。同样的例子效果还有:HTML5 Canvas彩色的光粒子模拟粒子运动动画效果。

使用方法

该粒子动画库插件使用方法非常简单,首先要在页面中引入particles.js文件。

在页面中使用一个div来作为放置粒子的容器。

然后可以按下面的方法调用该粒子插件:

/* particlesJS('dom-id', params);

/* @dom-id : set the html tag id [string, optional, default value : particles-js]

/* @params: set the params [object, optional, default values : check particles.js] */

/* config dom id (optional) + config particles params */

particlesJS('particles-js', {

particles: {

color: '#fff',

shape: 'circle', // "circle", "edge" or "triangle"

opacity: 1,

size: 4,

size_random: true,

nb: 150,

line_linked: {

enable_auto: true,

distance: 100,

color: '#fff',

opacity: 1,

width: 1,

condensed_mode: {

enable: false,

rotateX: 600,

rotateY: 600

}

},

anim: {

enable: true,

speed: 1

}

},

interactivity: {

enable: true,

mouse: {

distance: 250

},

detect_on: 'canvas', // "canvas" or "window"

mode: 'grab',

line_linked: {

opacity: .5

},

events: {

onclick: {

enable: true,

mode: 'push', // "push" or "remove" (particles)

nb: 4

}

}

},

/* Retina Display Support */

retina_detect: true

});

插件中的可用参数都非常简单,可以参考上面的代码。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值