You can use js to add a class for the menu being toggled (which might already be happening) and from there on use CSS animation.
There are quite a few tutorials you can find online for animation, such as these . However I'd suggest using W3Schools as a reference for your code.
Hope this helps
What you are trying to achieve is possible, but it will mean you probably cant use the default mendix menu without tearing it apart.
If you are up for the challange you can quite easily make your own layout, and they use display:flex to position everything, and then with css animation achieve your result. But its really up to how much time you want to spend on it, and how good you are in sass.
if you want to start styling in mendix, I recommend checking out this article:
Sorry for the late reply! Thanks a lot for the explanation! I'll try to get it to work next week.