function scrollPosition() {
    let scrollY = window.scrollY;
    let positionServices = $("#services").offsetTop;
    let positionTeam = $("#team").offsetTop;
    let positionContact = $("#contact").offsetTop;
    let positionLanding = $("#landing").offsetTop;
    if (scrollY >= positionContact) {
        let position = navLinks[3].getBoundingClientRect().left;
        let width = navLinks[3].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionTeam && scrollY < positionContact) {
        let position = navLinks[2].getBoundingClientRect().left;
        let width = navLinks[2].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionServices && scrollY < positionTeam) {
        let position = navLinks[1].getBoundingClientRect().left;
        let width = navLinks[1].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionLanding && scrollY < positionServices) {
        let position = navLinks[0].getBoundingClientRect().left;
        let width = navLinks[0].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
}
// Sets navbar underline position based on window scroll
Sets navbar underline position based on window scroll
Sets navbar underline position based on window scroll
function scrollPosition() {
    let scrollY = window.scrollY;
    let positionServices = $("#services").offsetTop;
    let positionTeam = $("#team").offsetTop;
    let positionContact = $("#contact").offsetTop;
    let positionLanding = $("#landing").offsetTop;
    if (scrollY >= positionContact) {
        let position = navLinks[3].getBoundingClientRect().left;
        let width = navLinks[3].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionTeam && scrollY < positionContact) {
        let position = navLinks[2].getBoundingClientRect().left;
        let width = navLinks[2].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionServices && scrollY < positionTeam) {
        let position = navLinks[1].getBoundingClientRect().left;
        let width = navLinks[1].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
    if (scrollY >= positionLanding && scrollY < positionServices) {
        let position = navLinks[0].getBoundingClientRect().left;
        let width = navLinks[0].getBoundingClientRect().width;
        positionIndicator(position, width)
    }
}
function scrollPosition ( ) { let scrollY = window . scrollY ; let positionServices = $ ( "#services" ) . offsetTop ; let positionTeam = $ ( "#team" ) . offsetTop ; let positionContact = $ ( "#contact" ) . offsetTop ; let positionLanding = $ ( "#landing" ) . offsetTop ; if ( scrollY >= positionContact ) { let position = navLinks [ 3 ] . getBoundingClientRect ( ) . left ; let width = navLinks [ 3 ] . getBoundingClientRect ( ) . width ; positionIndicator ( position , width ) } if ( scrollY >= positionTeam && scrollY < positionContact ) { let position = navLinks [ 2 ] . getBoundingClientRect ( ) . left ; let width = navLinks [ 2 ] . getBoundingClientRect ( ) . width ; positionIndicator ( position , width ) } if ( scrollY >= positionServices && scrollY < positionTeam ) { let position = navLinks [ 1 ] . getBoundingClientRect ( ) . left ; let width = navLinks [ 1 ] . getBoundingClientRect ( ) . width ; positionIndicator ( position , width ) } if ( scrollY >= positionLanding && scrollY < positionServices ) { let position = navLinks [ 0 ] . getBoundingClientRect ( ) . left ; let width = navLinks [ 0 ] . getBoundingClientRect ( ) . width ; positionIndicator ( position , width ) } }
Sets navbar underline position based on window scroll
Sets navbar underline position based on window scroll