mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-01 04:14:43 +01:00
Added timeline slider scroll wheel incrementation
This commit is contained in:
parent
275ac22684
commit
fa725b2d56
2 changed files with 16 additions and 5 deletions
|
@ -321,8 +321,6 @@ async function init() {
|
||||||
|
|
||||||
zoom = Math.max(minZoom, Math.min(maxZoom, zoom))
|
zoom = Math.max(minZoom, Math.min(maxZoom, zoom))
|
||||||
applyZoom(x, y, zoom)
|
applyZoom(x, y, zoom)
|
||||||
|
|
||||||
e.preventDefault()
|
|
||||||
}, { passive: true })
|
}, { passive: true })
|
||||||
|
|
||||||
/*function setDesiredZoom(x, y, target){
|
/*function setDesiredZoom(x, y, target){
|
||||||
|
|
|
@ -85,8 +85,21 @@ timelineSlider.max = variationsConfig[currentVariation].versions.length - 1
|
||||||
timelineSlider.value = currentPeriod
|
timelineSlider.value = currentPeriod
|
||||||
timelineList.children[0].value = defaultPeriod
|
timelineList.children[0].value = defaultPeriod
|
||||||
|
|
||||||
timelineSlider.addEventListener("input", (event) => {
|
timelineSlider.addEventListener("input", (e) => timelineParser(e.target.value))
|
||||||
updateTooltip(parseInt(event.target.value), currentVariation)
|
|
||||||
|
timelineSlider.addEventListener("wheel", function (e) {
|
||||||
|
if (e.deltaY < 0) {
|
||||||
|
this.valueAsNumber += 1;
|
||||||
|
timelineParser(this.value)
|
||||||
|
} else {
|
||||||
|
this.value -= 1;
|
||||||
|
timelineParser(this.value)
|
||||||
|
}
|
||||||
|
e.stopPropagation();
|
||||||
|
}, { passive: true })
|
||||||
|
|
||||||
|
function timelineParser(value) {
|
||||||
|
updateTooltip(parseInt(value), currentVariation)
|
||||||
clearTimeout(updateTimeout)
|
clearTimeout(updateTimeout)
|
||||||
updateTimeout = setTimeout(() => {
|
updateTimeout = setTimeout(() => {
|
||||||
updateTime(parseInt(timelineSlider.value), currentVariation)
|
updateTime(parseInt(timelineSlider.value), currentVariation)
|
||||||
|
@ -96,7 +109,7 @@ timelineSlider.addEventListener("input", (event) => {
|
||||||
}
|
}
|
||||||
}, 50)
|
}, 50)
|
||||||
}, 25)
|
}, 25)
|
||||||
})
|
}
|
||||||
|
|
||||||
variantsEl.addEventListener("input", (event) => {
|
variantsEl.addEventListener("input", (event) => {
|
||||||
updateTime(-1, event.target.value)
|
updateTime(-1, event.target.value)
|
||||||
|
|
Loading…
Reference in a new issue