-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
101 lines (76 loc) · 3.72 KB
/
index.html
File metadata and controls
101 lines (76 loc) · 3.72 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
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Fractales</title>
<link rel="stylesheet" href="css/style.css">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="p-4">
<h1 class="font-bold">L-System</h1>
<div class="grid my-2 grid-cols-1 md:grid-cols-2 gap-8">
<section class="customPattern">
<div class="grid grid-cols-4">
<input type="text" name="axiom" id="axiom" placeholder="Axiom">
<input type="number" name="lineLength" id="lineLength" placeholder="len">
<input type="number" name="angle" id="angle" placeholder="angle">
<input type="number" name="gen" id="gen" placeholder="gen">
</div>
<p>Rules:</p>
<section id="customRules">
<input type="text" class="rule input">
<input type="text" class="rule output">
<button id="addRulesCtr" class="bg-blue-500 text-white hover:bg-green-500 transform leading-4 p-4 transition duration-100">+</button><br />
</section>
<button id="drawIt" class="bg-blue-500 text-white hover:bg-purple-500 transform leading-4 p-4 transition duration-100">Draw It!</button>
</section>
<section class="glossary">
<h3>Glossary:</h3>
<p>- <span class="command">F</span>/<span class="command">G</span>: Draw line forward</p>
<p>- Rotate by angle (<span class="command">-</span>: left; <span class="command">+</span>: right)</p>
<p>- Canvas state (<span class="command">[</span>: save; <span class="command">]</span>: restore)</p>
</section>
</div>
<canvas width="500" height="500" id="fractal">
Tu puto navegador no soporta esta mierda (ya me jodería).
</canvas>
<section id="currentFractalInfo">
<p id="axiomInfo"></p>
<p id="rulesInfo"></p>
<p id="genInfo"></p>
</section>
<section>
<h3>Examples:</h3>
<div class="flex flex-col md:flex-row flex-wrap md:items-center md:space-x-4 space-y-4 md:space-y-0">
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="tree0">
<input type="radio" name="fractalSelector" id="tree0">
Tree 1
</label>
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="tree1">
<input type="radio" name="fractalSelector" id="tree1">
Tree 2
</label>
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="tree2">
<input type="radio" name="fractalSelector" id="tree2">
Tree 3
</label>
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="triangle0">
<input type="radio" name="fractalSelector" id="triangle0">
Sierpiński arrowhead curve
</label>
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="curve0">
<input type="radio" name="fractalSelector" id="curve0">
Koch Snowflake
</label>
<label class="shadow bg-white p-2 rounded bg-gray-100 cursor-pointer" for="curve1">
<input type="radio" name="fractalSelector" id="curve1">
Hilbert curve
</label>
</div>
</section>
<script type="module" src="js/controls.js"></script>
<script type="module" src="js/lsystem/render.js"></script>
</body>
</html>