move javascript in to app.js
properly interpret click position depending on scale