]> gitweb.ps.run Git - lolstats/blob - script.js
Background changed
[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 let champ1 = "http://ddragon.leagueoflegends.com/cdn/img/champion/loading/" + randomElement(redSkins) + ".jpg";
14 let champ2 = "http://ddragon.leagueoflegends.com/cdn/img/champion/splash/" + randomElement(redSkins) + ".jpg";
15 let ionia1 = "https://am-a.akamaihd.net/image?f=https%3A%2F%2Funiverse-meeps.leagueoflegends.com%2Fv1%2Fassets%2Fimages%2Fmttargon-eternal-winter-of-the-mountaintop.jpg";
16 let ionia2 = "https://am-a.akamaihd.net/image?f=https%3A%2F%2Funiverse-meeps.leagueoflegends.com%2Fv1%2Fassets%2Fimages%2Ffactions%2Fmount-targon_splash.jpg";
17
18 function getType() {
19   return window.innerWidth < window.innerHeight;
20   return (typeof window.orientation !== 'undefined');
21 }
22
23 var bg = new Vue({
24   el: '#background',
25   data: {
26     image: ionia1,
27   }
28 });
29
30 function onResize() {
31   if (getType()) bg.image = ionia1;
32   else bg.image = ionia2;
33 }
34
35 var start = new Vue({
36   el: '#start',
37   data: {
38     visible: true,
39     regions: [ "EUW", "NA" ],
40     matches: [],
41     categories: [
42       { text: "No.", name: "no" },
43       { text: "Queue", name: "qu" },
44       { text: "Champion", name: "ch" },
45       { text: "Result", name: "rs" },
46       { text: "Duration", name: "du" },
47       { text: "Date", name: "da" }
48     ],
49   },
50   methods: {
51     showNextPanel: function() {
52       start.visible = false;
53     },
54   },
55 });