HTML5 Canvas: From Noob to Ninja - an interactive deep dive
Learn HTML5 Canvas basics: draw shapes, apply transformations, add animations, and build interactive apps with advanced mouse/keyboard handling to create dynamic web graphics.
- Differentiate DOM retained mode and Canvas immediate mode for rendering, redraws, and scene management
- Set up an HTML canvas element with correct sizing, styling, and JavaScript 2D context access
- Draw and style shapes with paths, beginPath/closePath, stroke/fill, and draw-order layering
- Render Beziér curves, rectangles, triangles, circles, text, images, and gradients using canvas APIs
- Apply translate, scale, rotate, and resetTransform to control the canvas transformation matrix
- Build smooth animations with requestAnimationFrame, timestamps, frame control, and cancelAnimationFrame
- Implement interactive mouse and keyboard controls with precise cursor coords and multi-key movement logic
Learning Roadmap
1.
DOM vs. Canvas
DOM vs. Canvas
2.
Getting Started with the Canvas
Getting Started with the Canvas
3.
Drawing Basics / Lines
Drawing Basics / Lines
4 Lessons
4 Lessons
4.
Drawing Curves
Drawing Curves
4 Lessons
4 Lessons
5.
Drawing Multiple Things
Drawing Multiple Things
5 Lessons
5 Lessons
6.
Drawing Rectangles (and Squares)
Drawing Rectangles (and Squares)
3 Lessons
3 Lessons
7.
Drawing Triangles
Drawing Triangles
3 Lessons
3 Lessons
8.
Drawing Circles
Drawing Circles
4 Lessons
4 Lessons
9.
Modifying How Your Corners Look
Modifying How Your Corners Look
3 Lessons
3 Lessons
10.
Working with Colors
Working with Colors
4 Lessons
4 Lessons
11.
Drawing Text
Drawing Text
3 Lessons
3 Lessons
12.
Drawing Images
Drawing Images
6 Lessons
6 Lessons
13.
Canvas Transformations
Canvas Transformations
4 Lessons
4 Lessons
14.
Structuring Your Drawing Code
Structuring Your Drawing Code
4 Lessons
4 Lessons
15.
Animating with requestAnimationFrame
Animating with requestAnimationFrame
8 Lessons
8 Lessons
16.
Creating Animations on the Canvas
Creating Animations on the Canvas
5 Lessons
5 Lessons
17.
Animating Many Things on the Canvas
Animating Many Things on the Canvas
3 Lessons
3 Lessons
18.
Creating Motion Trails
Creating Motion Trails
4 Lessons
4 Lessons
19.
Creating Sprite Animations
Creating Sprite Animations
5 Lessons
5 Lessons
20.
Working With the Mouse
Working With the Mouse
4 Lessons
4 Lessons
21.
Follow the Mouse Cursor
Follow the Mouse Cursor
3 Lessons
3 Lessons
22.
Mouse Follow with Ease
Mouse Follow with Ease
3 Lessons
3 Lessons
23.
Working With the Keyboard
Working With the Keyboard
6 Lessons
6 Lessons
24.
Moving Shapes Using the Keyboard
Moving Shapes Using the Keyboard
8 Lessons
8 Lessons
25.
Resizing the HTML Canvas Element
Resizing the HTML Canvas Element
5 Lessons
5 Lessons
26.
Detect Whether a Font is Installed
Detect Whether a Font is Installed
4 Lessons
4 Lessons
Kirupa Chinnathambi
By day, I work on making webapps rock @Microsoft! By night, I teach web stuff. I am also married to the awemazing @codekunoichi :P
Trusted by 2.9 million developers working at companies
Anthony Walker
@_webarchitect_
Evan Dunbar
ML Engineer
Software Developer
Carlos Matias La Borde
Souvik Kundu
Front-end Developer
Vinay Krishnaiah
Software Developer
Built for 10x Developers












Free Resources