Skip to content

Instantly share code, notes, and snippets.

@RitaDias
Last active January 16, 2017 14:31
Show Gist options
  • Save RitaDias/45e99caf14dac0571d725771b5587bea to your computer and use it in GitHub Desktop.
Save RitaDias/45e99caf14dac0571d725771b5587bea to your computer and use it in GitHub Desktop.
function touchStart(startX, startY) {
var menuOpen = document.querySelector(".menu.menu--visible");
if (menuOpen !== null) {
isOpen = true;
} else {
isOpen = false;
}
menu.classList.add("no-transition");
appMenu.classList.add("no-transition");
isMoving = true;
menuWidth = document.querySelector(".app-menu").offsetWidth;
lastX = startX;
lastY = startY;
if (isOpen) {
moveX = 0;
} else {
moveX = -menuWidth;
}
dragDirection = "";
menu.classList.add("menu--background-visible");
// why is this being added? ‘.menu--background-visible .menu-background’ makes the overlay
// ‘active’, displaying it on the DOM for those sweet opacity changes.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment