From f50aa678661ccd1493f13704f73a84996b8d4e5d Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 28 Jul 2023 13:13:19 -0400 Subject: fix slider problem --- fractiform.js | 6 +++--- index.html | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fractiform.js b/fractiform.js index ed3d24a..6f721fa 100644 --- a/fractiform.js +++ b/fractiform.js @@ -2,7 +2,7 @@ /* TODO: -- why isn't slider dragging +- make uniforms for each control so they can be updated without recompiling */ let gl; @@ -1188,7 +1188,7 @@ function add_widget(func) { input.type = 'range'; input.min = 0; input.max = 1; - input.step = 'any'; + input.step = 0.001; input.value = 0; if (param['default']) { input.value = param['default']; @@ -1798,8 +1798,8 @@ function startup() { } else { resizing_ui = false; } + e.preventDefault(); } - e.preventDefault(); }); document.getElementById('code-form').addEventListener('submit', () => { diff --git a/index.html b/index.html index f86013e..bb320de 100644 --- a/index.html +++ b/index.html @@ -55,10 +55,6 @@ position: absolute; } - #ui-canvas { - border: 2px solid var(--ui-border); - } - button { border: 2px solid var(--ui-border); background-color: black; @@ -71,7 +67,7 @@ background-color: #fff6; } button:focus, input:focus { - outline: 2px solid #0a0; + outline: 1px solid #0f0; } #ui-resize { flex-grow: 0; @@ -126,6 +122,10 @@ height: 1.3em; width: 1.3em; } + input[type="range"] { + max-height: 1.2em; + vertical-align: middle; + } .widget { display: block; border-bottom: 2px solid #777; @@ -149,8 +149,7 @@ width: 1.5em; height: 1.5em; border: 0; - margin-top: 0.2em; - vertical-align: top; + vertical-align: middle; background-size: contain; } .widget-move { -- cgit v1.2.3