-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
640 lines (611 loc) · 41.1 KB
/
index.html
File metadata and controls
640 lines (611 loc) · 41.1 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
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LogoLab - Learn Programming with Turtle Graphics</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🐢</text></svg>">
</head>
<body>
<!-- Skip link for keyboard users -->
<a href="#code-editor" class="skip-link">Skip to code editor</a>
<div id="app">
<!-- Header -->
<header id="header" role="banner">
<div class="header-left">
<h1>LogoLab</h1>
<span class="tagline">Learn Programming with Turtle Graphics</span>
</div>
<nav class="header-right" role="toolbar" aria-label="Main controls">
<label for="speed-select" class="sr-only">Animation Speed</label>
<select id="speed-select" class="speed-select" aria-label="Animation Speed">
<option value="0">Instant</option>
<option value="10">Fast</option>
<option value="50" selected>Medium</option>
<option value="150">Slow</option>
<option value="500">Very Slow</option>
</select>
<button id="btn-run" class="btn btn-primary" title="Run (Ctrl+Enter)" aria-label="Run code (Ctrl+Enter)">
<span class="icon" aria-hidden="true">▶</span> <span>Run</span>
</button>
<button id="btn-step" class="btn btn-warning" title="Run Slowly (F10)" aria-label="Run slowly (F10)">
<span class="icon" aria-hidden="true">→</span> <span>Slow</span>
</button>
<button id="btn-stop" class="btn btn-danger" title="Stop (Escape)" aria-label="Stop execution (Escape)" disabled>
<span class="icon" aria-hidden="true">■</span> <span>Stop</span>
</button>
<button id="btn-clear" class="btn" title="Clear Canvas" aria-label="Clear canvas">
<span class="icon" aria-hidden="true">🗑</span> <span>Clear</span>
</button>
<button id="btn-share" class="btn" title="Share Code" aria-label="Share code">
<span class="icon" aria-hidden="true">🔗</span> <span>Share</span>
</button>
<button id="btn-learn" class="btn btn-learn" title="Interactive Tutorials" aria-label="Open interactive tutorials">
<span class="icon" aria-hidden="true">📚</span> <span>Learn</span>
</button>
<button id="btn-library" class="btn" title="Procedure Library (Ctrl+L)" aria-label="Open procedure library">
<span class="icon" aria-hidden="true">📦</span> <span>Library</span>
</button>
<button id="btn-help" class="btn" title="Help (F1)" aria-label="Open help (F1)">
<span class="icon" aria-hidden="true">?</span> <span>Help</span>
</button>
<button id="btn-theme" class="btn btn-icon" title="Toggle Theme" aria-label="Toggle light/dark theme">
<span class="icon" id="theme-icon" aria-hidden="true">🌙</span>
</button>
<button id="btn-sound" class="btn btn-icon" title="Toggle Sound" aria-label="Toggle sound effects">
<span class="icon" id="sound-icon" aria-hidden="true">🔊</span>
</button>
</nav>
</header>
<!-- Main Content -->
<main id="main">
<!-- Code Editor Panel -->
<div id="editor-panel" class="panel">
<div class="panel-header">
<span>Code Editor</span>
<div class="panel-actions">
<button id="btn-examples" class="btn-small" title="Load Example">Examples</button>
</div>
</div>
<div id="editor-container">
<div id="line-numbers" aria-hidden="true"></div>
<div id="editor-wrapper">
<pre id="syntax-highlight" aria-hidden="true"></pre>
<label for="code-editor" class="sr-only">Logo code editor</label>
<textarea id="code-editor" spellcheck="false" aria-label="Logo code editor" placeholder="Type your Logo code here...
Try: REPEAT 4 [FD 100 RT 90]"></textarea>
</div>
</div>
<!-- Variables Panel (collapsible) -->
<div id="variables-panel" class="variables-panel collapsed">
<div class="panel-header" id="variables-header">
<span>Variables</span>
<button class="btn-small" id="btn-toggle-vars">▼</button>
</div>
<div id="variables-content"></div>
</div>
</div>
<!-- Canvas Panel -->
<div id="canvas-panel" class="panel">
<div class="panel-header">
<span>Canvas</span>
<div class="panel-actions">
<span id="coordinates" class="coordinates">X: 0, Y: 0</span>
<button id="btn-undo" class="btn-small" title="Undo (Ctrl+Z)" aria-label="Undo last action">↶</button>
<button id="btn-redo" class="btn-small" title="Redo (Ctrl+Y)" aria-label="Redo last action">↷</button>
<button id="btn-grid" class="btn-small" title="Toggle Grid" aria-label="Toggle coordinate grid">⊞</button>
<button id="btn-download" class="btn-small" title="Download Image" aria-label="Download canvas as image">📷</button>
<button id="btn-zoom-in" class="btn-small" title="Zoom In" aria-label="Zoom in">+</button>
<button id="btn-zoom-out" class="btn-small" title="Zoom Out" aria-label="Zoom out">−</button>
<button id="btn-reset-view" class="btn-small" title="Reset View" aria-label="Reset view">⌂</button>
</div>
</div>
<div id="canvas-container">
<canvas id="turtle-canvas" role="img" aria-label="Turtle graphics canvas - displays the output of your Logo code"></canvas>
</div>
</div>
</main>
<!-- Output Panel -->
<div id="output-panel" class="panel" role="region" aria-label="Output console">
<div class="panel-header">
<span id="output-label">Output</span>
<div class="panel-actions">
<button id="btn-clear-output" class="btn-small" title="Clear Output" aria-label="Clear output console">Clear</button>
</div>
</div>
<div id="output-console" role="log" aria-live="polite" aria-labelledby="output-label" aria-relevant="additions"></div>
</div>
<!-- Footer -->
<footer id="footer" role="contentinfo">
<div class="footer-left">
<button id="btn-new" class="btn-small" title="New Project" aria-label="Create new project">New</button>
<button id="btn-save" class="btn-small" title="Save Project" aria-label="Save project">Save</button>
<button id="btn-load" class="btn-small" title="Load Project" aria-label="Load project">Load</button>
<input type="file" id="file-input" accept=".logo,.txt" style="display: none;" aria-label="Choose file to load">
</div>
<div class="footer-center">
<a href="https://ko-fi.com/cyborgninja" target="_blank" class="donate-link" title="Support LogoLab" rel="noopener">
☕ Support this project
</a>
</div>
<div class="footer-right">
<span>Inspired by <a href="https://fmslogo.sourceforge.io/" target="_blank" rel="noopener">FMSLogo</a></span>
<span aria-hidden="true">|</span>
<button id="btn-accessibility" class="btn-small" aria-label="View accessibility statement">Accessibility</button>
</div>
</footer>
<!-- Help Modal -->
<div id="help-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="help-modal-title">
<div class="modal-content">
<div class="modal-header">
<h2 id="help-modal-title">LogoLab Command Reference</h2>
<button id="btn-close-help" class="btn-close" aria-label="Close help">×</button>
</div>
<div class="modal-body">
<div class="help-tabs">
<button class="help-tab active" data-tab="movement">Movement</button>
<button class="help-tab" data-tab="pen">Pen</button>
<button class="help-tab" data-tab="control">Control</button>
<button class="help-tab" data-tab="procedures">Procedures</button>
<button class="help-tab" data-tab="math">Math</button>
<button class="help-tab" data-tab="lists">Lists</button>
<button class="help-tab" data-tab="library">Library</button>
</div>
<div class="help-content">
<div id="help-movement" class="help-section active">
<h3>Turtle Movement</h3>
<table>
<tr><td><code>FORWARD n</code> / <code>FD n</code></td><td>Move forward n steps</td></tr>
<tr><td><code>BACK n</code> / <code>BK n</code></td><td>Move backward n steps</td></tr>
<tr><td><code>LEFT n</code> / <code>LT n</code></td><td>Turn left n degrees</td></tr>
<tr><td><code>RIGHT n</code> / <code>RT n</code></td><td>Turn right n degrees</td></tr>
<tr><td><code>HOME</code></td><td>Return to center, facing up</td></tr>
<tr><td><code>SETPOS [x y]</code></td><td>Move to position [x, y]</td></tr>
<tr><td><code>SETX n</code></td><td>Set X coordinate</td></tr>
<tr><td><code>SETY n</code></td><td>Set Y coordinate</td></tr>
<tr><td><code>SETHEADING n</code> / <code>SETH n</code></td><td>Set heading (0=up, 90=right)</td></tr>
<tr><td><code>XCOR</code></td><td>Returns current X coordinate</td></tr>
<tr><td><code>YCOR</code></td><td>Returns current Y coordinate</td></tr>
<tr><td><code>HEADING</code></td><td>Returns current heading</td></tr>
<tr><td><code>POS</code></td><td>Returns current position [x y]</td></tr>
<tr><td><code>TOWARDS [x y]</code></td><td>Returns angle from turtle to point</td></tr>
<tr><td><code>DISTANCE [x y]</code></td><td>Returns distance from turtle to point</td></tr>
</table>
</div>
<div id="help-pen" class="help-section">
<h3>Pen Commands</h3>
<table>
<tr><td><code>PENUP</code> / <code>PU</code></td><td>Lift pen (stop drawing)</td></tr>
<tr><td><code>PENDOWN</code> / <code>PD</code></td><td>Lower pen (start drawing)</td></tr>
<tr><td><code>SETPENCOLOR color</code> / <code>SETPC color</code></td><td>Set pen color (name or [r g b])</td></tr>
<tr><td><code>SETPENSIZE n</code></td><td>Set pen width</td></tr>
<tr><td><code>PENERASE</code> / <code>PE</code></td><td>Pen erases instead of draws</td></tr>
<tr><td><code>PENPAINT</code> / <code>PPT</code></td><td>Pen draws normally</td></tr>
<tr><td><code>SETBACKGROUND color</code> / <code>SETBG color</code></td><td>Set background color</td></tr>
<tr><td><code>PENCOLOR</code> / <code>PC</code></td><td>Returns current pen color</td></tr>
<tr><td><code>PENSIZE</code></td><td>Returns current pen size</td></tr>
</table>
<h4>Colors</h4>
<p>Use color names: <code>red</code>, <code>blue</code>, <code>green</code>, <code>yellow</code>, <code>orange</code>, <code>purple</code>, <code>black</code>, <code>white</code>, <code>cyan</code>, <code>magenta</code>, <code>pink</code>, <code>brown</code>, <code>gray</code></p>
<p>Or RGB values: <code>[255 0 0]</code> for red</p>
<h4>Shape Commands</h4>
<table>
<tr><td><code>CIRCLE radius</code></td><td>Draw a circle at turtle's position</td></tr>
<tr><td><code>ARC angle radius</code></td><td>Draw an arc and move turtle along it</td></tr>
<tr><td><code>FILLED [...]</code></td><td>Fill the shape drawn inside brackets</td></tr>
</table>
</div>
<div id="help-control" class="help-section">
<h3>Control Structures</h3>
<table>
<tr><td><code>REPEAT n [...]</code></td><td>Repeat commands n times</td></tr>
<tr><td><code>IF cond [...]</code></td><td>Execute if condition is true</td></tr>
<tr><td><code>IFELSE cond [...] [...]</code></td><td>If-else statement</td></tr>
<tr><td><code>FOR [var start end] [...]</code></td><td>For loop (step=1)</td></tr>
<tr><td><code>FOR [var start end step] [...]</code></td><td>For loop with step</td></tr>
<tr><td><code>WHILE [cond] [...]</code></td><td>While loop</td></tr>
<tr><td><code>STOP</code></td><td>Exit current procedure</td></tr>
<tr><td><code>WAIT n</code></td><td>Pause for n milliseconds</td></tr>
</table>
<h4>Screen Commands</h4>
<table>
<tr><td><code>CLEARSCREEN</code> / <code>CS</code></td><td>Clear screen and reset turtle</td></tr>
<tr><td><code>CLEAN</code></td><td>Clear screen, keep turtle position</td></tr>
<tr><td><code>HIDETURTLE</code> / <code>HT</code></td><td>Hide the turtle</td></tr>
<tr><td><code>SHOWTURTLE</code> / <code>ST</code></td><td>Show the turtle</td></tr>
<tr><td><code>WRAP</code></td><td>Turtle wraps around edges</td></tr>
<tr><td><code>WINDOW</code></td><td>Turtle can go beyond edges</td></tr>
<tr><td><code>FENCE</code></td><td>Turtle stops at edges</td></tr>
</table>
</div>
<div id="help-procedures" class="help-section">
<h3>Procedures & Variables</h3>
<h4>Defining Procedures</h4>
<pre>TO SQUARE :size
REPEAT 4 [FD :size RT 90]
END
SQUARE 100</pre>
<h4>Variables</h4>
<table>
<tr><td><code>MAKE "name value</code></td><td>Create/set variable</td></tr>
<tr><td><code>:name</code></td><td>Get variable value</td></tr>
<tr><td><code>LOCAL "name</code></td><td>Create local variable</td></tr>
<tr><td><code>THING "name</code></td><td>Get variable value (alternative)</td></tr>
</table>
<h4>Procedures with Output</h4>
<pre>TO DOUBLE :n
OUTPUT :n * 2
END
PRINT DOUBLE 5 ; prints 10</pre>
<h4>Multiple Turtles</h4>
<table>
<tr><td><code>TELL n</code></td><td>Select turtle n (creates if needed)</td></tr>
<tr><td><code>ASK n [...]</code></td><td>Run commands with turtle n</td></tr>
<tr><td><code>WHO</code></td><td>Returns current turtle number</td></tr>
<tr><td><code>TURTLES</code></td><td>Returns list of all turtle numbers</td></tr>
</table>
</div>
<div id="help-math" class="help-section">
<h3>Math & Logic</h3>
<h4>Arithmetic</h4>
<table>
<tr><td><code>+ - * /</code></td><td>Basic operations</td></tr>
<tr><td><code>REMAINDER a b</code></td><td>Modulo (a % b)</td></tr>
<tr><td><code>POWER a b</code></td><td>Exponentiation (a^b)</td></tr>
<tr><td><code>SQRT n</code></td><td>Square root</td></tr>
<tr><td><code>ABS n</code></td><td>Absolute value</td></tr>
<tr><td><code>INT n</code></td><td>Integer part</td></tr>
<tr><td><code>ROUND n</code></td><td>Round to nearest integer</td></tr>
<tr><td><code>RANDOM n</code></td><td>Random integer 0 to n-1</td></tr>
<tr><td><code>MIN a b</code></td><td>Smaller of two numbers</td></tr>
<tr><td><code>MAX a b</code></td><td>Larger of two numbers</td></tr>
<tr><td><code>SIGN n</code></td><td>Returns -1, 0, or 1</td></tr>
<tr><td><code>EXP n</code></td><td>e raised to power n</td></tr>
<tr><td><code>LOG n</code> / <code>LN n</code></td><td>Natural logarithm</td></tr>
<tr><td><code>LOG10 n</code></td><td>Base-10 logarithm</td></tr>
</table>
<h4>Trigonometry</h4>
<table>
<tr><td><code>SIN n</code></td><td>Sine (degrees)</td></tr>
<tr><td><code>COS n</code></td><td>Cosine (degrees)</td></tr>
<tr><td><code>TAN n</code></td><td>Tangent (degrees)</td></tr>
<tr><td><code>ARCTAN n</code></td><td>Arc tangent (returns degrees)</td></tr>
</table>
<h4>Comparison & Logic</h4>
<table>
<tr><td><code>= < > <= >= <></code></td><td>Comparison operators</td></tr>
<tr><td><code>AND a b</code></td><td>Logical AND</td></tr>
<tr><td><code>OR a b</code></td><td>Logical OR</td></tr>
<tr><td><code>NOT a</code></td><td>Logical NOT</td></tr>
</table>
<h4>Output</h4>
<table>
<tr><td><code>PRINT value</code></td><td>Print to output</td></tr>
<tr><td><code>SHOW value</code></td><td>Print with brackets for lists</td></tr>
<tr><td><code>TYPE value</code></td><td>Print without newline</td></tr>
</table>
<h4>Strings</h4>
<table>
<tr><td><code>WORD a b</code></td><td>Combine two words into one</td></tr>
<tr><td><code>CHAR n</code></td><td>Character for ASCII code n</td></tr>
<tr><td><code>ASCII word</code></td><td>ASCII code for first character</td></tr>
<tr><td><code>UPPERCASE word</code></td><td>Convert to uppercase</td></tr>
<tr><td><code>LOWERCASE word</code></td><td>Convert to lowercase</td></tr>
</table>
<h4>User Input</h4>
<table>
<tr><td><code>READWORD</code></td><td>Prompt user for a word</td></tr>
<tr><td><code>READLIST</code></td><td>Prompt user for a list</td></tr>
</table>
</div>
<div id="help-lists" class="help-section">
<h3>Lists</h3>
<h4>Creating Lists</h4>
<table>
<tr><td><code>[a b c]</code></td><td>List literal</td></tr>
<tr><td><code>LIST a b</code></td><td>Create list from items</td></tr>
<tr><td><code>SENTENCE a b</code> / <code>SE a b</code></td><td>Combine into flat list</td></tr>
<tr><td><code>FPUT item list</code></td><td>Add item to front</td></tr>
<tr><td><code>LPUT item list</code></td><td>Add item to back</td></tr>
</table>
<h4>Accessing Lists</h4>
<table>
<tr><td><code>FIRST list</code></td><td>First item</td></tr>
<tr><td><code>LAST list</code></td><td>Last item</td></tr>
<tr><td><code>BUTFIRST list</code> / <code>BF list</code></td><td>All but first</td></tr>
<tr><td><code>BUTLAST list</code> / <code>BL list</code></td><td>All but last</td></tr>
<tr><td><code>ITEM n list</code></td><td>Get nth item (1-indexed)</td></tr>
<tr><td><code>COUNT list</code></td><td>Number of items</td></tr>
<tr><td><code>REVERSE list</code></td><td>Reverse list or word</td></tr>
</table>
<h4>Testing Lists</h4>
<table>
<tr><td><code>EMPTY? list</code></td><td>True if list is empty</td></tr>
<tr><td><code>LIST? value</code></td><td>True if value is a list</td></tr>
<tr><td><code>NUMBER? value</code></td><td>True if value is a number</td></tr>
<tr><td><code>WORD? value</code></td><td>True if value is a word</td></tr>
<tr><td><code>MEMBER? item list</code></td><td>True if item is in list</td></tr>
</table>
</div>
<div id="help-library" class="help-section">
<h3>Procedure Library</h3>
<p>The Library stores reusable procedures you can add to your code. Save time by reusing common shapes and patterns!</p>
<h4>How to Open the Library</h4>
<p>Click the <strong>📦 Library</strong> button in the toolbar, or press <strong>Ctrl+L</strong></p>
<h4>Using a Library Procedure (Step by Step)</h4>
<ol>
<li>Open the Library (📦 button)</li>
<li>Find a procedure you want (e.g., SQUARE)</li>
<li>Click the <strong>Insert</strong> button</li>
<li><strong>Important:</strong> The procedure code is now in your editor, but you need to <em>call it</em> to see something!</li>
</ol>
<h4>Example: Using SQUARE from the Library</h4>
<pre>; After clicking "Insert" on SQUARE, your editor has:
TO SQUARE :size
REPEAT 4 [FD :size RT 90]
END
; Now add this line below to actually DRAW:
SQUARE 100</pre>
<p><strong>Key point:</strong> Inserting adds the <em>definition</em>. You must <em>call</em> the procedure by name to draw!</p>
<h4>More Examples After Inserting</h4>
<pre>; Draw multiple squares in a row
SQUARE 30
RT 90 FD 50
SQUARE 50
RT 90 FD 70
SQUARE 70
; Make a pattern with SQUARE
REPEAT 4 [SQUARE 60 RT 90]
; Use POLYGON (needs 2 inputs: sides and size)
POLYGON 5 80 ; draws a pentagon
POLYGON 6 60 ; draws a hexagon
; Colorful flowers using FLOWER
SETPC "red
FLOWER 6 40
PU RT 90 FD 100 PD
SETPC "blue
FLOWER 8 30</pre>
<h4>Saving Your Own Procedures</h4>
<ol>
<li>Write your procedure using <code>TO ... END</code></li>
<li>Open the Library</li>
<li>Click <strong>Save Current Procedures to Library</strong></li>
<li>Your procedure appears in "My Procedures"!</li>
</ol>
<h4>Library Categories</h4>
<table>
<tr><td><strong>All</strong></td><td>Shows all available procedures</td></tr>
<tr><td><strong>Shapes</strong></td><td>SQUARE, TRIANGLE, POLYGON, STAR, HEXAGON</td></tr>
<tr><td><strong>Patterns</strong></td><td>SPIRAL, SQUIRAL, FLOWER, TREE</td></tr>
<tr><td><strong>Colors</strong></td><td>RANDOMCOLOR, RAINBOW</td></tr>
<tr><td><strong>My Procedures</strong></td><td>Procedures you have saved</td></tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Examples Modal -->
<div id="examples-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="examples-modal-title">
<div class="modal-content">
<div class="modal-header">
<h2 id="examples-modal-title">Example Programs</h2>
<button id="btn-close-examples" class="btn-close" aria-label="Close examples">×</button>
</div>
<div class="modal-body">
<div class="examples-list" role="list">
<div class="example-item" data-example="triangle" role="button" tabindex="0" aria-label="Load Triangle example - Beginner">
<span class="difficulty-badge beginner">Beginner</span>
<h4>Triangle</h4>
<p>Draw a simple triangle</p>
</div>
<div class="example-item" data-example="square" role="button" tabindex="0" aria-label="Load Square example - Beginner">
<span class="difficulty-badge beginner">Beginner</span>
<h4>Square</h4>
<p>Draw a simple square</p>
</div>
<div class="example-item" data-example="house" role="button" tabindex="0" aria-label="Load House example - Beginner">
<span class="difficulty-badge beginner">Beginner</span>
<h4>House</h4>
<p>Draw a house with a roof</p>
</div>
<div class="example-item" data-example="star" role="button" tabindex="0" aria-label="Load Star example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Star</h4>
<p>Draw a 5-pointed star</p>
</div>
<div class="example-item" data-example="smiley" role="button" tabindex="0" aria-label="Load Smiley Face example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Smiley Face</h4>
<p>Draw a smiley using CIRCLE and ARC</p>
</div>
<div class="example-item" data-example="flower" role="button" tabindex="0" aria-label="Load Flower example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Flower</h4>
<p>Draw a flower pattern</p>
</div>
<div class="example-item" data-example="rainbow" role="button" tabindex="0" aria-label="Load Rainbow example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Rainbow</h4>
<p>Draw a colorful rainbow</p>
</div>
<div class="example-item" data-example="polygon" role="button" tabindex="0" aria-label="Load Polygon Procedure example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Polygon Procedure</h4>
<p>Define and use a polygon procedure</p>
</div>
<div class="example-item" data-example="spiral" role="button" tabindex="0" aria-label="Load Spiral example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Spiral</h4>
<p>Draw a recursive spiral</p>
</div>
<div class="example-item" data-example="tree" role="button" tabindex="0" aria-label="Load Recursive Tree example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Recursive Tree</h4>
<p>Draw a fractal tree</p>
</div>
<div class="example-item" data-example="sierpinski" role="button" tabindex="0" aria-label="Load Sierpinski Triangle example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Sierpinski Triangle</h4>
<p>Draw a fractal triangle</p>
</div>
<div class="example-item" data-example="chase" role="button" tabindex="0" aria-label="Load Chase Point example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Chase Point</h4>
<p>Uses TOWARDS and DISTANCE to chase a target</p>
</div>
<div class="example-item" data-example="interactive" role="button" tabindex="0" aria-label="Load Interactive Art example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Interactive Art</h4>
<p>Uses READWORD for user input</p>
</div>
<div class="example-item" data-example="randomart" role="button" tabindex="0" aria-label="Load Random Art example - Intermediate">
<span class="difficulty-badge intermediate">Intermediate</span>
<h4>Random Color Art</h4>
<p>Uses RANDOM and list operations</p>
</div>
<div class="example-item" data-example="mirror" role="button" tabindex="0" aria-label="Load Mirror Text example - Advanced">
<span class="difficulty-badge advanced">Advanced</span>
<h4>Mirror Text</h4>
<p>Uses REVERSE to mirror words</p>
</div>
</div>
</div>
</div>
</div>
<!-- Tutorials Modal -->
<div id="tutorials-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="tutorials-modal-title">
<div class="modal-content modal-large">
<div class="modal-header">
<h2 id="tutorials-modal-title">Learn Logo Programming</h2>
<div class="tutorial-progress">
<span id="progress-text">0/6 complete</span>
<div class="progress-bar">
<div class="progress-fill" id="progress-fill" style="width: 0%"></div>
</div>
</div>
<button id="btn-close-tutorials" class="btn-close" aria-label="Close tutorials">×</button>
</div>
<div class="modal-body tutorials-body">
<nav class="tutorials-sidebar" role="tablist" aria-label="Tutorial lessons">
<div class="tutorial-item active" data-lesson="1" role="tab" tabindex="0" aria-selected="true" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">1</span>
<span>Moving the Turtle</span>
</div>
<div class="tutorial-item" data-lesson="2" role="tab" tabindex="0" aria-selected="false" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">2</span>
<span>Drawing Shapes</span>
</div>
<div class="tutorial-item" data-lesson="3" role="tab" tabindex="0" aria-selected="false" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">3</span>
<span>Colors & Pen</span>
</div>
<div class="tutorial-item" data-lesson="4" role="tab" tabindex="0" aria-selected="false" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">4</span>
<span>Loops with REPEAT</span>
</div>
<div class="tutorial-item" data-lesson="5" role="tab" tabindex="0" aria-selected="false" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">5</span>
<span>Creating Procedures</span>
</div>
<div class="tutorial-item" data-lesson="6" role="tab" tabindex="0" aria-selected="false" aria-controls="tutorial-content">
<span class="lesson-num" aria-hidden="true">6</span>
<span>Variables</span>
</div>
</nav>
<div class="tutorials-content" id="tutorial-content" role="tabpanel" aria-label="Tutorial content">
<!-- Content loaded dynamically -->
</div>
</div>
</div>
</div>
<!-- Library Modal -->
<div id="library-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="library-modal-title">
<div class="modal-content modal-large">
<div class="modal-header">
<h2 id="library-modal-title">Procedure Library</h2>
<button id="btn-close-library" class="btn-close" aria-label="Close library">×</button>
</div>
<div class="modal-body library-body">
<div class="library-sidebar">
<input type="text" id="library-search" class="library-search" placeholder="Search procedures..." aria-label="Search procedures">
<div class="library-categories" role="tablist" aria-label="Procedure categories">
<button class="category-btn active" data-cat="all" role="tab" aria-selected="true">All</button>
<button class="category-btn" data-cat="shapes" role="tab" aria-selected="false">Shapes</button>
<button class="category-btn" data-cat="patterns" role="tab" aria-selected="false">Patterns</button>
<button class="category-btn" data-cat="colors" role="tab" aria-selected="false">Colors</button>
<button class="category-btn" data-cat="my" role="tab" aria-selected="false">My Procedures</button>
</div>
</div>
<div class="library-content">
<div class="library-grid" id="library-grid" role="list">
<!-- Procedure cards rendered dynamically -->
</div>
</div>
</div>
<div class="modal-footer">
<button id="btn-save-to-library" class="btn btn-primary">
<span class="icon" aria-hidden="true">💾</span> Save Current Procedures to Library
</button>
</div>
</div>
</div>
<!-- Share Modal -->
<div id="share-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="share-modal-title">
<div class="modal-content modal-small">
<div class="modal-header">
<h2 id="share-modal-title">Share Your Code</h2>
<button id="btn-close-share" class="btn-close" aria-label="Close share dialog">×</button>
</div>
<div class="modal-body">
<p>Share this link with others:</p>
<div class="share-url-container">
<input type="text" id="share-url" readonly>
<button id="btn-copy-url" class="btn btn-primary">Copy</button>
</div>
<p class="share-note">Anyone with this link can view and edit your code.</p>
</div>
</div>
</div>
<!-- Accessibility Statement Modal -->
<div id="accessibility-modal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="accessibility-modal-title">
<div class="modal-content modal-small">
<div class="modal-header">
<h2 id="accessibility-modal-title">Accessibility Statement</h2>
<button id="btn-close-accessibility" class="btn-close" aria-label="Close accessibility statement">×</button>
</div>
<div class="modal-body">
<h3>Commitment to Accessibility</h3>
<p>LogoLab is committed to ensuring digital accessibility for all users, including those with disabilities. We strive to comply with <strong>WCAG 2.1 Level AA</strong> guidelines and the <strong>European Accessibility Act (EAA)</strong>.</p>
<h4>Accessibility Features</h4>
<ul>
<li>Full keyboard navigation support</li>
<li>Screen reader compatible interface</li>
<li>High contrast focus indicators</li>
<li>Reduced motion support for users with vestibular disorders</li>
<li>Skip link to bypass navigation</li>
<li>ARIA labels for all interactive elements</li>
<li>Light and dark theme options</li>
</ul>
<h4>Known Limitations</h4>
<ul>
<li>Canvas drawings are visual and cannot be fully described to screen reader users</li>
<li>Some third-party code examples may not be accessible</li>
</ul>
<h4>Feedback</h4>
<p>If you encounter accessibility barriers or have suggestions for improvement, please <a href="https://github.com/mkdelta221/LogoLab/issues" target="_blank" rel="noopener">open an issue on GitHub</a>.</p>
<p class="share-note"><em>Last updated: January 2026</em></p>
</div>
</div>
</div>
</div>
<script src="js/lzstring.min.js"></script>
<script src="js/interpreter.js"></script>
<script src="js/turtle.js"></script>
<script src="js/editor.js"></script>
<script src="js/storage.js"></script>
<script src="js/tutorials.js"></script>
<script src="js/app.js"></script>
</body>
</html>