mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-03 22:33:42 +01:00
Show tooltip when setting period on draw
This commit is contained in:
parent
5634f58b8d
commit
8c74460bf2
2 changed files with 15 additions and 4 deletions
|
@ -285,7 +285,10 @@ @supports (backdrop-filter: blur()) or (-webkit-backdrop-filter: blur()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#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;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ const image = document.getElementById("image");
|
||||||
let abortController = new AbortController()
|
let abortController = new AbortController()
|
||||||
let currentUpdateIndex = 0
|
let currentUpdateIndex = 0
|
||||||
let updateTimeout = setTimeout(null, 0)
|
let updateTimeout = setTimeout(null, 0)
|
||||||
|
let tooltipDelayHide = setTimeout(null, 0)
|
||||||
|
|
||||||
let currentVariation = "default"
|
let currentVariation = "default"
|
||||||
const defaultPeriod = variationsConfig[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) {
|
async function updateTime(newPeriod = currentPeriod, newVariation = currentVariation) {
|
||||||
document.body.dataset.canvasLoading = true
|
updateTooltip(newPeriod, newVariation)
|
||||||
|
document.body.dataset.canvasLoading = ""
|
||||||
|
|
||||||
let configObject
|
let configObject
|
||||||
[configObject, newPeriod, newVariation] = await updateBackground(newPeriod, newVariation)
|
[configObject, newPeriod, newVariation] = await updateBackground(newPeriod, newVariation)
|
||||||
|
@ -199,8 +201,14 @@ async function updateTime(newPeriod = currentPeriod, newVariation = currentVaria
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatchTimeUpdateEvent(newPeriod, atlas)
|
dispatchTimeUpdateEvent(newPeriod, atlas)
|
||||||
document.body.dataset.canvasLoading = false
|
delete document.body.dataset.canvasLoading
|
||||||
|
tooltip.dataset.forceVisible = ""
|
||||||
|
clearTimeout(tooltipDelayHide)
|
||||||
|
tooltipDelayHide = setTimeout(() => {
|
||||||
|
delete tooltip.dataset.forceVisible
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTooltip(newPeriod, newVariation) {
|
function updateTooltip(newPeriod, newVariation) {
|
||||||
|
|
Loading…
Reference in a new issue