I was at a car show one time and saw a guy lay a ping-pong ball on the roof of his tricked out Mitsubishi Eclipse. When he turned up his audio system, the thumping of the subwoofers caused the ping-pong ball to hop all around the roof, sometimes as high as what looked like 8 inches. Everyone that was standing around his trophy ride that day had a grin on their face.
So, that’s sort of the effect I was trying to emulate with this little HTML5 experiment. Enjoy!
Bouncy-Bass Text Demo (You’ll need Firefox 4 installed to experience this)
Technical Mumbo-Jumbo
- Firefox 4 for their Audio API.
- HTML5 <audio>
- CSS3 for text rotation and text-shadows.
- JavaScript, using the FFT bits from dsp.js to monitor audio playback.
Performance
Granted the browser is still in beta, but the overall performance left more to be desired. It seemed like it had something to do with memory leaks that are still to be patched up in Firefox 4. What I noticed is that if I had more that 2 text-shadow that I was manipulating through JavaScript, the responsiveness of the rendering would slow to a crawl, which lead to the audio being way out of sync. I could have gone the Canvas route, but wanted to try and pull this off with CSS3, maybe another time I’ll try that and compare performance and approach.
Further Learning
Current proposal of the Audio API by the W3C Audio Incubator Group
Firefox 4 Audio API spec
Props
- Mozilla Team
- “Hetilica Bold” Font by Diego Quintana
- “Bad Cat” by Skullbeatz
