diff --git a/src/App.vue b/src/App.vue index a176b944d..eb2d3e328 100644 --- a/src/App.vue +++ b/src/App.vue @@ -166,6 +166,21 @@ const showMissionOptionsDialog = ref(false) // Clock const timeNow = useTimestamp({ interval: 1000 }) + +// Control showing mouse +let hideMouseTimeoutId: ReturnType + +const hideMouse = (): void => { + document.body.classList.add('hide-cursor') +} + +const resetHideMouseTimeout = (): void => { + clearTimeout(hideMouseTimeoutId) + document.body.classList.remove('hide-cursor') + hideMouseTimeoutId = setTimeout(hideMouse, 5000) +} + +document.addEventListener('mousemove', resetHideMouseTimeout)