html5 輕量級炫酷 js 粒子動畫庫

Carlton17Y 8年前發布 | 32K 次閱讀 HTML5 前端技術

 

Qarticles

A lightweight and high performance JavaScript library for creating particles

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.

 本文由用戶 Carlton17Y 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!