To create the drawer menu functionality, we will declare two functions.: one for the opening transition and another for the closing transition. These transitions will be in charge of showing and hiding both the menu and the dark overlay that de-emphasizes the contents behind the menu. Each function will make all the changes needed in the sketch.Drawer_Menu layer and the sketch.Black_Background layer. In the following code, we can find both the functions: their names will be openMenu and closeMenu:
# DRAWER MENU# Open Menu FunctionopenMenu = -> sketch.Drawer_Menu.animate properties: x: 0 time: 0.2 sketch.Black_Background.animate properties: opacity: 100 time: 0.2 sketch.Drawer_Menu.on Events.SwipeLeft, (event) -> ...