box animation with overlap and overflow control added