{"size": 1666, "ext": "js", "max_stars_repo_path": "challenging/piano/keyboard.js", "max_stars_repo_name": "epmancini/JetBrains-Academy-Web", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "challenging/piano/keyboard.js", "max_issues_repo_name": "epmancini/JetBrains-Academy-Web", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "challenging/piano/keyboard.js", "max_forks_repo_name": "epmancini/JetBrains-Academy-Web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.2280701754, "max_line_length": 102, "alphanum_fraction": 0.5090036014}
// Add an event listener to the document which listens for keypress events.
document.addEventListener('keypress', function(e) {
    // If a key corresponding to one of the piano keys was pressed, play its corresponding audio file.
    if (e.code === 'KeyA') {
        let audio = new Audio("audio/A.mp3");
        audio.play();
    }
    else if (e.code === 'KeyS') {
        let audio = new Audio("audio/S.mp3");
        audio.play();
    }
    else if (e.code === 'KeyD') {
        let audio = new Audio("audio/D.mp3");
        audio.play();
    }
    else if (e.code === 'KeyF') {
        let audio = new Audio("audio/F.mp3");
        audio.play();
    }
    else if (e.code === 'KeyG') {
        let audio = new Audio("audio/G.mp3");
        audio.play();
    }
    else if (e.code === 'KeyH') {
        let audio = new Audio("audio/H.mp3");
        audio.play();
    }
    else if (e.code === 'KeyJ') {
        let audio = new Audio("audio/J.mp3");
        audio.play();
    }
    else if (e.code === 'KeyW') {
        let audio = new Audio("audio/W.mp3");
        audio.play();
    }
    else if (e.code === 'KeyE') {
        let audio = new Audio("audio/E.mp3");
        audio.play();
    }
    else if (e.code === 'KeyT') {
        let audio = new Audio("audio/T.mp3");
        audio.play();
    }
    else if (e.code === 'KeyY') {
        let audio = new Audio("audio/Y.mp3");
        audio.play();
    }
    else if (e.code === 'KeyU') {
        let audio = new Audio("audio/U.mp3");
        audio.play();
    }
    else {
        // Otherwise, print a warning message to the web console.
        console.log('Warning: Unsupported key pressed');
    }
});
