Add unit setting

This commit is contained in:
arne 2024-07-20 19:23:51 +02:00
commit c6b646b94c
2 changed files with 9 additions and 0 deletions

View file

@ -43,6 +43,11 @@
margin: 0.2rem 0;
}
label > span {
display: inline-block;
width: 9em;
}
@media screen and (min-width: 1024px) {
div.container {
display: grid;

View file

@ -114,6 +114,9 @@ const scene = sync({
const input = (label: string, attrs: any) =>
["div", {}, ["label", {}, label, ["input", attrs]]]
const select = (label: string, attrs: any, options: string[]) =>
["div", {}, ["label", {}, label, ["select", attrs, ...options.map(u => ["option", {value: u}, u])]]]
$compile(
["div.container", {},
["main", {},
@ -133,6 +136,7 @@ $compile(
value: height.deref()!,
oninput: $inputNum(height),
}),
select("Unit", { oninput: $input(unit) }, ["mm", "px"]),
input("Grid size: ", {
type: "number",
min: "5",