treesummaryrefslogcommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorPatrick Schönberger2018-11-24 20:08:45 +0100
committerPatrick Schönberger2018-11-24 20:08:45 +0100
commit03797acb781ad41158dedeae18c390420363301f (patch)
tree70ebd2a2217dabd5abfb6ab0feefa1a4f6215ab9 /script.js
parentc2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34 (diff)
downloadlolstats-03797acb781ad41158dedeae18c390420363301f.tar.gz
lolstats-03797acb781ad41158dedeae18c390420363301f.zip
Background changed
Diffstat (limited to 'script.js')
-rw-r--r--script.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/script.js b/script.js
index 96ea448..c343633 100644
--- a/script.js
+++ b/script.js
@@ -10,19 +10,28 @@ let redSkins = [
function randomElement(array) {
return array[Math.floor(Math.random() * array.length)];
}
+let champ1 = "http://ddragon.leagueoflegends.com/cdn/img/champion/loading/" + randomElement(redSkins) + ".jpg";
+let champ2 = "http://ddragon.leagueoflegends.com/cdn/img/champion/splash/" + randomElement(redSkins) + ".jpg";
+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";
+let ionia2 = "https://am-a.akamaihd.net/image?f=https%3A%2F%2Funiverse-meeps.leagueoflegends.com%2Fv1%2Fassets%2Fimages%2Ffactions%2Fmount-targon_splash.jpg";
function getType() {
+ return window.innerWidth < window.innerHeight;
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(),
+ image: ionia1,
}
});
+function onResize() {
+ if (getType()) bg.image = ionia1;
+ else bg.image = ionia2;
+}
+
var start = new Vue({
el: '#start',
data: {