Managing JavaScript on Resize

For the past good long while, I’ve been using a throttled function to do various JavaScript chores when the browser fires a resize event. It’s a good way to correct the heights of things or add a class when the window hits a certain size. That’s been fine for a while, but recently I found a need to upgrade things.

Showing the Frame Rate on Canvas Animations

A while back I built a silly little performance-testing animation that I called “Bouncer”. It’s nice, but I noticed recently that it was missing a vital component: an indication of the frame rate. I added one this morning, and I thought I would share the code with you.

Bouncing Canvas Balls with Gravity and Friction

I went a little crazy with this one. I know it doesn’t look like much, but there’s a lot going on inside that canvas thingy. If you click on the button or on the canvas, a bunch of black circles will bounce around with their own vectors, speeds, elasticity, and with a shared bit of gravity.