particles.js中文开发手册

官方github:https://github.com/VincentGarreau/particles.js/

demo制作器,注意可能需要翻墙

https://codepen.io/VincentGarreau/pen/pnlso 这个可以把你制作的demo导出

http://vincentgarreau.com/particles.js/这个可以用来尝试配置不同效果

 

使用方法

加载particle.js并配置粒子:

index.html

<div id="particles-js"></div>

<script src="particles.js"></script>


app.js

/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
particlesJS.load('particles-js', 'assets/particles.json', function() {
  console.log('callback - particles.js config loaded');
});
particles.json就是主要的配置文件注意一下文件顺序,不然会出现问题
实际demo
<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>particles.js</title>

      <link rel="stylesheet" href="style.css">
 
</head>

<body>

<div id="particles-js"></div>

  
</body>
 <script src='particles.min.js'></script>  这个玩意需要放在下面
  <script src="index.js"></script>
</html>

如有需要下载demo请到QQ群,黑色原子效果很科幻,还不错

根据css颜色和json配置文件,就打造属于自己的科幻效果

参数

键值 参数选项/ 说明 实例
particles.number.value number   数量 40
particles.number.density.enable boolean    true / false
particles.number.density.value_area<
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值