new animation logic for modals