options: add options page

This commit is contained in:
He4eT 2024-08-15 19:43:33 +02:00
commit f41cb32e81
5 changed files with 136 additions and 2 deletions

View file

@ -0,0 +1,17 @@
function syncSliders(sliderId, numberInputId) {
const slider = document.getElementById(sliderId)
const numberInput = document.getElementById(numberInputId)
slider.addEventListener('input', () => {
numberInput.value = slider.value
})
numberInput.addEventListener('input', () => {
slider.value = numberInput.value
})
}
syncSliders('density', 'densityValue')
syncSliders('red', 'redValue')
syncSliders('green', 'greenValue')
syncSliders('blue', 'blueValue')