Fix responsiveness. Refactor JS into separate file