This is a simple javascript code to draw a rectangle and to move it by keeping one diagonal fixed.
It contains two files animation.html and draw.js
Open the animation.html to view.
At present it is encountering some problem, I will update the repository whenever it is solved