updated webp-images, lazyloaded map images, added fontawesome icons

This commit is contained in:
cnachtigall1991
2021-10-09 00:26:04 +02:00
parent 054c9e4301
commit 7d479c4395
110 changed files with 408 additions and 257 deletions

View File

@@ -21,4 +21,20 @@ export const DisplayRank = (rankNr = 0) => {
[18, 'Global Elite'],
])
return [require(`../images/rank_icons/skillgroup${rankNr}.svg`), rankMap.get(rankNr)]
}
}
export const LoadImage = (mapName) => {
let img = new Image()
let background = document.querySelector('.bg-img')
img.onload = function() {
background.src = img.src
}
img.onerror = function () {
img.src = require(`../images/map_screenshots/${mapName}.jpg`)
img.onerror = null
}
img.src = require(`../images/map_screenshots/${mapName}.webp`)
}