Function to open/close menu by gesture

- first draft, not perfect