Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Hello! While your implementation is very close, I'm requesting a change because the automated tests are currently failing. The issue seems to be in how the spider's final position is calculated. To correctly center the spider on the cursor, you need to account for the spider's own dimensions. Right now, it appears the top-left corner is being placed at the click location, not the center.
Please adjust your calculation to subtract half of the spider's offsetWidth and offsetHeight from the click coordinates. This will ensure the spider is perfectly centered and should resolve the test failures. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Changes are needed to fix the click coordinate calculation, which currently breaks when the page is scrolled. The issue is in src/scripts/main.js: using e.clientX/e.clientY (viewport-relative) with offsetLeft/offsetTop (ancestor-relative) produces incorrect relative positions during scroll. To fix this, replace the current calculation with wall.getBoundingClientRect() to get the wall's position relative to the viewport, then compute the click offset correctly — for example: javascript const rect = wall.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; This is a critical blocker because the spider interaction must work reliably regardless of scroll position, as required by the task. Your centering and boundary logic is otherwise excellent — just this scrolling behavior needs correction before approval.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| const relX = e.clientX - wall.offsetLeft - wall.clientLeft; | ||
| const relY = e.clientY - wall.offsetTop - wall.clientTop; |
There was a problem hiding this comment.
This calculation for relative coordinates doesn't account for page scrolling. e.clientX/e.clientY are relative to the visible part of the page (the viewport), while offsetLeft/offsetTop are relative to an ancestor element and don't change when you scroll.
To make this work correctly when the page is scrolled, you need to find the wall's position relative to the viewport. The getBoundingClientRect() method would be very helpful here.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work resolving the scrolling issue with getBoundingClientRect! Your solution is much more robust now. I am approving this submission as an educational override to help you move forward, but it's important to address the issue revealed by the automated tests. The tests are failing because the spider isn't perfectly centered on the cursor. This happens because the calculation doesn't account for the spider's own dimensions. To fix this, you need to subtract half of the spider's width from the left position and half of its height from the top position. Great job on the progress you've made!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

No description provided.