-
Notifications
You must be signed in to change notification settings - Fork 32
/
example.conditional.html
46 lines (39 loc) · 1.3 KB
/
example.conditional.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="scripts/riven.js"></script>
<script src="scripts/nodes/value.js"></script>
<script src="scripts/nodes/equals.js"></script>
<script src="scripts/nodes/bang.js"></script>
<script src="scripts/nodes/console.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 — Conditional</title>
</head>
<body>
<script>
'use strict'
const lib = RIVEN.lib
RIVEN.create = (append = true) => {
Ø("val1").create({x:4,y:10},lib.Value,"blue")
Ø("equals").create({x:10,y:10},lib.Equals)
Ø("console").create({x:26,y:10},lib.Console)
Ø("red").create({x:18,y:4},lib.Bang)
Ø("green").create({x:18,y:8},lib.Bang)
Ø("blue").create({x:18,y:12},lib.Bang)
Ø("else").create({x:18,y:16},lib.Bang)
Ø("val1").connect("equals")
Ø("equals").connect(["red","green","blue","else"])
Ø("red").connect("console")
Ø("green").connect("console")
Ø("blue").connect("console")
Ø("else").connect("console")
}
RIVEN.create(true);
Ø("val1").send("blue")
RIVEN.graph()
</script>
</body>
</html>