{"size": 1477, "ext": "js", "max_stars_repo_path": "src/script/mod/timer.js", "max_stars_repo_name": "uryumyao/uryu-myao", "max_stars_repo_stars_event_min_datetime": "2019-02-02T05:08:17.000Z", "max_stars_repo_stars_event_max_datetime": "2019-02-02T05:08:17.000Z", "max_issues_repo_path": "src/script/mod/timer.js", "max_issues_repo_name": "uryumyao/uryu-myao", "max_issues_repo_issues_event_min_datetime": "2020-01-10T09:33:11.000Z", "max_issues_repo_issues_event_max_datetime": "2020-01-15T12:32:05.000Z", "max_forks_repo_path": "src/script/mod/timer.js", "max_forks_repo_name": "uryumyao/uryu-myao", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 33.5681818182, "max_line_length": 113, "alphanum_fraction": 0.5084631009}
/*
 *    *** timer ***
 *
 *    - count down timer
 *    @ about.html
 *
 */

(function() {
    const countup = document.querySelector('.countup')

    if (countup) {
        countup.addEventListener('load', upTime ( 'nov,03,1988,00:00:00' ));

        function upTime(countTo) {
            now = new Date ();
            countTo = new Date ( countTo );

            difference = ( now - countTo );
            days  = Math.floor ( difference / ( 60*60*1000*24 ) * 1 );
            years = Math.floor ( days / 365 );

            if (years > 1) {
                days = days - ( years * 365 )
            }

            hours  = Math.floor (( difference % ( 60*60*1000*24 )) / ( 60*60*1000 ) *1 );
            mins   = Math.floor ((( difference % ( 60*60*1000*24 )) % ( 60*60*1000 )) / ( 60*1000 ) *1 );
            secs   = Math.floor (((( difference % ( 60*60*1000*24 )) % ( 60*60*1000 )) % ( 60*1000 )) / 1000*1 );

            document.getElementById('years').firstChild.nodeValue   = years;
            document.getElementById('days').firstChild.nodeValue    = days;
            document.getElementById('hours').firstChild.nodeValue   = hours;
            document.getElementById('minutes').firstChild.nodeValue = mins;
            document.getElementById('seconds').firstChild.nodeValue = secs;

            clearTimeout ( upTime.to );
            upTime.to = setTimeout (function() {
                upTime ( countTo )
            }, 1000 )
        }
    }
})(window);
