1 Star 2 Fork 2

pengjy / particles.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

particles.js

a canvas and svg particles show

site: https://pengjiyuan.github.io/particles.js/

我用了两种方式实现了粒子动态连线效果。
但是我们都知道,操作dom的代价是昂贵的,所以我用的这种svg的实现会对浏览器造成极大的负担(我的方式是用的canvas的重绘思想,频繁的移除加重绘svg元素,不推荐!在点的距离判断然后连线的实现方法上,找不到什么比较好的判断方法, 心想总不会两两比较吧,这样频繁的重绘计算浏览器能吃的消吗,看了一个particles大项目的源码,发现还真是,是我低估了浏览器的计算能力...)

用canvas实现明显浏览器会更从容,我还添加了鼠标move连线效果,svg还是想想算了(应该是我的方式错了,期待后续找到更优解法)

svg的能力当然不仅如此,之后我会用一种最优的方式实现,我相信svg不比canvas差。

后续可能会增加它的定制化内容~

MIT License Copyright (c) 2016 PengJiyuan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

a canvas and svg particles show 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/pjy/particles.js.git
git@gitee.com:pjy/particles.js.git
pjy
particles.js
particles.js
master

搜索帮助