Uploaded February 2025 | Updated September 2026, 2 weeks ago
In this video, I'll guide you through an exciting coding project where we create an optical illusion that tricks the eye into seeing a circle move on-screen. The twist? Each ball is actually just moving in a straight line! We'll use JavaScript and HTML Canvas to build this from scratch. By the end of this tutorial, you'll have a fun visual trick up your sleeve and a better grasp of animation techniques in JavaScript. Let's dive in and create some coding magic!
Shoutout to James: codesandbox.io/p/sandbox/impossible-triangle-3pttmw
Inspiration: facebook.com/reel/7795967317105904
In this video, I'll guide you through an exciting coding project where we create an optical illusion that tricks the eye into seeing a circle move on-screen. The twist? Each ball is actually just moving in a straight line! We'll use JavaScript and HTML Canvas to build this from scratch. By the end of this tutorial, you'll have a fun visual trick up your sleeve and a better grasp of animation techniques in JavaScript. Let's dive in and create some coding magic!
Shoutout to James: codesandbox.io/p/sandbox/impossible-triangle-3pttmw
Inspiration: facebook.com/reel/7795967317105904










