网页粒子背景

github地址:https://github.com/hustcc/canvas-nest.js

官方tip:使用方法很简单只需要再body中间插入这段js代码即可,注意不要放在head里面

<html>
<head>
    ...
</head>
<body>
    ...
    ...
    ...
    <script src="//cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js"></script>
</body>
</html>

在script中加入相应的参数,自定义参数值即可,如下:

<scripttype="text/javascript"color="255,0,0"opacity="0.5"count="99" src="//cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js"></script>

参数说明:

color="255,0,0"    背景粒子线的颜色

opacity="0.5"    背景粒子线的透明度,一般设置成0.5-1之间

count="99"       背景粒子线的密度,建议不要太大,否则页面容易卡死

运行效果

 
原文地址:https://www.cnblogs.com/jianshuai520/p/8808602.html