moved gesture logic to client and created exernal js file