From c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34 Mon Sep 17 00:00:00 2001 From: Patrick Schönberger Date: Fri, 23 Nov 2018 21:09:11 +0100 Subject: Initial commit --- script.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 script.js (limited to 'script.js') 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; + }, + }, +}); -- cgit v1.2.3