diff options
Diffstat (limited to 'script.js')
| -rw-r--r-- | script.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/script.js b/script.js new file mode 100644 index 0000000..96ea448 --- /dev/null +++ b/script.js @@ -0,0 +1,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; + }, + }, +}); |
