Files
ffmpeg-explorer/src/nodes/Node.svelte

29 lines
908 B
Svelte
Raw Normal View History

2023-08-22 21:57:53 -04:00
<script lang="ts">
import { Handle, Position } from "@xyflow/svelte";
export let data = { name: "", inputs: [], outputs: [], onChange: () => {} };
</script>
2023-08-23 18:10:28 -04:00
<div class="node">
2023-08-22 21:57:53 -04:00
{data.name}
</div>
{#each data.inputs as inp, index}
2023-08-23 18:10:28 -04:00
<Handle type="target" position={Position.Left} id={inp + "_" + index} style="top: {index*10}px; background-color: {inp == 'v' ? 'blue' : 'red'}" />
2023-08-22 21:57:53 -04:00
{/each}
{#each data.outputs as out, index}
2023-08-23 18:10:28 -04:00
<Handle type="source" id={out + "_" + index} position={Position.Right} style="top: {index*10}px; background-color: {out == 'v' ? 'blue' : 'red'}" />
2023-08-22 21:57:53 -04:00
{/each}
<!-- <Handle type="source" position={Position.Right} id="a" style="top: 10px;" on:connect /> -->
<!-- <Handle -->
<!-- type="source" -->
<!-- position={Position.Right} -->
<!-- id="b" -->
<!-- style="top: auto; bottom: 10px;" -->
<!-- on:connect -->
<!-- /> -->
2023-08-23 18:10:28 -04:00
<style>
.node {
padding: 5px;
}
</style>