{"size": 1008, "ext": "js", "max_stars_repo_path": "js/animate.js", "max_stars_repo_name": "bruno-salmito/LandingPage", "max_stars_repo_stars_event_min_datetime": "2020-03-24T22:52:34.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-24T22:52:34.000Z", "max_issues_repo_path": "js/animate.js", "max_issues_repo_name": "bruno-salmito/LandingPage", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/animate.js", "max_forks_repo_name": "bruno-salmito/LandingPage", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.5263157895, "max_line_length": 74, "alphanum_fraction": 0.5694444444}
function debounce(func, wait, immediate) {
    var timeout;
    return function () {
        var context = this,
            args = arguments;
        var later = function () {
            timeout = null;
            if (!immediate) func.apply(context, args);
        };
        var callNow = immediate && !timeout;
        clearTimeout(timeout);
        timeout = setTimeout(later, wait);
        if (callNow) func.apply(context, args);
    };
};

const target = document.querySelectorAll('[data-anime]');
const animationClass = 'animate';

function animeScroll() {
    const windowTop = window.pageYOffset + ((window.innerHeight * 3) / 4);
    target.forEach(function (el) {
        if ((windowTop) > el.offsetTop) {
            //adiciona animação
            el.classList.add('animate');

        } else {
            el.classList.remove('animate');
        }
    })
}

animeScroll();
if (target.length) {
    window.addEventListener('scroll', debounce(function () {
        animeScroll();
    }, 200))
}