css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

Just a code experiment I did to see whether I could create a popping bubble in canvas without using images.

Comments

  1. doesn't work on my amazing firefox browser :/

  2. Very nice..

  3. @vsync What's your FF version and OS? I tested on OSX FF 53 & Win 10 FF 53 and had no issues.

    @akashbijwe Thanks buddy!

  4. What do you need to change in the javascript to have the bubbles falling from the top of the canvas rather than floating up from the bottom?

  5. @er40

    92 to this.count = this.yOff * -1; 52 to if(bubbles[i].count > canvas.height + bubbles[i].radius) { 53 to bubbles[i].count = bubbles[i].yOff * -1; 55 to bubbles[i].count += bubbleSpeed;

    Looks like some of the var names weren't named in a way to be easily understood, sorry about that - I will refactor this to make it more readable later this week.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.
Loading...
Loading...