11
11
href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css "
12
12
integrity ="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA== "
13
13
crossorigin ="anonymous "
14
- referrerpolicy ="no-referrer "
15
- />
14
+ referrerpolicy ="no-referrer " />
16
15
17
16
< link
18
17
rel ="stylesheet "
19
18
href ="https://cdnjs.cloudflare.com/ajax/libs/jointjs/3.7.5/joint.min.css "
20
19
integrity ="sha512-GyvR5jC0OnZNT+eb5PR1OaRq4uSlkE+SrHK/T3DfKyUboA191W3aUiuCrErwtZuVdPMVu/Me595KD+rxXSe19w== "
21
20
crossorigin ="anonymous "
22
- referrerpolicy ="no-referrer "
23
- />
21
+ referrerpolicy ="no-referrer " />
24
22
< script
25
23
src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js "
26
24
integrity ="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g== "
27
25
crossorigin ="anonymous "
28
- referrerpolicy ="no-referrer "
29
- > </ script >
26
+ referrerpolicy ="no-referrer "> </ script >
30
27
< script
31
28
src ="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js "
32
29
integrity ="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ== "
33
30
crossorigin ="anonymous "
34
- referrerpolicy ="no-referrer "
35
- > </ script >
31
+ referrerpolicy ="no-referrer "> </ script >
36
32
< script
37
33
src ="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.5.0/backbone-min.js "
38
34
integrity ="sha512-NAJF/IIdtSJ5JxYalGv+g0xbnbHJTa0W24Gy21nImt+sBkjRWTOhoo+JAQvCw9A9WzCJmq/JVuijggiOkrdW1Q== "
39
35
crossorigin ="anonymous "
40
- referrerpolicy ="no-referrer "
41
- > </ script >
36
+ referrerpolicy ="no-referrer "> </ script >
42
37
< script
43
38
src ="https://cdnjs.cloudflare.com/ajax/libs/jointjs/3.7.5/joint.min.js "
44
39
integrity ="sha512-pSAAtQw8Sz/OO4m9e2rLqIUe8pZVng7giqZgoBnFTkl3ovJJ6WHHxNgIY+q607xg3CHhWdZKih7oVofY5ENdxQ== "
45
40
crossorigin ="anonymous "
46
- referrerpolicy ="no-referrer "
47
- > </ script >
41
+ referrerpolicy ="no-referrer "> </ script >
48
42
</ head >
49
43
< body class ="min-h-[100vh] ">
50
44
< div class ="border-b-[2px] ">
@@ -65,34 +59,38 @@ <h1 class="select-none">Automata Simulation</h1>
65
59
< div
66
60
class ="element bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs "
67
61
draggable ="true "
68
- title ="State "
69
- >
62
+ title ="State ">
70
63
q
71
64
</ div >
72
65
73
66
< div
74
67
class ="element bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs "
75
68
draggable ="true "
76
- title ="Final State "
77
- >
69
+ title ="Final State ">
78
70
qf
79
71
</ div >
80
72
81
73
< div
82
74
class ="bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs "
83
75
title ="Clear all "
84
- id ="btn-clear-all "
85
- >
76
+ id ="btn-clear-all ">
86
77
< i class ="fa-solid fa-trash-can text-[10px] "> </ i >
87
78
</ div >
88
79
89
80
< div
90
81
class ="bg-white cursor-pointer select-none rounded-full border-2 w-8 h-8 text-center leading-6 text-xs "
91
82
title ="Download "
92
- id ="btn-download "
93
- >
83
+ id ="btn-download ">
94
84
< i class ="fa-solid fa-cloud-arrow-down text-[10px] "> </ i >
95
85
</ div >
86
+
87
+ < select
88
+ class ="change-simulator "
89
+ id ="changeSim "
90
+ onchange ="changeSimulator() ">
91
+ < option value ="Automata-Simulator "> AFD Simulator</ option >
92
+ < option value ="Turing-Machine-Simulator "> TM Simulator</ option >
93
+ </ select >
96
94
</ div >
97
95
98
96
< div class ="flex items-center gap-4 ">
@@ -102,8 +100,7 @@ <h1 class="select-none">Automata Simulation</h1>
102
100
< a
103
101
target ="_blank "
104
102
href ="https://github.com/byandrev/automata-simulation "
105
- class ="bg-gray-600 shadow text-white flex items-center gap-2 rounded px-2 py-1 "
106
- >
103
+ class ="bg-gray-600 shadow text-white flex items-center gap-2 rounded px-2 py-1 ">
107
104
< span class ="text-xs block "> Open Source</ span >
108
105
< i class ="fa-brands fa-github "> </ i
109
106
> </ a >
@@ -120,13 +117,11 @@ <h1 class="select-none">Automata Simulation</h1>
120
117
type ="text "
121
118
id ="input-string "
122
119
placeholder ="String "
123
- class ="w-full px-1 h-8 text-xs rounded border-2 border-slate-200 bg-slate-100 "
124
- />
120
+ class ="w-full px-1 h-8 text-xs rounded border-2 border-slate-200 bg-slate-100 " />
125
121
126
122
< button
127
123
id ="run "
128
- 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 "
129
- >
124
+ 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 ">
130
125
< i class ="fa-solid fa-play "> </ i >
131
126
Run
132
127
</ button >
@@ -164,8 +159,7 @@ <h2 class="text-2xl font-bold mb-2">About</h2>
164
159
autoplay ="true "
165
160
src ="/example-use.mp4 "
166
161
class ="border-2 rounded "
167
- alt ="create, modify, and simulate automata "
168
- > </ video >
162
+ alt ="create, modify, and simulate automata "> </ video >
169
163
170
164
< p class ="text-center text-sm font-bold underline ">
171
165
Rename states and transitions with double click
@@ -183,8 +177,8 @@ <h2 class="text-2xl font-bold mb-2">ToDo</h2>
183
177
< i class ="fa-regular fa-square-check "> </ i > Generate transition table
184
178
</ li >
185
179
< li >
186
- < i class ="fa-regular fa-square-check "> </ i > Generate automata from the
187
- transition table and viceversa
180
+ < i class ="fa-regular fa-square-check "> </ i > Generate automata from
181
+ the transition table and viceversa
188
182
</ li >
189
183
< li > < i class ="fa-regular fa-square-check "> </ i > Run step by step</ li >
190
184
< li >
@@ -261,8 +255,7 @@ <h3 class="text-2xl font-bold mb-2">Collaborate</h3>
261
255
</ main >
262
256
263
257
< footer
264
- class ="container mx-auto flex justify-between items-end border-t-2 py-8 px-2 "
265
- >
258
+ class ="container mx-auto flex justify-between items-end border-t-2 py-8 px-2 ">
266
259
< div >
267
260
< p > Automata Simulation</ p >
268
261
< p >
@@ -276,32 +269,27 @@ <h3 class="text-2xl font-bold mb-2">Collaborate</h3>
276
269
</ p >
277
270
</ div >
278
271
279
- < p >
280
- Development with ❤️
281
- </ p >
272
+ < p > Development with ❤️</ p >
282
273
</ footer >
283
274
284
275
< div
285
276
class ="modal micromodal-slide "
286
277
id ="modal-label-name "
287
- aria-hidden ="true "
288
- >
278
+ aria-hidden ="true ">
289
279
< div class ="modal__overlay " tabindex ="-1 " data-micromodal-close >
290
280
< div
291
281
role ="dialog "
292
282
aria-modal ="true "
293
283
aria-labelledby ="modal-1-title "
294
- class ="modal__container relative pt-4 "
295
- >
284
+ class ="modal__container relative pt-4 ">
296
285
< span
297
286
class ="absolute top-[2px] left-0 text-xs bg-yellow-300 px-2 rounded-t "
298
287
> Label name</ span
299
288
>
300
289
< input
301
290
type ="text "
302
291
id ="input-label-name "
303
- class ="p-2 rounded border-2 "
304
- />
292
+ class ="p-2 rounded border-2 " />
305
293
<!-- <button id="btn-label-name" class="modal__btn modal__btn-primary">
306
294
Save
307
295
</button> -->
@@ -312,31 +300,46 @@ <h3 class="text-2xl font-bold mb-2">Collaborate</h3>
312
300
< div
313
301
class ="modal micromodal-slide "
314
302
id ="modal-state-name "
315
- aria-hidden ="true "
316
- >
303
+ aria-hidden ="true ">
317
304
< div class ="modal__overlay " tabindex ="-1 " data-micromodal-close >
318
305
< div
319
306
role ="dialog "
320
307
aria-modal ="true "
321
308
aria-labelledby ="modal-1-title "
322
- class ="modal__container relative pt-4 "
323
- >
309
+ class ="modal__container relative pt-4 ">
324
310
< span
325
311
class ="absolute top-[2px] left-0 text-xs bg-yellow-300 px-2 rounded-t "
326
312
> State name</ span
327
313
>
328
314
< input
329
315
type ="text "
330
316
id ="input-state-name "
331
- class ="p-2 rounded border-2 "
332
- />
317
+ class ="p-2 rounded border-2 " />
333
318
<!-- <button id="btn-state-name" class="modal__btn modal__btn-primary">
334
319
Save
335
320
</button> -->
336
321
</ div >
337
322
</ div >
338
323
</ div >
324
+ < script >
325
+ // Load Turing Machine Simulator
326
+ function changeSimulator ( ) {
327
+ var select = document . getElementById ( "changeSim" ) ;
328
+ if ( select ) {
329
+ var options = select . options [ select . selectedIndex ] . value ;
330
+ if ( options === "Automata-Simulator" ) {
331
+ console . log ( "xd1" ) ;
332
+
333
+ }
334
+ else if ( options === "Turing-Machine-Simulator" ) {
335
+ console . log ( "xd2" ) ;
339
336
337
+ }
338
+ } else {
339
+ console . error ( "Element not found" ) ;
340
+ }
341
+ }
342
+ </ script >
340
343
< script src ="src/main.js " type ="module "> </ script >
341
344
</ body >
342
345
</ html >
0 commit comments