text: "use strict";
  var memoryGame;
  (function (memoryGame) {
      let scoreDiv = document.getElementById("score");
      document.getElementById("submitScore").addEventListener("click", submitScore);
      showResults();
      async function showResults() {
          let rank = await memoryGame.getRanking(localStorage.getItem("score"), localStorage.getItem("leaderboardName"));
          scoreDiv.innerHTML = "You achieved Rank " + rank + " on the \"" + localStorage.getItem("leaderboardName") + "\"-leaderboard, with a time of " + localStorage.getItem("score") + "s";
      }
      async function submitScore() {
          let input = document.getElementById("submitName");
          if (input.value.length > 15) {
              alert("Name is too long (15 chars. max)");
          }
          else {
              await memoryGame.addScore(localStorage.getItem("score"), localStorage.getItem("leaderboardName"));
              setTimeout(toLeaderboards, 300);
          }
      }
      function toLeaderboards() {
          localStorage.removeItem("score");
          window.location.href = "../html/leaderboards.html";
      }
  })(memoryGame || (memoryGame = {}));
  //# sourceMappingURL=result.js.map