refactoring styles and js for navbar