Practice exercise, 2023.
A tiny game in about thirty lines of JavaScript: pop the bubbles before they disappear.
The exercise#
Bubbles of random size and direction float up the screen. Each click pops a bubble and adds to the score.
What I practised#
- creating elements on the fly in the DOM, at regular intervals;
- events: a click pops the bubble and updates the counter;
- clean-up: each bubble is removed from the page after a few seconds;
- a CSS animation whose direction is set from JavaScript through a CSS variable.
Tech stack#
JavaScript · DOM · events · CSS animations · CSS variables

