2048
A project to learn the HTML5 canvas: my own implementation of 2048, the sliding-tile number puzzle created by Gabriele Cirulli.
I wrote it from scratch in 2015 in plain JavaScript, with no frameworks or third-party libraries: the libraries of the day were bulky and connections were slow, so I kept the page small enough to load quickly. The board, tiles and score are drawn directly on the canvas, it plays with the keyboard or by swiping on a phone, and moves can be undone. In 2023 I came back to it and animated the tiles as they slide.