diff --git a/web/_css/style.css b/web/_css/style.css index e378df7b..ac86d18a 100644 --- a/web/_css/style.css +++ b/web/_css/style.css @@ -285,7 +285,10 @@ body[data-init-done] .listTransitioning #innerContainer { } } -#timeControls:hover #timeControlsTooltip, #timeControlsSlider:focus + #timeControlsTooltip { +#timeControls:hover #timeControlsTooltip, +#timeControlsSlider:focus + #timeControlsTooltip, +body[data-canvas-loading][data-init-done] #timeControlsTooltip, +body[data-init-done] #timeControlsTooltip[data-force-visible] { opacity: 1; visibility: visible; } diff --git a/web/_js/time.js b/web/_js/time.js index 2da63003..118d9d8b 100644 --- a/web/_js/time.js +++ b/web/_js/time.js @@ -54,6 +54,7 @@ const image = document.getElementById("image"); let abortController = new AbortController() let currentUpdateIndex = 0 let updateTimeout = setTimeout(null, 0) +let tooltipDelayHide = setTimeout(null, 0) let currentVariation = "default" const defaultPeriod = variationsConfig[currentVariation].default @@ -163,7 +164,8 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren } async function updateTime(newPeriod = currentPeriod, newVariation = currentVariation) { - document.body.dataset.canvasLoading = true + updateTooltip(newPeriod, newVariation) + document.body.dataset.canvasLoading = "" let configObject [configObject, newPeriod, newVariation] = await updateBackground(newPeriod, newVariation) @@ -199,8 +201,14 @@ async function updateTime(newPeriod = currentPeriod, newVariation = currentVaria }) } - dispatchTimeUpdateEvent(newPeriod, atlas) - document.body.dataset.canvasLoading = false + dispatchTimeUpdateEvent(newPeriod, atlas) + delete document.body.dataset.canvasLoading + tooltip.dataset.forceVisible = "" + clearTimeout(tooltipDelayHide) + tooltipDelayHide = setTimeout(() => { + delete tooltip.dataset.forceVisible + }, 1000) + } function updateTooltip(newPeriod, newVariation) {