update main.js for swipe left / right