神刀安全网

html5 轻量级炫酷 js 粒子动画库

Qarticles

A lightweight and high performance JavaScript library for creating particles

html5 轻量级炫酷 js 粒子动画库

Live Demos

click here .

How to Use

basic

<script src="src_to_qarticles.js"></script> <script>     var qarticles = new Qarticles(document.getElementById('cov')) </script>

advanced

var covColorFuc = function (dot, screenWidth, screenHeight) {                 return `rgb(${Math.floor(255 * (1 - dot.x / screenWidth))}, ${Math.floor(255 * (1 - dot.y / screenHeight))}, ${Math.floor(255 * (dot.speedArr[0]/ 100))})`             } var canvas = document.getElementById('cov') var options = {     dotColorFuc: covColorFuc,     lineColorFuc: covColorFuc,     count: 32,     linkCount: 4,     screenWidth: 1080,     screenHeight: 1920 }   var qarticles = new Qarticles(canvas, options)

License

This project is licensed under the terms of the MIT license.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » html5 轻量级炫酷 js 粒子动画库

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址