<script type="text/javascript">
const slider = document.querySelectorAll('.generator-input');
const handleInput = (el) => {
const min = el.min || 0;
const max = el.max || 100;
const pct = (el.value - min) / (max - min) * 100;
el.style.setProperty('--range-pct', pct + '%');
};
for (let i = 0; i < slider.length; i++) {handleInput(slider[i]);}
$(".generator-input").each(function() {$(this).on("input", (e) => handleInput(e.target));});
</script>