Reputation: 60
I am curious about how to create a canvas effect like the link below http://rmp-api-server.herokuapp.com/demo/index.html (There is an animation that follows the cursor.)
Upvotes: 1
Views: 48
Reputation: 751
I used that on my portfolio page about a year and a half back I guess. The link is: https://codeaffair.com/portfolio/ You can check the source, nothing is minified. Basically, the idea is to create many translucent circles on the page at random positions.
At every iteration of a draw method, move those circles some distance with respect to their original position(not the updated position). Draw lines on every circle to its 2-3 nearest neighbours. Done!
Upvotes: 4