use number input for corner radius setting

This commit is contained in:
Til Schmitter 2026-06-10 09:42:41 +02:00
parent 4fa092d22f
commit e8f9bbe08d
2 changed files with 5 additions and 5 deletions

View file

@ -2040,6 +2040,7 @@ html.y #ops svg circle {
} }
#pathBar input[type=text], #pathBar input[type=text],
.opview select, .opview select,
.opview input[type=number],
.opview input[type=text], .opview input[type=text],
.opview input[type=color], .opview input[type=color],
.opview input[type=date] { .opview input[type=date] {

View file

@ -1314,7 +1314,7 @@ ebi('op_cfg').innerHTML = (
' <input type="text" id="accent" placeholder="#color"></input>' + ' <input type="text" id="accent" placeholder="#color"></input>' +
' <input type="color" id="accent_picker"></input>' + ' <input type="color" id="accent_picker"></input>' +
' </div>' + ' </div>' +
' <input tt="' + L.cl_radius +'" type="text" id="radius" placeholder="[0-inf]"></input>' + ' <input tt="' + L.cl_radius +'" type="number" id="radius" min="-1" placeholder="[0-inf]"></input>' +
' <a id="fun_tgl" class="tgl btn" tt="' + L.cl_fun + '">🥳</a>\n' + ' <a id="fun_tgl" class="tgl btn" tt="' + L.cl_fun + '">🥳</a>\n' +
' </div>\n' + ' </div>\n' +
'</div>\n' + '</div>\n' +
@ -1527,10 +1527,9 @@ ebi('radius').oninput = function () {
if(r === radius) if(r === radius)
return; return;
if(isNaN(r)) var usefallback = isNaN(r) || r < 0 || r === '';
r = '' var setV = usefallback ? '' : (r + 'px');
swrite('radius', r); swrite('radius', !usefallback && r);
var setV = this.value == '' ? '' : (r + 'px');
document.documentElement.style.setProperty('--radius', setV); document.documentElement.style.setProperty('--radius', setV);
console.log(setV); console.log(setV);
} }