{"size": 849, "ext": "js", "max_stars_repo_path": "public/javascripts/home.js", "max_stars_repo_name": "christianjosueBT/project-name", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/javascripts/home.js", "max_issues_repo_name": "christianjosueBT/project-name", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/javascripts/home.js", "max_forks_repo_name": "christianjosueBT/project-name", "max_forks_repo_forks_event_min_datetime": "2021-10-21T00:19:13.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-21T00:19:13.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 24.9705882353, "max_line_length": 90, "alphanum_fraction": 0.5959952886}
// function to rotate which li background image is being displayed
function changeIndex(obj, coffeeShops) {

    coffeeShops.forEach((img, i) => img.style.display = obj.num === i ? 'block' : 'none');
    obj.num++;
    if (obj.num === coffeeShops.length) {
        obj.num = 0;
    }
};

function changeBg(t) {
    const coffeeShops = document.querySelectorAll('img');
    let obj = {};
    obj.num = 0;

    let timerId = setTimeout(function change() {
        changeIndex(obj, coffeeShops);
        timerId = setTimeout(change, t * 1000);
    }, t * 1000);
};

function loadPage() {
    const loader = document.querySelector('.loader-wrapper');

    document.addEventListener('readystatechange', (event) => {
        if (document.readyState === "complete") {
            loader.remove();
            changeBg(3);
        }
    });
};


loadPage();