Performances optimizations WIP
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-17 14:33:49 +02:00
parent bb5689f0b6
commit 3c05d6d222
17 changed files with 211 additions and 181 deletions

View File

@@ -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>