-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
360 lines (325 loc) · 11.4 KB
/
index.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Automata Simulation</title>
<link rel="icon" href="/icon.png" />
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="src/styles.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/jointjs/3.7.5/joint.min.css"
integrity="sha512-GyvR5jC0OnZNT+eb5PR1OaRq4uSlkE+SrHK/T3DfKyUboA191W3aUiuCrErwtZuVdPMVu/Me595KD+rxXSe19w=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"
integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.5.0/backbone-min.js"
integrity="sha512-NAJF/IIdtSJ5JxYalGv+g0xbnbHJTa0W24Gy21nImt+sBkjRWTOhoo+JAQvCw9A9WzCJmq/JVuijggiOkrdW1Q=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jointjs/3.7.5/joint.min.js"
integrity="sha512-pSAAtQw8Sz/OO4m9e2rLqIUe8pZVng7giqZgoBnFTkl3ovJJ6WHHxNgIY+q607xg3CHhWdZKih7oVofY5ENdxQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
</head>
<body class="min-h-[100vh]">
<div class="border-b-[2px]">
<div class="px-8 py-2 flex justify-between items-center">
<div class="flex items-center gap-2">
<div class="mr-6 relative">
<h1 class="select-none">
<a href="/"
><img src="/logo.png" alt="Automata Simulation - UFPS"
/></a>
</h1>
</div>
<div class="pr-2">
<i class="fa-solid fa-screwdriver-wrench"></i>
</div>
<div
class="element bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs"
draggable="true"
title="State"
>
q
</div>
<div
class="element bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs"
draggable="true"
title="Final State"
>
qf
</div>
<div
class="bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs"
title="Clear all"
id="btn-clear-all"
>
<i class="fa-solid fa-trash-can text-[10px]"></i>
</div>
<div
class="bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs"
title="Download"
id="btn-download"
>
<i class="fa-solid fa-cloud-arrow-down text-[10px]"></i>
</div>
<select
id="changeSim"
class="change-simulator"
onchange="changeSimulator()"
>
<option value="Automata-Simulator">AFD Simulator</option>
<option value="Turing-Machine-Simulator">TM Simulator</option>
</select>
</div>
<div class="flex items-center gap-4">
<a href="#how-to-use" class="text-sm underline">How to use?</a>
<a href="/about/" class="text-sm underline">About Us</a>
<div class="flex gap-4">
<a
target="_blank"
href="https://github.com/byandrev/automata-simulation"
class="bg-gray-600 shadow text-white flex items-center gap-2 rounded px-2 py-1"
>
<span class="text-xs block">Open Source</span>
<i class="fa-brands fa-github"></i
></a>
</div>
</div>
</div>
</div>
<div class="split at">
<div id="paper" class="overflow-hidden"></div>
<div id="split-1" class="bg-gray-100 p-4 border-b-2">
<div class="flex items-center gap-2">
<input
type="text"
id="input-string"
placeholder="String"
class="w-full px-1 h-8 text-xs rounded border-2 border-slate-200 bg-slate-100"
/>
<button
id="run"
class="rounded flex items-center gap-2 shadow px-4 h-8 text-xs bg-blue-500 text-white hover:bg-blue-600 active:bg-blue-500"
>
<i class="fa-solid fa-play"></i>
Run
</button>
</div>
<div class="mt-4">
<p><span id="out"></span></p>
<p class="mt-2 text-xl" id="string-out"></p>
</div>
<div class="mt-8" id="error"></div>
</div>
</div>
<main class="leading-7 container mx-auto px-2">
<div class="my-10" id="how-to-use">
<h2 class="text-2xl font-bold mb-2">About</h2>
<p>
This open-source software provides users with the ability to create,
modify, and simulate automata efficiently and effectively. Through an
intuitive interface, users can define states, transitions, and
conditions, allowing them to visualize how an automaton responds to
different inputs or scenarios.
</p>
<p class="font-bold underline">
Currently supports AFD, AFND, AFN with null transitions and turing
machines.
</p>
</div>
<div class="max-w-[800px] mx-auto">
<video
loop="true"
autoplay="true"
src="/example-use.mp4"
class="border-2 rounded"
alt="create, modify, and simulate automata"
></video>
<p class="text-center text-sm font-bold underline">
Rename states and transitions with double click
</p>
</div>
<div class="my-10">
<h2 class="text-2xl font-bold mb-2">ToDo</h2>
<ul class="ml-2">
<li>
<i class="fa-solid fa-square-check"></i> Support to AFND and AFN λ
</li>
<li>
<i class="fa-solid fa-square-check"></i> Generate transition table
</li>
<li>
<i class="fa-solid fa-square-check"></i> Support Turing Machine
</li>
</ul>
</div>
<div class="my-10">
<h3 class="text-2xl font-bold mb-2">Collaborate</h3>
<p class="mb-4">
Thank you for considering contributing to our project! We welcome
contributions from the community, whether it's for fixing existing
issues, adding new features, or improving the documentation. Here's
how you can contribute:
</p>
<p class="mb-4">
If you find an issue or have a feature request, please first check our
"Issues" section to make sure it hasn't been reported before. If it's
a new issue, you can open a new issue and provide a detailed
description.
</p>
<p class="mb-4">
If you want to contribute with code, follow these steps:
</p>
<ol class="list-decimal ml-6 mb-4">
<li>
Fork this repository and clone your copy to your local machine.
</li>
<li>
Create a new branch for your contribution: git branch branch-name.
</li>
<li>Make the necessary changes to the code.</li>
<li>Ensure your changes follow our code style guidelines.</li>
<li>
Commit your changes: git commit -m 'Description of the changes'.
</li>
<li>
Push your changes to your remote repository: git push origin
branch-name.
</li>
<li>
Open a pull request on our main repository, describing the changes
made and providing any additional context.
</li>
</ol>
<p class="mb-4">
Github:
<a
target="_blank"
class="text-blue-500 underline"
href="https://github.com/byandrev/automata-simulation"
>https://github.com/byandrev/automata-simulation</a
>
</p>
<p>
If you have any questions or need further information, feel free to
contact us via
<a
class="underline text-blue-500"
href="https://twitter.com/byandrev"
target="_blank"
>twitter</a
>.
</p>
</div>
</main>
<footer
class="container mx-auto flex justify-between items-end border-t-2 py-8 px-2"
>
<div>
<p>Automata Simulation</p>
<p>
<a
target="_blank"
href="https://ww2.ufps.edu.co"
class="text-blue-500 underline"
>UFPS</a
>
| Computer theory
</p>
</div>
<p>Development with ❤️</p>
</footer>
<div
class="modal micromodal-slide"
id="modal-label-name"
aria-hidden="true"
>
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div
role="dialog"
aria-modal="true"
aria-labelledby="modal-1-title"
class="modal__container relative pt-4"
>
<span
class="absolute top-[2px] left-0 text-xs bg-yellow-300 px-2 rounded-t"
>Label name</span
>
<input
type="text"
id="input-label-name"
class="p-2 rounded border-2"
/>
<!-- <button id="btn-label-name" class="modal__btn modal__btn-primary">
Save
</button> -->
</div>
</div>
</div>
<div
class="modal micromodal-slide"
id="modal-state-name"
aria-hidden="true"
>
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div
role="dialog"
aria-modal="true"
aria-labelledby="modal-1-title"
class="modal__container relative pt-4"
>
<span
class="absolute top-[2px] left-0 text-xs bg-yellow-300 px-2 rounded-t"
>State name</span
>
<input
type="text"
id="input-state-name"
class="p-2 rounded border-2"
/>
<!-- <button id="btn-state-name" class="modal__btn modal__btn-primary">
Save
</button> -->
</div>
</div>
</div>
<script src="src/main.js" type="module"></script>
<script>
function changeSimulator(e) {
const select = document.querySelector("#changeSim");
const currentPath = window.location.pathname;
if (select.value === "Automata-Simulator") {
window.location.href = "/";
} else {
window.location.href = "/turing/";
}
}
</script>
</body>
</html>