]> gitweb.ps.run Git - lolstats/blobdiff - html/script.js
data
[lolstats] / html / script.js
index c2d4fd576d40cd9fc2dffe2681a2da743e1f7bc9..fdd261fb0029cfa0702c847be19743d4e2a509f5 100644 (file)
@@ -103,15 +103,29 @@ function getChampLookup() {
       app.champlookup = JSON.parse(data);
     });
 }
+let matchesHtml = [];
 function getMatches() {
   $.ajax("/lol/matches?region=" + app.region + "&summoner=" + app.summoner)
     .done((data) => {
       app.matches = JSON.parse(data);
+      matchesHtml = [];
+      matchesHtml.push("<tr><th></th><th>Game Type</th><th>Time</th></tr>");
       for (m in app.matches) {
         app.matches[m].championString = app.champlookup[app.matches[m].champion];
         app.matches[m].queueString = app.queues[app.matches[m].queue];
         app.matches[m].timestampString = new Date(app.matches[m].timestamp).toLocaleString();
+        let newTag = "<tr><td><img class='championIcon' src='http://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/" + app.matches[m].championString + ".png'></img></td>";
+        newTag = newTag.concat("<td>" + app.matches[m].queueString + "</td>");
+        newTag = newTag.concat("<td>" + app.matches[m].timestampString + "</td>");
+        newTag = newTag.concat("</tr>");
+        console.log(newTag);
+        matchesHtml.push(newTag);
       }
+      var clusterize = new Clusterize({
+        rows: matchesHtml,
+        scrollId: 'scrollArea',
+        contentId: 'contentArea',
+      });
     });
 }
 function getInfo() {