This commit is contained in:
Sam Lavigne
2023-08-23 18:10:28 -04:00
parent 7c085cbba2
commit d1079e47af
5 changed files with 144 additions and 205 deletions

View File

@ -4,14 +4,14 @@
export let data = { name: "", inputs: [], outputs: [], onChange: () => {} };
</script>
<div>
<div class="node">
{data.name}
</div>
{#each data.inputs as inp, index}
<Handle type="target" position={Position.Left} id={inp + "_" + index} style="top: {index*10}px; background-color: {inp == 'v' ? 'blue' : 'red'}" on:connect />
<Handle type="target" position={Position.Left} id={inp + "_" + index} style="top: {index*10}px; background-color: {inp == 'v' ? 'blue' : 'red'}" />
{/each}
{#each data.outputs as out, index}
<Handle type="source" id={out + "_" + index} position={Position.Right} style="top: {index*10}px; background-color: {out == 'v' ? 'blue' : 'red'}" on:connect />
<Handle type="source" id={out + "_" + index} position={Position.Right} style="top: {index*10}px; background-color: {out == 'v' ? 'blue' : 'red'}" />
{/each}
<!-- <Handle type="source" position={Position.Right} id="a" style="top: 10px;" on:connect /> -->
<!-- <Handle -->
@ -21,3 +21,8 @@
<!-- style="top: auto; bottom: 10px;" -->
<!-- on:connect -->
<!-- /> -->
<style>
.node {
padding: 5px;
}
</style>