Rename global data arrays as plural by default
Easier for each loop and maps as to use singular
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
export let scrollSmooth: number = 0.5
|
||||
export let opacity: number = 1
|
||||
|
||||
const { continent, location } = getContext('global')
|
||||
const { continents, locations } = getContext('global')
|
||||
|
||||
let globe: any
|
||||
let Globe: any
|
||||
@@ -16,9 +16,9 @@
|
||||
let containerTop: number = 0, containerHeight: number = 0
|
||||
let observer: IntersectionObserver
|
||||
|
||||
const randomContinent = getRandomElement(continent.filter(cont => cont.countries))
|
||||
const randomContinent = getRandomElement(continents.filter(cont => cont.countries))
|
||||
const globeResolution = windowWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
|
||||
const locations = location.map(({ name, slug, country, coordinates: { coordinates }}: any) => ({
|
||||
const markers = locations.map(({ name, slug, country, coordinates: { coordinates }}: any) => ({
|
||||
name,
|
||||
slug,
|
||||
countryName: country.name,
|
||||
@@ -77,7 +77,7 @@
|
||||
scrollSmoothing: scrollSmooth,
|
||||
opacity,
|
||||
texture: `/images/globe-map-${globeResolution}.png`,
|
||||
markers: locations,
|
||||
markers,
|
||||
onLinkClicked: () => {}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user