The HTML Canvas Bubble Demo got a lot of attention and I received a lot of hits from that. Since last year, I used it on a WP theme and updated it to make it more functional.
So here is a link to the NEW demo.
Here is a link to download all the files, including the demo
When using it on your own site, create a DOM element with the ID “canvasBubbles”, include the “bubbles.js” script :
Basic Usage
1 2 3 | <script> bubblesMain(); </script> |
Custom Options (Example)
1 2 3 4 5 6 7 8 9 10 11 12 | <script> bubblesMain(new Object({ type : 'radial', revolve : 'center', minSpeed : 100, maxSpeed : 500, minSize : 50, maxSize : 150, num : 100, colors : new Array('#FF0000','#FFFFFF','#BBBBBB') })); </script> |
- type (linear,radial)
- revolve (topLeft, topRight, bottomLeft, bottomRight) This is used when “type” is radial
- opacity (any floating number between 0 and 1)
- minSpeed (any number)
- maxSpeed (any number)
- minSize (any number)
- maxSize (any number)
- num (number of bubbles)
- colors (an array of 6 digit HEX colors)