{"size": 1540, "ext": "js", "max_stars_repo_path": "libs/header.js", "max_stars_repo_name": "esimov/minecraft.js", "max_stars_repo_stars_event_min_datetime": "2016-04-01T13:32:59.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-12T01:49:55.000Z", "max_issues_repo_path": "libs/header.js", "max_issues_repo_name": "esimov/minecraft.js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "libs/header.js", "max_forks_repo_name": "esimov/minecraft.js", "max_forks_repo_forks_event_min_datetime": "2016-05-12T04:02:03.000Z", "max_forks_repo_forks_event_max_datetime": "2018-02-12T14:02:46.000Z"}
{"max_stars_count": 20, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 32.7659574468, "max_line_length": 65, "alphanum_fraction": 0.5474025974}
window.onload = function() {
    var toggleMouseDown = true;
    var toggleTimer = -1;
    var headerArrow = document.querySelector('#arrow');
    var header = document.getElementsByTagName('header')[0];

    document.addEventListener('click', onMouseClick, false);
    document.addEventListener('mousedown', onMouseDown, false);

    function onMouseClick(e) {
  
        e.stopPropagation();
        toggleMouseDown = true;

        if (e.target === headerArrow && toggleMouseDown) {
            if (header.className === '') {
                clearTimeout(toggleTimer);

                toggleMouseDown = false;
                toggleTimer = setTimeout(function() {
                    header.setAttribute('class', 'animate');
                    headerArrow.setAttribute('class', 'animate');
                }, 1000/60);
            } else if (header.className === 'animate') {
                clearTimeout(toggleTimer);

                toggleTimer = setTimeout(function() {
                    header.setAttribute('class', '');
                    headerArrow.setAttribute('class', '');
                }, 1000/60);
            }
        }
    }

    function onMouseDown(e) {

        e.stopPropagation();

        removeEventListener('click', onMouseClick, false);
        if (e.target !== headerArrow && !toggleMouseDown) {
            toggleMouseDown = true;
            clearTimeout(toggleTimer);
            header.setAttribute('class', 'animate');
            headerArrow.setAttribute('class', 'animate');
        }
    }    
};