Recently, I made this cute lil CodePen buddy in an attempt to learn more about creating draggable UI elements with vanilla JS instead of relying on a JS library to do it for me. Basically, you can drag him all around his container, but he hates getting bumped against the sides. If you do it more than five times, he even faints.
I hope you find the video helpful and are inspired to take these basic concepts and expand on them to create your own draggable buddy or some other draggable interface with vanilla JS! Enjoy!