/js-task-move-spider-DOM

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Move the spider

Task

Move the spider across the wall to a click.

Requirements:

  • The spider center should come exactly under the pointer on click (without crossing the wall edge).
  • The spider must not cross wall boundaries. When the page is scrolled, nothing should break.

Notes:

  • The code should also work with different spider and wall sizes, not be bound to any fixed values.
  • Use properties event.clientX/event.clientY for click coordinates.
  • You must only modify the file src/scripts/main.js

Gif of result

Read the guideline before start

Guideline

Result