{"size": 2802, "ext": "js", "max_stars_repo_path": "Project 10 - PayPal Clone/Final Files/script.js", "max_stars_repo_name": "PacktPublishing/10-Mega-Responsive-Websites-with-HTML-CSS-and-JavaScript", "max_stars_repo_stars_event_min_datetime": "2021-10-01T22:06:07.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-26T12:49:36.000Z", "max_issues_repo_path": "Project 10 - PayPal Clone/Final Files/script.js", "max_issues_repo_name": "ps6067966/10-Mega-Responsive-Websites-with-HTML-CSS-and-JavaScript", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Project 10 - PayPal Clone/Final Files/script.js", "max_forks_repo_name": "ps6067966/10-Mega-Responsive-Websites-with-HTML-CSS-and-JavaScript", "max_forks_repo_forks_event_min_datetime": "2021-11-16T11:30:00.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T15:09:39.000Z"}
{"max_stars_count": 14, "max_issues_count": null, "max_forks_count": 12, "avg_line_length": 37.8648648649, "max_line_length": 127, "alphanum_fraction": 0.6416845111}
// Pages
document.querySelectorAll('.logo').forEach(logo => {
    logo.addEventListener('click', () => {
        document.querySelector('.front-page').style.display = 'block'
        document.querySelector('.login-page').style.display = 'none'
        document.querySelector('.signup-page').style.display = 'none'
    })
})

document.querySelectorAll('.login').forEach(loginBtn => {
    loginBtn.addEventListener('click', () => {
        document.querySelector('.front-page').style.display = 'none'
        document.querySelector('.login-page').style.display = 'block'
        document.querySelector('.signup-page').style.display = 'none'
    })
})

document.querySelectorAll('.signup').forEach(signupBtn => {
    signupBtn.addEventListener('click', () => {
        document.querySelector('.front-page').style.display = 'none'
        document.querySelector('.login-page').style.display = 'none'
        document.querySelector('.signup-page').style.display = 'flex'
    })
})
// End of Pages

// Navigation
const dropdownItems = document.querySelectorAll('.dropdown-hover')

if(window.innerWidth < 1000) {
    const menuIcon = document.querySelector('.menu')
    const navbar = document.querySelector('.navbar')
    
    menuIcon.addEventListener('click', () => {
        navbar.classList.toggle('change')

        if(!navbar.classList.contains('change')) {
            document.querySelectorAll('.nav-dropdown').forEach(dropdown => {
                dropdown.style.left = '-20rem'
            })
        }
    })

    document.querySelectorAll('.show-dropdown').forEach(link => {
        link.addEventListener('click', () => {
            link.nextElementSibling.style.left = '0'
        })
    })

    document.querySelectorAll('.dropdown-heading-link').forEach(headingLink => {
        headingLink.addEventListener('click', () => {
            headingLink.parentElement.parentElement.style.left = '-20rem'
        })
    })
} else {
    dropdownItems.forEach(dropdownItem => {
        dropdownItem.addEventListener('mouseover', () => {
            dropdownItem.lastElementChild.style.cssText = 'opacity: 1; visibility: visible'
            document.querySelector('.navbar-wrapper').style.background = 'linear-gradient(to right, #066399, #2f8fdf, #066399)'
            dropdownItem.firstElementChild.firstElementChild.style.transform = 'rotate(180deg)'
        })
        dropdownItem.addEventListener('mouseout', () => {
            dropdownItem.lastElementChild.style.cssText = 'opacity: 0; visibility: hidden'
            document.querySelector('.navbar-wrapper').style.background = 'none'
            dropdownItem.firstElementChild.firstElementChild.style.transform = 'rotate(0)'
        })
    })
}

window.addEventListener('resize', () => {
    window.location.reload()
})

// End of Navigation