fixes responsiveness on training page and mobile menu by refactoring js