treesummaryrefslogcommitdiff
path: root/script.js
blob: 96ea448ba1de5cc7cc6fbac354d123fc651b952f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
let redSkins = [
  "Jhin_4",
  "Aatrox_0",
  "Akali_2",
  "Darius_15",
  "Gangplank_8",
  "Varus_7",
];

function randomElement(array) {
  return array[Math.floor(Math.random() * array.length)];
}

function getType() {
  return (typeof window.orientation !== 'undefined');
}

var bg = new Vue({
  el: '#background',
  data: {
    image: "http://ddragon.leagueoflegends.com/cdn/img/champion/" + (getType() ? "loading/" : "splash/") + randomElement(redSkins) + ".jpg",
    mobile: getType(),
  }
});

var start = new Vue({
  el: '#start',
  data: {
    visible: true,
    regions: [ "EUW", "NA" ],
    matches: [],
    categories: [
      { text: "No.", name: "no" },
      { text: "Queue", name: "qu" },
      { text: "Champion", name: "ch" },
      { text: "Result", name: "rs" },
      { text: "Duration", name: "du" },
      { text: "Date", name: "da" }
    ],
  },
  methods: {
    showNextPanel: function() {
      start.visible = false;
    },
  },
});