{"size": 1243, "ext": "js", "max_stars_repo_path": "src/assets/js/skills.js", "max_stars_repo_name": "FernandoJP/my-portfolio", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/assets/js/skills.js", "max_issues_repo_name": "FernandoJP/my-portfolio", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/assets/js/skills.js", "max_forks_repo_name": "FernandoJP/my-portfolio", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 44.3928571429, "max_line_length": 111, "alphanum_fraction": 0.6041834272}
window.addEventListener('scroll', () => {
    const skillsEl = document.querySelectorAll('[data-stars]');

    skillsEl.forEach((element, i) => {
        const elScrollY = window.outerHeight-element.getBoundingClientRect().top;
         const windowHeight = window.outerHeight / 3;
         element.querySelectorAll('.stars__star').forEach((star, j) => {
            if(windowHeight / 2 * j < elScrollY) {
                star.classList.remove('stars__star--hide')
                !star.classList.contains('stars__star--visible') && star.classList.add('stars__star--visible');
            } else {
                star.classList.remove('stars__star--visible')
                !star.classList.contains('stars__star--hide') && star.classList.add('stars__star--hide');
            }
        });
    });
});

document.querySelectorAll('[data-stars]').forEach(starContainer => {
    const starsQtd = starContainer.getAttribute('data-stars');
    [...Array(parseInt(starsQtd)).keys()].forEach(index => {
        starContainer.insertAdjacentHTML( 'beforeend', `
            <div class="stars__container">
                <img src="assets/images/star.svg" alt="Star icon" class="stars__star stars__star--hide">
            </div>
        `)
    });
})