]> gitweb.ps.run Git - lolstats/blob - script.js
96ea448ba1de5cc7cc6fbac354d123fc651b952f
[lolstats] / script.js
1 let redSkins = [
2   "Jhin_4",
3   "Aatrox_0",
4   "Akali_2",
5   "Darius_15",
6   "Gangplank_8",
7   "Varus_7",
8 ];
9
10 function randomElement(array) {
11   return array[Math.floor(Math.random() * array.length)];
12 }
13
14 function getType() {
15   return (typeof window.orientation !== 'undefined');
16 }
17
18 var bg = new Vue({
19   el: '#background',
20   data: {
21     image: "http://ddragon.leagueoflegends.com/cdn/img/champion/" + (getType() ? "loading/" : "splash/") + randomElement(redSkins) + ".jpg",
22     mobile: getType(),
23   }
24 });
25
26 var start = new Vue({
27   el: '#start',
28   data: {
29     visible: true,
30     regions: [ "EUW", "NA" ],
31     matches: [],
32     categories: [
33       { text: "No.", name: "no" },
34       { text: "Queue", name: "qu" },
35       { text: "Champion", name: "ch" },
36       { text: "Result", name: "rs" },
37       { text: "Duration", name: "du" },
38       { text: "Date", name: "da" }
39     ],
40   },
41   methods: {
42     showNextPanel: function() {
43       start.visible = false;
44     },
45   },
46 });