I first wrote similar code to this when I first started programming, as a creative exploration into the basics of animation loops and the usage of the canvas element.
The most difficult problem was calculating the velocity of the splashes to have them travel in a convincing arc.