treesummaryrefslogcommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorPatrick Schönberger2018-11-23 21:09:11 +0100
committerPatrick Schönberger2018-11-23 21:09:11 +0100
commitc2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34 (patch)
tree14c88ba63b06055c1da70d87e351ba4e91ea5d11 /script.js
downloadlolstats-c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34.tar.gz
lolstats-c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34.zip
Initial commit
Diffstat (limited to 'script.js')
-rw-r--r--script.js46
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;
+ },
+ },
+});