3D Web · Exercise 1 of 4Next
Intermediate
Pick the cube from a canvas that is not in the corner
The canvas sits 20 px from the page's corner. The pointerdown handler turns the click into coordinates with the window's size, so it never hits the cube.
Fix it with the canvas's own box. Clicking the cube must write cube into #result, and clicking an empty corner of the canvas must write nothing.
What Check tests
- Clicking the middle of the cube says cube
- Clicking the empty top-left corner says nothing
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.