Thank you! That looks very nice and thanks for the tip for using Translate X instead of margin-left, although iOS showed it a bit buggy where it left a small bar on the right after the animation was done. Have to dig deeper in that.
I've used your method with the responsive problem at the beginning of this topic, it works, but only after refreshing. When I resize the screen the animations fails and nothing works anymore. @OSUblake used a method to 'reset' the animation as I understand it when going from one screen size to an other with:
tl.reversed(false).progress(0).clear().pause();
I'm not sure if that method can be used with the stored timeline open/closed. I've setup a new code pen with a little media query css and the responsive JS code:
https://codepen.io/werkinprogres/pen/PoKOwKw
Theoretically I could only use a CSS media-query in this case, although the values for the animation should stay the same, limiting the options a lot. But even with just the CSS media-query the animations fails as the values don't get updated in the when checking the inspector.
@media only screen and (max-width: 799px) {
.menu {
width: 100%;
.subMenu {
z-index: 10;
transform: translateX(-100%);
}
}
}