{"size": 811, "ext": "js", "max_stars_repo_path": "web/games.js", "max_stars_repo_name": "mdatsev/elsys_homeworks", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/games.js", "max_issues_repo_name": "mdatsev/elsys_homeworks", "max_issues_repo_issues_event_min_datetime": "2020-02-25T23:36:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T23:19:18.000Z", "max_forks_repo_path": "web/games.js", "max_forks_repo_name": "mdatsev/elsys_homeworks", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 45, "max_forks_count": null, "avg_line_length": 31.1923076923, "max_line_length": 77, "alphanum_fraction": 0.6202219482}
var modal = document.getElementById('myModal');

var span = document.getElementsByClassName("close")[0];
let last;
[].forEach.apply(document.getElementsByClassName("gamethumb"), [b => {
    let id = b.getAttribute("game")
    b.onclick = () => {
        document.getElementById(`game-${id}-canvas`).style.display = "block"
        last = b.getAttribute("game");
        eval(`game${id}()`)
        modal.style.display = "block";
    }
    b.src = `images/thumb${+id+1}.png`
}])

span.onclick = function () {
    document.getElementById(`game-${last}-canvas`).style.display = "none"
    modal.style.display = "none";
}

window.onclick = function (event) {
    if (event.target == modal) {
        document.getElementById(`game-${last}-canvas`).style.display = "none"
        modal.style.display = "none";
    }
}