I wanted to compare two images side by side for my articles on pixel art scaling (parts one and two), to show the difference between various algorithms. The TwentyTwenty jQuery plugin does this beautifully, but again I wanted to avoid external dependencies. Also, I guessed this was going to be relatively straightforward using drawImage, and for once it turned out I was right.
I wanted a magnifying glass effect for my articles on pixel art scaling (parts one and two), to show the difference between various algorithms. There are a few jQuery plugins that do this, but I didn’t want to add external dependencies, and this was a good excuse to play with the canvas element.
Straightforward experiment with a canvas displaying some circles. Move your mouse or fingers over the circles, and they will react. I wanted to keep the experiment simple and dependency-free, so it’s only listening to mousemove and touchmove events. This means that it doesn’t have full touch and pen support on Internet Explorer. Microsoft’s proposal for pointer events is on its way to becoming a standard, so one day we may be able to forget about mouse, touch and pen events, and just deal with a single type.