Fix getRandomElement function

Now return an array item instead of an index
This commit is contained in:
2021-11-28 23:06:22 +01:00
parent 595a93087c
commit 7169faa3aa
3 changed files with 4 additions and 3 deletions

View File

@@ -16,8 +16,8 @@
let containerTop: number = 0, containerHeight: number = 0
let observer: IntersectionObserver
const randomContinent = getRandomElement(continents.filter(cont => cont.countries))
const globeResolution = windowWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
const randomContinent = getRandomElement(continents.filter((cont: any) => cont.countries))
const markers = locations.map(({ name, slug, country, coordinates: { coordinates }}: any) => ({
name,
slug,