Problem with toast animation (how to make old one slide back?)

I created this codepen https://codepen.io/Lko3001/pen/mdgmKaW, as you can see, when you create a few toasts, and then create a new one, the new one appears out of nowhere and most importantly, the other cards jump up and then down, instead, I want the current cards to slide back, and then add a new card, how do I do that?
image.png
Was this page helpful?