In this tutorial we can learn about how to create particals with html , css and javascript.
1.we will select canvas tag with getElementById
2.we will set canvas.width/height according to window.height/widht
3.we will store all our particle in a array , i called it Circle = [ ]
4.afterthat i create custom javascript object where i will store x and y cordination of event click
5.i will create particles class .class is a template of object.i will create lot of circle object .so i need class for object tempate
6.in class constructor i will store this.x will be mouse.x as same this.y will be mouse.y
7.i will asign partical size size so this.size = Math.random() * 2 +1
8. Math.random() * 2 + 1 means 1 to 2 random number will be genarate
9.i will set here speedX and speedY with Math.random() * 2 - 1.5;
10.after that i will set color property
11.i will set update() method which will be update x and y cordination with speed addition
12.later i will draw my circle in draw() method
14. i will set a for loop that will run i guess 4 times and everytime when loop will run i will push my partical class in previously defined Circle [ ] array
15.this time i am gonna hande my particle while will loop my circle[ ] array .and run update and draw method from paricle
16.finally i will create a function name animation .as well as i will run this function contiously though reguestAnimationFarme(animation) . in between i will call my handlePartical() function.so that circle will create continously