hustcc / canvas-nest.js

:cancer: Interactive Particle / Nest System With JavaScript and Canvas, no jQuery.
https://git.hust.cc/canvas-nest.js
MIT License
4.3k stars 826 forks source link

想基于你的代码框架,做一个雪花飘落的效果 #32

Closed geebos closed 6 years ago

geebos commented 6 years ago

我在自己的博客上用了你的这个动态效果,发现了一些问题: 一、当线段围在鼠标周围时会干扰阅读,所以我去除了onmousemove 这个函数

window.onmousemove = function(e) {
e = e || window.event;
current_point.x = e.clientX;
current_point.y = e.clientY;
},

二、去除了聚集效果之后,整个屏幕都是飞舞的线条,看着更加难受了,所以我想能否将canvas标签放到 文章的div下面,后来仔细一想发现只要是线条在乱飞就会影响阅读体验,所以我就想能不能做一个自上而下的雪花的下落的效果(作为背景,不能遮挡到文章)

hustcc commented 6 years ago

那就行动吧~

hustcc commented 6 years ago

可以看最新的代码,可能会清晰一些!