append classes and animate margin