applied active states to navigation elements on click