-
-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy path+page.svelte
More file actions
93 lines (88 loc) · 2.06 KB
/
Copy path+page.svelte
File metadata and controls
93 lines (88 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<script lang="ts">
import { Svelvet, Minimap, Node, Anchor } from '$lib';
import CustomEdge from '../../example-components/CustomEdge.svelte';
import ColorAnchor from '../../example-components/sandbox/ColorAnchor.svelte';
const nodes: number = 3;
</script>
<body>
<Svelvet fitView>
{#each Array(nodes) as _, i}
<Node label={`Node ${i + 1}`} position={{ x: 200 * i, y: 200 * i }} TD>
<div class="node">
<div class="inputs">
<Anchor input dataType={'image'} let:hovering>
<div class="my-anchor red" class:hovering />
</Anchor>
<Anchor input dataType={['image', 'tabular']} let:hovering>
<div class="my-anchor redblue" class:hovering />
</Anchor>
<Anchor input dataType={'tabular'} let:hovering>
<div class="my-anchor blue" class:hovering />
</Anchor>
</div>
<div class="outputs">
<Anchor output dataType={'tabular'} let:hovering>
<div class="my-anchor blue" class:hovering />
</Anchor>
<Anchor output dataType={'image'} let:hovering>
<div class="my-anchor red" class:hovering />
</Anchor>
</div>
</div>
</Node>
{/each}
</Svelvet>
</body>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
background-color: gray;
width: 100vw;
height: 100vh;
padding: 0;
margin: 0;
}
.node {
width: 200px;
height: 100px;
background-color: #fafafa;
position: relative;
}
.node .inputs {
position: absolute;
top: 5%;
left: -10px;
height: 90%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.node .outputs {
position: absolute;
top: 5%;
right: 0;
height: 90%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.my-anchor {
width: 18px;
height: 18px;
border-radius: 50%;
}
.my-anchor.hovering {
transform: scale(1.2);
}
.my-anchor.red {
background-color: #ef5350;
}
.my-anchor.blue {
background-color: #42a5f5;
}
.my-anchor.redblue {
background: linear-gradient(90deg, rgba(239, 83, 80, 1) 0%, rgba(66, 165, 245, 1) 100%);
}
</style>