Revert input bindings

This commit is contained in:
Austen Adler 2021-08-15 23:08:25 -04:00
parent 4423bb6775
commit 0e20ea2329
4 changed files with 8 additions and 1357 deletions

1345
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,6 @@ export default {
production && terser()
],
watch: {
clearScreen: false
clearScreen: true
}
};

View File

@ -1,6 +1,5 @@
<script lang="ts">
import Colors from "./Colors.svelte";
import Input from "./Input.svelte";
let url = "/api/setcolor";
let possiblePatterns = [
@ -19,7 +18,7 @@
{name: "color", type: "color", label: "Color", value: "#000000"},
]},
{name: "MovingRainbow", text: "MovingRainbow", formElements: [
{name: "width", type: "number", label: "Width", value: "4"},
{name: "width", type: "number", label: "Width", value: 4},
{name: "forward", type: "checkbox", label: "More Forward?", value: ""},
{name: "skip", type: "number", label: "# to skip", value: ""},
]},
@ -30,8 +29,8 @@
]},
{name: "Flashing", text: "Flashing", formElements: [
{name: "color", type: "colors", label: "Color", value: []},
{name: "width", type: "number", label: "Width", value: "1"},
{name: "tick_rate", type: "number", label: "Tick Rate", value: 8},
{name: "width", type: "number", label: "Width", value: 10},
{name: "tick_rate", type: "number", label: "Tick Rate", value: 10},
]},
];
let selectedPattern = possiblePatterns[0];
@ -90,7 +89,7 @@
{#if fe.type === "colors"}
<Colors bind:value={fe.value}/>
{:else}
<Input bind:value={fe.value} type={fe.type} />
<input type={fe.type} name={fe.name} on:input={(e) => fe.value = e.target.value} />
{/if}
{/each}
<button type="submit">Submit</button>

View File

@ -1,8 +1 @@
<script lang="ts">
export let type;
export let value;
const setType = (node) => {
node.type = type;
};
</script>
<input use:setType bind:value />