forked from XXIIVV/riven
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.math.html
50 lines (42 loc) · 1.41 KB
/
example.math.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="scripts/riven.js"></script>
<script src="scripts/nodes/print.js"></script>
<script src="scripts/nodes/value.js"></script>
<script src="scripts/nodes/add.js"></script>
<script src="scripts/nodes/concat.js"></script>
<link rel="stylesheet" type="text/css" href="links/reset.css"/>
<link rel="stylesheet" type="text/css" href="links/fonts.css"/>
<link rel="stylesheet" type="text/css" href="links/main.css"/>
<title>Riven — Math</title>
</head>
<body>
<script>
'use strict'
const lib = RIVEN.lib
RIVEN.create = (append = true) => {
Ø("bang").create({x:4,y:8},RIVEN.Node)
// Int nodes
Ø("add").create({x:14,y:4},lib.Add)
Ø("int1").create({x:12,y:8},lib.Value,3)
Ø("int2").create({x:16,y:8},lib.Value,5)
Ø("print_int").create({x:20,y:4},lib.Print)
// Str nodes
Ø("concat").create({x:14,y:12},lib.Concat)
Ø("str1").create({x:12,y:16},lib.Value,"hello")
Ø("str2").create({x:16,y:16},lib.Value,"world")
Ø("print_str").create({x:20,y:12},lib.Print)
Ø("bang").connect(["add","concat"])
Ø("add").connect(["print_int"])
Ø("add").syphon(["int1","int2"])
Ø("concat").syphon(["str1","str2"])
Ø("concat").connect(["print_str"])
}
RIVEN.create(true);
Ø("bang").bang();
RIVEN.graph()
</script>
</body>
</html>