changing margin to tranform for animation