playing (dragging) with icons and combining them on dropping?

Hi, so imagine you have, well, something like old windows desktop. Few icons placed anywhere user moved them (without aligning to grid). Each icon have image+title, and now I want implement moving them:

  1. when moved into empty space - just move it there - I got that part :wink:

  2. when moved to space where itā€™s colliding with other icon - make the other icon focused/bigger/brighter. Any effect to show user that it will interact.

  3. on dropping into other icon check some array (array defines that icon1 + icon2 produces icon3), if entry for both exists - remove both icons and create new one - icon3.Ā 

Could you maybe give me some hint how would you do 2 and 3 points?

Iā€™m thinking about giving all icons 2 listeners, first one to handle moving, second one to handle focusing other icon (when dragged icon is ā€œon itā€) and handle dropping icon into other icon.

Iā€™ve been through some topics on drag&drop problems, but found nothing similarā€¦