Performances optimizations WIP
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -22,30 +22,32 @@
|
||||
** Run code when mounted
|
||||
*/
|
||||
onMount(async () => {
|
||||
// Import libraries and code
|
||||
let InteractiveGlobe
|
||||
await import('globe/index').then(module => InteractiveGlobe = module.default)
|
||||
// Init the globe from library
|
||||
globe = new InteractiveGlobe({
|
||||
el: scope,
|
||||
texture: `/img/globe/map-${window.innerWidth >= 992 ? '3k' : '2k'}.png`,
|
||||
markers: [...$locations.map(location => {
|
||||
return {
|
||||
name: location.name,
|
||||
slug: location.slug,
|
||||
countryName: location.country.name,
|
||||
countrySlug: location.country.slug,
|
||||
lat: location.coordinates.lat,
|
||||
lng: location.coordinates.lng
|
||||
}
|
||||
})],
|
||||
cameraDistance: 3,
|
||||
onLinkClicked: () => {}
|
||||
})
|
||||
if (process.browser) {
|
||||
// Import libraries and code
|
||||
await import('globe/index').then(module => InteractiveGlobe = module.default)
|
||||
// Init the globe from library
|
||||
globe = new InteractiveGlobe({
|
||||
el: scope,
|
||||
texture: `/img/globe/map-${window.innerWidth >= 992 ? '3k' : '2k'}.png`,
|
||||
markers: [...$locations.map(location => {
|
||||
return {
|
||||
name: location.name,
|
||||
slug: location.slug,
|
||||
countryName: location.country.name,
|
||||
countrySlug: location.country.slug,
|
||||
lat: location.coordinates.lat,
|
||||
lng: location.coordinates.lng
|
||||
}
|
||||
})],
|
||||
cameraDistance: 3,
|
||||
onLinkClicked: () => {}
|
||||
})
|
||||
|
||||
// Run the globe
|
||||
resize()
|
||||
update()
|
||||
// Run the globe
|
||||
resize()
|
||||
update()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user