-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
699 lines (651 loc) · 44.2 KB
/
index.html
File metadata and controls
699 lines (651 loc) · 44.2 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
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<!--
WebChucK IDE, written by Terry Feng
Date: Spring 2023
Special thanks to: Celeste Betancur, Mike Mulshine, Jack Atherton, Chris Chafe, and Ge Wang
-->
<!DOCTYPE html>
<html lang="en" data-banner-version="1">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-C31LKZFZ45"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-C31LKZFZ45');
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- TITLE -->
<title>WebChucK IDE</title>
<meta property="og:description"
content="A web-based integrated development environment (IDE) for ChucK, a programming language for real-time sound synthesis and music creation! It's fun and easy to learn, and offers composers, researchers, and performers a powerful and accessible programming tool for building, experimenting, and sharing complex audio synthesis/analysis programs and real-time interactive music.">
<meta property="og:title" content="WebChucK IDE" />
<meta property="og:url" content="https://chuck.stanford.edu/ide/" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://ccrma.stanford.edu/~tzfeng/webchuck-ide/img/webchuck-ide.jpg" />
<meta property="fb:app_id" content="966242223397117" /> <!--default app id-->
<meta name="keywords"
content="ChucK, WebChucK, IDE, CCRMA, Stanford University, Princeton University, computer music, programming language">
<!-- FAVICON -->
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_io/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_io/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_io/favicon-16x16.png">
<link rel="manifest" href="./favicon_io/site.webmanifest">
<link rel="stylesheet" href="./src/styles/index.css" />
<script>
// Set color theme
if (localStorage.theme === "dark") {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
// Set notification banner
if (localStorage.getItem("hideNotificationBanner") === document.documentElement.getAttribute("data-banner-version")) {
document.documentElement.classList.add("hide-notification-banner");
}
</script>
</head>
<body class="h-full w-full">
<!-- WEBCHUCK IDE -->
<div id="webchuck-ide" class="grid w-full h-screen bg-sky-blue dark:bg-dark
text-base text-dark dark:text-light">
<!-- Skip to main content (accessibility) -->
<a href="#monacoEditor" class="sr-only focus:not-sr-only focus:absolute focus:z-[99999] focus:bg-orange focus:text-white focus:px-4 focus:py-2 focus:rounded-md">Skip to editor</a>
<!-- Notification Banner -->
<section id="notificationBanner" aria-label="Notification Banner" class="hidden sm:flex h-8 bg-blue-600 text-white items-center justify-center relative font-semibold text-sm w-full">
<a id="notificationLink" href="https://ccrma.stanford.edu/~hoangben/webchuck-ide/" target="_blank" class="hover:underline">
<div id="notificationText">(Beta) Try out WebChucK IDE with ChuGL for audiovisual programming!</div>
</a>
<button id="closeNotificationBanner" class="absolute right-4 hover:opacity-80 cursor-pointer" aria-label="Close notification banner">X</button>
</section>
<!-- NAVBAR -->
<header id="navbarWrapper" class="w-full relative">
<h1 class="sr-only">WebChucK IDE</h1>
<nav id="navbar" class="flex h-full items-center justify-between md:px-2 px-4 overflow-x-auto">
<!-- Left -->
<div class="flex justify-left items-center">
<!-- ChucK Logo -->
<a href="https://chuck.stanford.edu" class="w-10 md:w-8" target="_blank" rel="noopener noreferrer" aria-label="Visit ChucK website (opens in new tab)">
<img src="img/ChonK.svg" class="h-10 md:h-8" alt="ChucK Logo" />
</a>
<!-- Nav Items -->
<div id="menuItems" class="text-dark dark:text-gray-300 w-full px-2 flex items-center">
<!-- File -->
<div id="fileContainer" class="inline-block">
<button id="fileButton" type="button" data-dropdown-toggle="dropdownNavbar" class="dropdownButton">
File
<svg class="w-2.5 h-2.5 ml-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="fileDropdown" class="hidden dropdown w-40">
<ul class="py-2 text-base text-gray-700 dark:text-light" aria-labelledby="fileButton" role="menu">
<li role="separator">
<button id="newFile" type="button" class="dropdownItem" role="menuitem">
New
</button>
</li>
<li role="separator">
<input id="fileUploader" type="file" multiple hidden aria-label="Upload files" />
<button id="uploadFiles" type="button" class="dropdownItem disabled:opacity-50" role="menuitem" disabled>
Upload Files
</button>
</li>
<li role="separator">
<button id="newProject" type="button" class="dropdownItem" role="menuitem">
New Project
</button>
</li>
<li id="exportToContainer" class="relative" role="separator">
<button id="exportToButton" type="button" class="dropdownItem nestedDropdownButton" role="menuitem">
Export to
<svg class="w-2.5 h-2.5 ml-3 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
<path stroke="currentColor" stroke-linecap="" stroke-linejoin="round" stroke-width="1.5" d="m1 9 4-4-4-4"/>
</svg>
</button>
<div id="exportToDropdown" class="nestedDropdown w-36 hidden">
<ul class="py-2 text-base text-gray-700 dark:text-gray-200" role="menu" aria-labelledby="exportToButton">
<li role="separator">
<button id="exportChuck" type="button" class="dropdownItem" role="menuitem">
ChucK
</button>
</li>
<li role="separator">
<button id="exportWebchuck" type="button" class="dropdownItem" role="menuitem">
WebChucK
</button>
</li>
</ul>
</div>
</li>
<li role="separator">
<button id="openSettings" type="button" class="dropdownItem" role="menuitem">
Settings
</button>
</li>
</ul>
</div>
</div>
<!-- Edit -->
<div id="editContainer" class="inline-block">
<button id="editButton" type="button" data-dropdown-toggle="dropdownNavbar" class="dropdownButton">
Edit
<svg class="w-2.5 h-2.5 ml-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="editDropdown" class="hidden dropdown w-40">
<ul class="py-2 text-base text-gray-700 dark:text-gray-200" aria-labelledby="editButton" role="menu">
<li role="separator">
<button id="vimToggle" type="button" class="dropdownItem" role="menuitem">
Vim Mode: Off
</button>
</li>
</ul>
</div>
</div>
<!-- View -->
<div id="viewContainer" class="inline-block">
<button id="viewButton" type="button" data-dropdown-toggle="dropdownNavbar" class="dropdownButton">
View
<svg class="w-2.5 h-2.5 ml-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="viewDropdown" class="hidden dropdown w-40">
<ul class="py-2 text-base text-gray-700 dark:text-gray-200" aria-labelledby="viewButton" role="menu">
<li role="separator">
<button id="chuckNowToggle" type="button" class="dropdownItem" role="menuitem">
ChucK Time: Off
</button>
</li>
<li class="divider dark:border-t-gray-400" data-content="THEME" role="separator"></li>
<li role="separator">
<button id="darkModeToggle" type="button" class="dropdownItem disabled:opacity-50" role="menuitem">
Mode: Light
</button>
</li>
<li role="separator">
<button id="colorPreferenceToggle" type="button" class="dropdownItem" role="menuitem">
System: On
</button>
</li>
</ul>
</div>
</div>
<!-- Examples -->
<div id="examplesContainer" class="inline-block">
<button id="examplesButton" type="button" data-dropdown-toggle="dropdownNavbar" class="dropdownButton">
Examples
<svg class="w-2.5 h-2.5 ml-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="examplesDropdown" class="hidden dropdown w-48">
<ul id="examplesDropdownContainer" class="py-2 text-base text-gray-700 dark:text-gray-200" aria-labelledby="examplesButton" role="menu">
</ul>
</div>
</div>
<!-- Help -->
<div id="helpContainer" class="inline-block">
<button id="helpButton" type="button" data-dropdown-toggle="dropdownNavbar" class="dropdownButton">
Help
<svg class="w-2.5 h-2.5 ml-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="helpDropdown" class="hidden dropdown w-52">
<ul class="py-2 text-base text-gray-700 dark:text-gray-200" aria-labelledby="helpButton" role="menu">
<li role="separator">
<a href="https://chuck.stanford.edu/doc/reference" target="_blank" rel="noopener noreferrer" class="dropdownItem" role="menuitem">ChucK API Reference</a>
</li>
<li role="separator">
<a href="https://chuck.stanford.edu/webchuck/" target="_blank" rel="noopener noreferrer" class="dropdownItem" role="menuitem">Learn WebChucK</a>
</li>
<li role="separator">
<a href="https://discord.gg/ENr3nurrx8" target="_blank" rel="noopener noreferrer" class="dropdownItem" role="menuitem">Discord Community</a>
</li>
<li role="separator">
<button id="keyboard-shortcuts" type="button" class="dropdownItem" role="menuitem">Keyboard Shortcuts</button>
</li>
<li class="divider dark:border-t-gray-400" data-content="GITHUB" role="separator"></li>
<li role="separator">
<a href="https://github.com/ccrma/webchuck-ide" target="_blank" rel="noopener noreferrer" class="dropdownItem" role="menuitem">GitHub Repo</a>
</li>
<li role="separator">
<a href="https://github.com/ccrma/webchuck-ide/issues/new" target="_blank" rel="noopener noreferrer" class="dropdownItem" role="menuitem">Report an Issue</a>
</li>
<li class="divider dark:border-t-gray-400" data-content="ABOUT" role="separator"></li>
<li role="separator">
<button id="about-ide" type="button" class="dropdownItem" role="menuitem">About IDE...</button>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Right -->
<div class="flex justify-right items-center text-blue-600 dark:text-blue-200 overflow-none">
<b class="w-[122px] text-md">WebChucK IDE </b><b><em class="text-3xl">2</em></b>
<button id="shareCode" class="button border-2 border-blue-600 dark:border-blue-200 px-3 py-1 rounded-md font-medium ml-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:focus-visible:ring-blue-200 cursor-pointer">Share</button>
</div>
</nav>
</header>
<!-- CHUCK BAR -->
<nav id="chuckBar" class="flex items-center justify-start px-2 py-1 gap-2" aria-label="ChucK controls">
<div class="flex items-center gap-2 flex-shrink-0" role="toolbar" aria-label="ChucK controls">
<button id="webchuckButton" type="button" class="chuck-button h-10 font-semibold bg-orange text-white text-base px-3 enabled:hover:bg-orange-400 transition-all overflow-hidden truncate disabled:opacity-50" disabled>Loading...</button>
<button id="micButton" type="button" class="chuck-button bg-[#CF68FF] disabled:opacity-50" title="Enable Microphone" aria-label="Enable Microphone" disabled>
<svg viewBox="13 9 24 33" fill="none" class="w-5 h-5"><path d="M25 10.1667C22.3764 10.1667 20.25 12.2931 20.25 14.9167V24.4167C20.25 27.0402 22.3764 29.1667 25 29.1667C27.6236 29.1667 29.75 27.0402 29.75 24.4167V14.9167C29.75 12.2931 27.6236 10.1667 25 10.1667ZM15.6392 24.4167C14.6797 24.4167 13.9069 25.2681 14.062 26.2165C14.8377 30.966 18.6368 34.6909 23.4167 35.3763V38.6667C23.4167 39.5407 24.126 40.25 25 40.25C25.874 40.25 26.5834 39.5407 26.5834 38.6667V35.3763C31.3632 34.6909 35.1624 30.966 35.938 26.2165C36.0932 25.2681 35.3204 24.4167 34.3609 24.4167C33.5787 24.4167 32.9337 24.9923 32.8023 25.765C32.161 29.4937 28.9124 32.3333 25 32.3333C21.0876 32.3333 17.839 29.4937 17.1978 25.765C17.0664 24.9923 16.4229 24.4167 15.6392 24.4167Z" fill="white"/></svg>
</button>
<button id="playButton" type="button" class="chuck-button bg-[#70E16E]" aria-label="Play" disabled>
<svg viewBox="14 10 28 33" fill="none" class="w-5 h-5"><path d="M40.1084 25.7217L15.9126 39.6911L15.9126 11.7522L40.1084 25.7217Z" fill="white"/><rect x="30.5172" y="35.5744" width="10.4631" height="1.79367" fill="white"/><rect x="34.7024" y="41.8522" width="10.4631" height="1.79367" transform="rotate(-90 34.7024 41.8522)" fill="white"/></svg>
</button>
<button id="replaceButton" type="button" class="chuck-button bg-[#6abcf8]" aria-label="Replace" disabled>
<svg viewBox="7 7 35 34" fill="none" class="w-5 h-5"><path d="M 40.6427,18.1892 C 38.3934,12.9175 33.5504,9.20644 27.8752,8.40558 22.1999,7.60471 16.5191,9.83074 12.8989,14.2741 L 9.40522,12.2004 9.34591,12.1864 C 9.28649,12.1521 9.22427,12.1228 9.15992,12.0989 L 8.92858,12.0445 8.76144,12.0364 8.69619,12.0211 C 8.53401,12.0302 8.37528,12.0716 8.22934,12.1429 L 8.15607,12.1883 C 8.11041,12.2127 8.06636,12.24 8.02418,12.2699 L 7.94393,12.345 c -0.03108,0.0269 -0.06078,0.0555 -0.08897,0.0855 -0.04049,0.0469 -0.07735,0.0968 -0.11025,0.1493 l -0.01116,0.0475 c 0,0 -0.00976,0.0415 -0.01395,0.0593 -0.05381,0.0904 -0.09002,0.1902 -0.10675,0.2941 -0.00837,0.0356 -0.01534,0.0653 -0.02372,0.1009 -0.0147,0.0486 -0.02635,0.0982 -0.03488,0.1483 0,0 -0.01255,0.0534 -0.01813,0.0771 0.0044,0.0812 0.01691,0.1617 0.03735,0.2404 L 9.6185,21.434 9.61013,21.4696 c 0.02434,0.0842 0.05769,0.1655 0.09946,0.2425 l -0.00837,0.0356 c 0.05067,0.0813 0.11077,0.1564 0.17902,0.2237 l 0.05688,0.0509 c 0.05658,0.049 0.11758,0.0927 0.18218,0.1305 l 0.0771,0.0181 c 0.0858,0.0443 0.1766,0.0783 0.2704,0.1012 0.077,0.0265 0.1565,0.0452 0.2373,0.0558 l 0.0712,0.0167 c 0.0675,-0.0037 0.1346,-0.013 0.2006,-0.0279 l 0.0356,0.0084 7.8615,-2.0447 0.1235,-0.0461 0.0618,-0.023 c 0.1029,-0.0455 0.1991,-0.105 0.2857,-0.1769 l 0.0482,-0.0451 c 0.0884,-0.0791 0.1648,-0.1708 0.2268,-0.2721 0,0 0.0097,-0.0416 0.0139,-0.0594 0.0528,-0.0886 0.0885,-0.1864 0.1054,-0.2882 0.0083,-0.0356 0.0153,-0.0652 0.0237,-0.1008 0.0147,-0.0487 0.0263,-0.0982 0.0349,-0.1483 0,0 0.0125,-0.0534 0.0181,-0.0771 -0.0091,-0.1622 -0.0505,-0.3209 -0.1218,-0.4669 l -0.0499,-0.0806 c -0.0232,-0.043 -0.049,-0.0846 -0.0771,-0.1245 l -0.0855,-0.089 0.0146,-0.1155 c -0.0595,-0.0526 -0.124,-0.0992 -0.1926,-0.1392 L 15.018,15.5112 c 3.8063,-4.4179 9.9608,-5.99877 15.4251,-3.9623 5.4643,2.0366 9.0829,7.2599 9.0694,13.0913 -0.0135,5.8315 -3.6563,11.0379 -9.13,13.049 -5.4737,2.0112 -11.6208,0.4017 -15.4066,-4.0338 -0.442,-0.4883 -1.1921,-0.5371 -1.6937,-0.1101 -0.5015,0.427 -0.573,1.1753 -0.1614,1.6895 5.262,6.1125 14.1895,7.487 21.0464,3.2402 6.8568,-4.2468 9.6036,-12.8517 6.4755,-20.2858 z" fill="white"/></svg>
</button>
<button id="removeButton" type="button" class="chuck-button bg-[#FF6868]" aria-label="Remove" disabled>
<svg viewBox="5 18 40 14" fill="none" class="w-5 h-5"><rect x="9.89172" y="22.67" width="30.5172" height="5.23153" fill="white"/></svg>
</button>
<button id="recordButton" type="button" class="chuck-button bg-white" aria-label="Record" disabled>
<svg viewBox="13 13 24 24" fill="none" class="w-5 h-5"><circle cx="25" cy="25" r="10" fill="#FF6868"/></svg>
</button>
</div>
</nav>
<!-- APP -->
<main id="app">
<!-- Left -->
<div id="app-left">
<div id="fileExplorerPanel" class="h-full flex flex-col justify-start relative overflow-hidden">
<div id="fileExplorerHeader" class="header h-10 justify-start flex-none border-b drop-shadow-sm font-bold overflow-hidden whitespace-nowrap">
<h2 class="px-2 text-base font-bold">File Explorer</h2>
<div class="ml-auto flex items-center gap-0.5" style="color: var(--ide-text-muted, #888)">
<button id="newFileIcon" type="button" class="px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded cursor-pointer" title="New file" aria-label="New file">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<line x1="12" y1="18" x2="12" y2="12"></line>
<line x1="9" y1="15" x2="15" y2="15"></line>
</svg>
</button>
<button id="uploadFilesIcon" type="button" class="px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded disabled:opacity-50 cursor-pointer" title="Upload files" aria-label="Upload files" disabled>
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="17 8 12 3 7 8"></polyline>
<line x1="12" y1="3" x2="12" y2="15"></line>
</svg>
</button>
<button id="searchToggleBtn" type="button" class="px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded cursor-pointer" aria-label="Find in files">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
</div>
</div>
<!-- Find in Files Panel (hidden by default, replaces file explorer) -->
<div id="searchPanel" class="flex-1 flex flex-col overflow-hidden">
<div class="header h-10 justify-start flex-none border-b drop-shadow-sm font-bold overflow-hidden whitespace-nowrap">
<h2 class="px-2 text-base font-bold">Find in Files</h2>
<button id="searchCloseBtn" type="button" class="ml-auto px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded cursor-pointer" style="color: var(--ide-text-muted, #888)" title="Close search" aria-label="Close search">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="px-2 py-2">
<input id="searchInput" type="text" class="w-full px-2 py-1 text-sm rounded focus:outline-none focus:ring-1" style="background-color: var(--ide-editor-bg); color: var(--ide-text); border: 1px solid var(--ide-border, #ccc); --tw-ring-color: var(--ide-accent)" placeholder="Search..." aria-label="Search in files">
</div>
<div id="searchResults" class="flex-1 overflow-y-auto text-sm px-1"></div>
</div>
<div id="fileExplorerContainer">
<div id="fileExplorer" class="absolute w-full h-full overflow-y-auto overflow-x-hidden"></div>
<div id="fileExplorerUploadPrompt" class="opacity-0">
<div class="flex flex-col items-center">
<svg width="2rem" height="2rem" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" >
<path d="M6 20L18 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M12 16V4M12 4L15.5 7.5M12 4L8.5 7.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"></path>
</svg>
<div class="text-lg font-bold">Drop files here</div>
<div class="text-sm">to upload</div>
</div>
</div>
</div>
</div>
</div>
<div id="splitV1" class="resizer vSplit" role="separator" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" aria-label="Resize file explorer"></div>
<!-- Middle -->
<div id="app-middle">
<!-- Editor Panel -->
<div id="editorPanel" class="h-full flex flex-col justify-start">
<!-- Monaco -->
<h2 class="sr-only">Code Editor</h2>
<div id="editorPanelHeader" class="header h-10 justify-start flex-none overflow-hidden">
<button id="fileToggle" type="button" class="header-item icon px-1 mr-1" aria-label="Toggle File Explorer" aria-expanded="true">
<svg class="w-6 h-5" aria-hidden="true" viewBox="0 0 30 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path stroke="currentColor" d="M3 0C1.35862 0 0 1.35862 0 3V21C0 22.6414 1.35862 24 3 24H27C28.6414 24 30 22.6414 30 21V6C30 4.35862 28.6414 3 27 3H15L12 0H3ZM3 3H10.7578L13.7578 6H27V21H3V3Z" fill="currentColor"/>
</svg>
</button>
<div id="filename" class="header-item">untitled.ck</div>
<div class="ml-auto flex items-center gap-0.5 text-xs shrink-0" style="color: var(--ide-text-muted, #888)">
<button id="editorFontDown" type="button" class="px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded cursor-pointer" title="Decrease font size" aria-label="Decrease editor font size">A-</button>
<button id="editorFontUp" type="button" class="px-1 hover:text-dark dark:hover:text-light focus:outline-none focus-visible:ring-1 focus-visible:ring-blue-600 rounded cursor-pointer" title="Increase font size" aria-label="Increase editor font size">A+</button>
</div>
</div>
<div id="monacoEditor"></div>
<div id=vimStatus class="border-none bg-gray-200 dark:bg-dark-4 w-full h-7 px-0.5 text-sm items-center flex-none hidden"></div>
</div>
<div id="splitH1" class="resizer hSplit" role="separator" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" aria-label="Resize editor and input panel"></div>
<!-- Input Panel -->
<div id="inputPanel" class="flex flex-col dark:bg-dark">
<div id="inputPanelHeader" class="header h-7 justify-start flex-none drop-shadow-sm" role="tablist" aria-label="Input panels">
<button id="GUITab" type="button" class="header-item flex items-center justify-center relative" role="tab" aria-selected="false" aria-controls="GUIContainer">
GUI
<span id="GUIPing" class="animate-ping absolute top-0 right-0 h-2 w-2 rounded-full bg-orange opacity-75 hidden" aria-hidden="true"></span>
</button>
<button id="HIDTab" type="button" class="header-item flex items-center justify-center relative" role="tab" aria-selected="false" aria-controls="HIDContainer">
HID
<span id="HIDPing" class="animate-ping absolute top-0 right-0 h-2 w-2 rounded-full bg-orange opacity-75 hidden" aria-hidden="true"></span>
</button>
<button id="SensorTab" type="button" class="header-item flex items-center justify-center relative" role="tab" aria-selected="false" aria-controls="SensorContainer">
SENSOR
<span id="SensorPing" class="animate-ping absolute top-0 right-0 h-2 w-2 rounded-full bg-orange opacity-75 hidden" aria-hidden="true"></span>
</button>
</div>
<div id="GUIContainer" class="dark:bg-dark-2 w-full h-full" role="tabpanel" aria-labelledby="GUITab">
<div id="GUIPanel" class="w-full h-full relative overflow-hidden">
</div>
</div>
<div id="HIDContainer" class="relative dark:bg-dark-2 w-full h-full overflow-auto md:overflow-hidden" role="tabpanel" aria-labelledby="HIDTab">
<div id="HIDPanel" class="absolute w-full h-full p-2">
<button id="mouseHIDButton" class="toggle-button w-32" disabled>Mouse: Off</button>
<button id="keyboardHIDButton" class="toggle-button w-32" disabled>Keyboard: Off</button>
<div id="hidLog" class="log-container opacity-50 text-sm"></div>
</div>
</div>
<div id="SensorContainer" class="relative dark:bg-dark-2 w-full h-full overflow-auto md:overflow-hidden" role="tabpanel" aria-labelledby="SensorTab">
<div id="SensorPanel" class="absolute w-full h-full p-2 pt-1">
<div class="pb-2 font-bold text-md">Mobile Only</div>
<div class="flex flex-wrap pb-1">
<button id="gyroButton" class="toggle-button w-32 mr-2" disabled>Gyro: Off</button>
<div id="gyroLog" class="log-container sensorLog opacity-50 text-sm"></div>
</div>
<div class="flex flex-wrap pb-1">
<button id="accelButton" class="toggle-button w-32 mr-2" disabled>Accel: Off</button>
<div id="accelLog" class="log-container sensorLog opacity-50 text-sm"></div>
</div>
</div>
</div>
</div>
</div>
<div id="splitV2" class="resizer vSplit" role="separator" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" aria-label="Resize editor and output panel"></div>
<!-- Right -->
<div id="app-right" class="flex flex-col">
<!-- Output Panel -->
<div id="outputPanel" class="flex flex-col flex-1 min-h-0">
<h2 class="sr-only">Output</h2>
<div id="outputPanelHeader" class="header h-10 justify-start flex-none drop-shadow-sm">
<div role="tablist" aria-label="Output panels" class="flex items-center">
<button id="vmMonitorTab" type="button" class="header-item text-dark-5" role="tab" aria-selected="false" aria-controls="vmMonitorContainer">VM MONITOR</button>
<button id="consoleTab" type="button" class="header-item text-dark-5" role="tab" aria-selected="false" aria-controls="consoleContainer">CONSOLE</button>
<button id="visualizerTab" type="button" class="header-item text-dark-5" role="tab" aria-selected="false" aria-controls="visualizerContainer">VISUALIZER</button>
</div>
</div>
<div id="vmMonitorContainer" class="flex flex-col" role="tabpanel" aria-labelledby="vmMonitorTab">
<div class="flex-1 min-h-0 overflow-auto" tabindex="0">
<table id="shredTable" class="w-full table-auto text-left">
<thead class="h-12 align-middle font-medium sticky top-0 z-10">
<tr>
<th scope="col" class="border-b">Shred</th>
<th scope="col" class="border-b">Code</th>
<th scope="col" class="border-b">Time</th>
<th scope="col" class="border-b" style="width: 10%;">Remove</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div id="chuckNowStatus" class="shrink-0 whitespace-nowrap px-2 flex items-center justify-end gap-1 text-sm" style="display: none; height: 30px; background-color: var(--ide-bg, #DDEEFF); border-top: 1px solid var(--ide-border, #C9E0F7);">
<span class="text-orange font-mono"><b>now:</b></span>
<span id="chuckNowTime" class="font-mono text-dark-4 dark:text-light">00:00:00.00000</span>
</div>
</div>
<div id="consoleContainer" class="hidden relative" role="tabpanel" aria-labelledby="consoleTab">
<div id="console" class="absolute inset-0"></div>
</div>
<div id="visualizerContainer" class="hidden relative bg-white dark:bg-dark-2" role="tabpanel" aria-labelledby="visualizerTab">
<div id="visualizer-help" class="absolute inset-0 flex items-center justify-center text-[#666] dark:text-[#bbb] transition">
<b>Start WebChucK for visualizer</b>
</div>
<canvas id="visualizer" class="absolute inset-0 w-full h-full" aria-label="Audio visualizer"></canvas>
</div>
</div>
</div>
</main>
<!-- MODALS -->
<!-- More Examples Modal -->
<dialog class="modal modal-lg" id="more-examples-modal" aria-labelledby="more-examples-heading">
<h2 id="more-examples-heading" class="text-xl font-semibold pb-2">ChucK Example Library</h2>
<div class="w-full p-2 border border-gray-200 bg-gray-50 rounded-t-xl dark:border-gray-600 dark:bg-dark-4 flex flex-col-reverse md:flex-row">
<!-- Breadcrumbs -->
<nav class="flex justify-left w-1/2 pl-2 pt-2 md:pt-0">
<ol id="more-examples-breadcrumbs" class="inline-flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse">
</ol>
</nav>
<!-- Search -->
<div class="justify-right w-full h-10 md:w-1/2 relative">
<input id="more-examples-search" type="text" role="combobox" aria-autocomplete="list" aria-expanded="false"
aria-controls="autocomplete-list" aria-activedescendant=""
class="form-input h-full !pl-11 !pr-3"
placeholder="Search..." aria-label="Search examples">
<div class="absolute left-3 top-1/2 transform -translate-y-1/2">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-6 w-6 text-gray-500">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</div>
<div id="more-examples-autocomplete" class="absolute w-full mt-1 border border-gray-300 rounded-md z-10 hidden bg-white dark:bg-dark">
<ul id="autocomplete-list" class="">
</ul>
</div>
</div>
</div>
<!-- File Explorer -->
<div id="more-examples-explorer" class="border-l border-r border-gray-200 dark:border-gray-600 flex flex-col flex-wrap overflow-auto" style="height:30vh">
</div>
<!-- File Preview -->
<div class="border-l border-r border-t border-gray-200 bg-gray-50 dark:text-light dark:border-gray-600 dark:bg-dark-4 flex">
<ul class="flex text-sm font-medium text-center text-dark dark:text-gray-400">
<li>
<span class="inline-block w-full p-2 px-3 bg-gray-100 border-r border-gray-200 dark:bg-dark dark:border-gray-600">Preview</span>
</li>
<li>
<span id="more-examples-preview-name" class="inline-block p-2 px-3"></span>
</li>
</ul>
</div>
<pre id="more-examples-preview-code" class="text-sm font-mono p-1 border border-gray-200 dark:border-gray-600 rounded-b-lg overflow-auto" style="height:16vh">
</pre>
<!-- Load More Examples -->
<div class="flex gap-4 justify-end pt-4">
<button id="more-examples-close" type="button" class="button secondary">Close</button>
<button id="more-examples-load" type="submit" class="button primary">Load Example</button>
</div>
</dialog>
<!-- Settings Modal -->
<dialog class="modal" id="settings-modal" aria-labelledby="settings-heading">
<h2 id="settings-heading" class="text-xl font-semibold pb-2">Settings</h2>
<!-- Setting Options-->
<form class="flex flex-col gap-2 py-2" method="dialog">
<label class="form-label" for="chuck-version-select">ChucK version</label>
<select id="chuck-version-select" class="form-select">
<option value="stable">Stable</option>
<option value="dev">Development</option>
</select>
<p id="chuck-version-desc" class="text-sm text-dark-8 dark:text-gray-400 mt-1"></p>
</form>
<!-- Close Settings -->
<div class="flex gap-4 justify-end pt-4">
<button id="settings-close" type="button" class="button secondary">Cancel</button>
<button id="settings-apply" type="button" class="button primary">Reload</button>
</div>
</dialog>
<!-- Keyboard Shortcuts Modal -->
<dialog class="modal" id="shortcuts-modal" aria-labelledby="shortcuts-heading">
<h2 id="shortcuts-heading" class="text-xl font-semibold pb-2">Keyboard Shortcuts</h2>
<section class="shortcuts-section">
<h3 class="shortcuts-category">ChucK Controls</h3>
<div class="shortcuts-grid">
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>.</kbd></div>
<div>Start WebChucK</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Enter</kbd></div>
<div>Run code</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>\</kbd></div>
<div>Replace shred</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Backspace</kbd></div>
<div>Remove shred</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>S</kbd></div>
<div>Generate GUI</div>
</div>
</section>
<section class="shortcuts-section">
<h3 class="shortcuts-category">Editor</h3>
<div class="shortcuts-grid">
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Z</kbd></div>
<div>Undo</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd></div>
<div>Redo</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>D</kbd></div>
<div>Select next occurrence</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>/</kbd></div>
<div>Toggle line comment</div>
<div class="shortcuts-keys"><kbd>Alt</kbd> + <kbd>↑</kbd>/<kbd>↓</kbd></div>
<div>Move line up/down</div>
</div>
</section>
<section class="shortcuts-section">
<h3 class="shortcuts-category">Navigation</h3>
<div class="shortcuts-grid">
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Shift</kbd> + <kbd>F</kbd></div>
<div>Find in files</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>F</kbd></div>
<div>Find in editor</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>H</kbd></div>
<div>Find and replace</div>
<div class="shortcuts-keys"><kbd class="meta-key"></kbd> + <kbd>Shift</kbd> + <kbd>P</kbd></div>
<div>Command palette</div>
</div>
</section>
<div class="flex justify-end pt-4">
<button id="shortcuts-close" type="button" class="button secondary">Close</button>
</div>
</dialog>
<!-- Export to WebChucK Modal -->
<dialog class="modal" id="export-webchuck-modal" aria-labelledby="export-wc-heading">
<form class="flex flex-col gap-2 py-2" method="dialog">
<h2 id="export-wc-heading" class="text-xl font-semibold pb-2">Export to WebChucK</h2>
<div>
<label class="form-label" for="export-title">Title</label>
<input id="export-title" class="form-input" type="text" placeholder="Hello Sine">
</div>
<div>
<label class="form-label" for="export-author">Author</label>
<input id="export-author" class="form-input" type="text" placeholder="Terry Feng">
</div>
<div>
<label class="form-label" for="export-description">Description</label>
<textarea id="export-description" class="form-input" placeholder="A very cool sine wave!"></textarea>
</div>
<div>
<label class="form-label pr-2" for="export-wc-file-select">Main File</label>
<select id="export-wc-file-select" class="form-select disabled:opacity-50">
</select>
</div>
<div class="flex gap-4 justify-end pt-4">
<button id="export-cancel-btn" type="button" class="button secondary">Cancel</button>
<button id="export-btn" type="submit" class="button primary">Export</button>
</div>
</form>
</dialog>
<!-- Share Code Modal -->
<dialog class="modal" id="share-code-modal" aria-labelledby="share-code-heading">
<form class="flex flex-col gap-4 py-2" method="dialog">
<div class="flex flex-col">
<h2 id="share-code-heading" class="text-xl font-semibold pb-2">Share Code</h2>
<p class="text-dark-6 dark:text-dark-c">
Share your ChucK code via the link below. Your project is encoded
directly in the URL. <em>If you make any code changes, hit "Share"
again to generate a new link.</em>
</p>
</div>
<!-- Shareable Link -->
<div>
<label class="form-label" for="share-code-url">Shareable Link</label>
<div class="flex gap-2">
<input type="text" id="share-code-url"
class="h-10 form-input text-sm text-ellipsis select-all whitespace-nowrap"
readonly aria-label="Share Link">
<button id="share-code-copy" type="button"
class="button primary flex items-center justify-center gap-[0.35rem] min-w-[6.5rem]">
<img src="./img/copy.svg" class="w-[1.125rem] h-[1.125rem] -ml-1" alt="" aria-hidden="true">
Copy
</button>
</div>
</div>
<div>
<!-- Scope Selection -->
<label class="form-label sr-only" for="share-project-files">Select Scope</label>
<div class="grid grid-cols-2 gap-3">
<button type="button" id="share-scope-current" class="shareScopeBtn active">
<div class="flex flex-row items-center gap-2">
<img src="./img/ck-color.svg" class="h-6" alt="" aria-hidden="true">
<span class="font-medium text-[0.95rem] text-dark dark:text-light">Current File</span>
</div>
<span class="text-xs text-dark-5 dark:text-gray-400"><span id="share-current-filename">active.ck</span>
only</span>
</button>
<button type="button" id="share-scope-all" class="shareScopeBtn">
<div class="flex flex-row items-center gap-2">
<img src="./img/folder-color.svg" class="h-6" alt="" aria-hidden="true">
<span class="font-medium text-[0.95rem] text-dark dark:text-light">Full Project</span>
</div>
<span id="share-project-name" class="text-xs text-dark-5 dark:text-gray-400">All .ck files will be
included</span>
</button>
<input type="checkbox" id="share-project-files" class="hidden">
</div>
</div>
<!-- Footer -->
<div class="flex justify-end pt-4">
<div class="flex gap-4">
<button id="share-code-done" type="button" class="button secondary">Done</button>
</div>
</div>
</form>
</dialog>
<!-- Mobile Bottom Sheet: File Explorer -->
<div id="bottomSheet" class="bottom-sheet-overlay hidden" aria-modal="true" role="dialog" aria-label="File Explorer">
<div id="bottomSheetBackdrop" class="bottom-sheet-backdrop"></div>
<div id="bottomSheetContent" class="bottom-sheet-content">
<div class="bottom-sheet-handle flex items-center" aria-hidden="true">
<div class="flex-1"></div>
<div class="bottom-sheet-handle-bar"></div>
<div class="flex-1 flex justify-end">
<button id="bottomSheetClose" type="button" class="p-1.5 mr-1 cursor-pointer" style="color: var(--ide-text-muted, #888)" aria-label="Close file explorer">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
</div>
<div id="bottomSheetFiles" class="overflow-hidden" style="height: 50vh;"></div>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>