ADD: Vue-based devgui slider

This commit is contained in:
Robert Kossessa
2024-01-22 22:41:00 +01:00
parent d6815d56f0
commit 594136afe5
6 changed files with 115 additions and 56 deletions

View File

@@ -26,33 +26,4 @@ const app = createApp(App)
app.use(i18n)
app.use(store)
app.mount('#app')
var startPos = 0
var totalPos = 360
var currentPos = 156
var minRange = 0
var maxRange = 40
document.addEventListener('DOMContentLoaded', function() {
//....
// Quick Preview GUI indicator Render
var scale = document.getElementById('scale')
Number.prototype.map = function(in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
}
var guiCurrentPos = Math.round(currentPos.map(startPos, totalPos, minRange, maxRange))
for (var i = 0; i < 40; i = i + 1) {
scale.innerHTML += '<div class=\'bg-white\'></div>'
if (i - 1 < guiCurrentPos) {
scale.getElementsByTagName('div')[i].classList.add('active')
if (i == guiCurrentPos) {
scale.getElementsByTagName('div')[guiCurrentPos].classList.add('current')
}
}
}
})
app.mount('#app')