-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.html
87 lines (80 loc) · 1.71 KB
/
editor.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
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
<!DOCTYPE html>
<html>
<head>
<title>YaGAL Editor</title>
<style>
body {
height: 100vh;
padding: 0;
margin: 0;
}
.editor {
float: left;
width: 50%;
height: 99%;
}
#canvas {
border: 2ex solid #000;
float: right;
width: 40%;
height: 90%;
}
button#runner {
float: right;
width: 40%;
}
</style>
</head>
<body>
<textarea id="program" class="editor" spellcheck="false">
startshape FOREST
shape FOREST
{
SEED [ sat 0.5 b 0.5 ]
SEED [ sat 0.5 b 0.5 hue 100 rotate 0 x -20 y 0 ]
SEED [ sat 0.5 b 0.5 hue 200 x -40 ]
}
shape SEED
rule {BRANCH []}
rule {BRANCH [rotate 1]}
rule {BRANCH [rotate -1]}
rule {BRANCH [rotate 2]}
rule {BRANCH [rotate -2]}
rule {FORK []}
shape BRANCH
rule {LEFTBRANCH [flip 90]}
rule {LEFTBRANCH []}
shape LEFTBRANCH
rule 4 {BLOCK [] LEFTBRANCH [y 0.885 rotate 0.1 size 0.99]}
rule 4 {BLOCK [] LEFTBRANCH [y 0.885 rotate 0.2 size 0.99]}
rule {BLOCK [] LEFTBRANCH [y 0.885 rotate 4 size 0.99]}
rule {BLOCK [] FORK []}
shape BLOCK
{
SQUARE [rotate 1]
SQUARE [rotate -1]
SQUARE []
}
shape FORK
rule {
BRANCH [ ]
BRANCH [size 0.5 rotate 40]
}
rule {
BRANCH [ ]
BRANCH [size 0.5 rotate -40]
}
rule {
BRANCH [size 0.5 rotate -20]
BRANCH [ ]
}
rule {
BRANCH [size 0.7 y 0.1 rotate 20]
BRANCH [size 0.7 y 0.1 rotate -20]
}
</textarea>
<canvas id="canvas"></canvas>
<button id="runner">Update</button>
</body>
<script src="./dist/editor.js"></script>
</html>