Globe edits WIP
All checks were successful
continuous-integration/drone/push Build is passing

- Added visible continents to options
This commit is contained in:
2020-04-19 14:49:52 +02:00
parent c1bb2f31bc
commit 094614f83c
8 changed files with 238 additions and 210 deletions

View File

@@ -44,6 +44,22 @@ export function throttle (fn, delay) {
}
/*
** Get a DOM element's position
*/
export const getPosition = (node, scope) => {
const root = scope || document
let offsetTop = node.offsetTop
let offsetLeft = node.offsetLeft
while (node && node.offsetParent && node.offsetParent != document && node !== root && root !== node.offsetParent) {
offsetTop += node.offsetParent.offsetTop
offsetLeft += node.offsetParent.offsetLeft
node = node.offsetParent
}
return { top: offsetTop, left: offsetLeft }
}
/*
** Wrap string's each letters into a span
*/