forked from flipcomputing/flock
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
884 lines (836 loc) · 37.6 KB
/
index.html
File metadata and controls
884 lines (836 loc) · 37.6 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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="UTF-8" />
<title>Flock XR - Creative coding in 3D</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"
/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="manifest" href="manifest.webmanifest" />
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png" />
<link rel="icon" href="/images/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml" />
<meta name="theme-color" content="#511d91" />
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QCGT3X072N"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-QCGT3X072N', {
'client_storage': 'none', // Prevents setting cookies
'anonymize_ip': true // Hides IP addresses for privacy
});
</script>
<link rel="stylesheet" href="style.css" />
<style>
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Critical loading styles - inline to prevent flash */
#flockeditor {
opacity: 0 !important;
pointer-events: none;
visibility: hidden;
}
body:not(.loading) #flockeditor {
opacity: 1 !important;
pointer-events: auto;
visibility: visible;
transition: opacity 0.3s ease-in;
}
.loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
opacity: 1;
transition: opacity 0.5s ease-out;
}
.loading-screen.fade-out {
opacity: 0;
pointer-events: none;
}
/* Inline critical bird styles for immediate loading */
.loading-bird {
width: 120px !important;
height: 120px !important;
max-width: 120px;
max-height: 120px;
animation: float 2s ease-in-out infinite;
display: block;
order: 1;
}
.loading-content {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
.loading-brand {
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
margin-bottom: 10px;
}
@keyframes float {
0%, 100% {
transform: translateY(0px);
}
50% {
transform: translateY(-10px);
}
}
/* Inline critical loading text styles */
.loading-text {
color: #511D91 !important;
font-size: 18px;
font-weight: 500;
margin: 0;
font-family: "Asap", Helvetica, Arial, Lucida, sans-serif;
order: 4;
}
.loading-logo {
width: 200px;
height: auto;
margin: 10px 0;
order: 2;
opacity: 0;
animation: fadeInLogo 0.5s ease-in 0.3s forwards;
}
@keyframes fadeInLogo {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.loading-spinner {
width: 40px;
height: 40px;
border: 4px solid #e3e3e3;
border-top: 4px solid #511D91;
border-radius: 50%;
animation: spin 1s linear infinite;
order: 3;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body class="loading">
<!-- Loading Screen -->
<div id="loadingScreen" class="loading-screen" role="dialog" aria-modal="true" aria-labelledby="loading-title" aria-describedby="loading-description">
<div class="loading-content">
<img src="images/flock-bird-mascot.svg" alt="Flock XR Bird mascot" class="loading-bird" width="120" height="120" />
<img src="images/inline-flock-xr.png" alt="Flock XR Logo" class="loading-logo" />
<div class="loading-spinner" role="img" aria-label="Loading animation"></div>
<h1 id="loading-title" class="sr-only">Loading Flock XR</h1>
<p id="loading-description" class="loading-text" aria-live="polite">Loading Flock XR...</p>
</div>
</div>
<h1 class="sr-only">FlockXR</h1>
<label for="importFile" class="sr-only">Import project file</label>
<input
type="file"
id="importFile"
style="display: none"
accept=".json,.svg,.png"
/>
<div id="flockeditor">
<header role="banner">
<nav id="menu" role="navigation" aria-label="Main navigation">
<div id="menuleft">
<img src="images/flockxr-bird.png" alt="Flock XR logo" id="logo" />
<!-- Menu Button -->
<!-- Added the menu wrapper for mobile screens and put about option when clicked shows the popup modal for the screen of the button show info inherently disabled the showinfo button on mobile screens-->
<div id = 'about-menu-wrapper'>
<button
class="bigbutton"
id="menuBtn"
title="Open menu for more options"
aria-label="Open additional menu options"
aria-expanded="false"
aria-haspopup="true"
>
<span class="sr-only">Menu</span>
<div class="icon" style="width: 1.25em; height: 1.25em" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="#511D91">
<path
fill = "#511D91"
d="M0 96C0 78.3 14.3 64 32 64h384c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zm0 160c0-17.7 14.3-32 32-32h384c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zm448 160c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h384c17.7 0 32 14.3 32 32z"/>
</svg>
</div>
</button>
<div id="menuDropdown" class="dropdown hidden" role="menu" aria-labelledby="menuBtn">
<a href="#" id="openAbout" role="menuitem">About</a>
<!--space for the future options-->
</div>
<!-- Modal Popup for Info Panel -->
</div>
<div id="infoModal" class="modal hidden" role="dialog" aria-labelledby="modal-title" aria-modal="true">
<div class="modal-content" tabindex="-1">
<span class="close-button" id="closeInfoModal" aria-label="Close information modal">×</span>
<h2 id="modal-title" style="margin-top: 0;">About Flock XR</h2>
<div id="model-panel-content">
<p>
Flock XR is a <strong>prototype</strong> made by
<a target="_blank" href="https://flipcomputing.com/flockxr/"
>Flip Computing</a
>. Please try it out but be aware that things may change and
some features aren't finished yet. We're currently looking for
support to develop Flock so that you can rely on it.
</p>
<div>
Take a look at the demos above to see what you can do.
Make some changes and click
<div
style="
display: inline-block;
margin-left: 2px;
margin-right: 2px;
"
>
<div
class="icon"
style="height: 1em; width: 1em; padding: 0px"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
>
<path
fill="#511D91"
d="M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"
/>
</svg>
</div>
</div>
run.
</div>
<p>
</p>
<p>View the <a target="_blank" href="https://flockxr.com/privacy-policy/">privacy policy</a> for Flock XR. <a href="https://flipcomputing.com/contact/" target="_blank"
>Get in touch</a
></p>
</div>
</div>
</div>
<script>
const menuBtn = document.getElementById("menuBtn");
const menuDropdown = document.getElementById("menuDropdown");
const openAbout = document.getElementById("openAbout");
const infoModal = document.getElementById("infoModal");
const closeInfoModal = document.getElementById("closeInfoModal");
let previouslyFocused = null;
// Toggle menu dropdown
menuBtn.addEventListener("click", () => {
const isHidden = menuDropdown.classList.toggle("hidden");
menuBtn.setAttribute("aria-expanded", !isHidden);
if (!isHidden) {
// Focus first menu item when opened
setTimeout(() => openAbout.focus(), 0);
}
});
// Handle keyboard navigation for menu
menuBtn.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
menuBtn.click();
} else if (e.key === "ArrowDown") {
e.preventDefault();
if (menuDropdown.classList.contains("hidden")) {
menuBtn.click();
} else {
openAbout.focus();
}
}
});
// Handle keyboard navigation within dropdown
openAbout.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
e.preventDefault();
menuDropdown.classList.add("hidden");
menuBtn.setAttribute("aria-expanded", "false");
menuBtn.focus();
} else if (e.key === "ArrowUp") {
e.preventDefault();
menuBtn.focus();
}
});
// Open modal when About is clicked
openAbout.addEventListener("click", (e) => {
e.preventDefault();
previouslyFocused = document.activeElement;
infoModal.classList.remove("hidden");
menuDropdown.classList.add("hidden");
menuBtn.setAttribute("aria-expanded", "false");
// Focus the close button in the modal
setTimeout(() => closeInfoModal.focus(), 0);
});
// Close modal on close button
closeInfoModal.addEventListener("click", () => {
infoModal.classList.add("hidden");
if (previouslyFocused) {
previouslyFocused.focus();
previouslyFocused = null;
}
});
// Handle keyboard events for modal
infoModal.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
e.preventDefault();
closeInfoModal.click();
} else if (e.key === "Tab") {
// Trap focus within modal
const focusableElements = infoModal.querySelectorAll(
'button, input, select, textarea, [href], [tabindex]:not([tabindex="-1"])'
);
const firstElement = focusableElements[0];
const lastElement = focusableElements[focusableElements.length - 1];
if (e.shiftKey && document.activeElement === firstElement) {
e.preventDefault();
lastElement.focus();
} else if (!e.shiftKey && document.activeElement === lastElement) {
e.preventDefault();
firstElement.focus();
}
}
});
// Close menu when clicking outside
window.addEventListener("click", (e) => {
if (!menuBtn.contains(e.target) && !menuDropdown.contains(e.target)) {
menuDropdown.classList.add("hidden");
menuBtn.setAttribute("aria-expanded", "false");
}
if (e.target === infoModal) {
closeInfoModal.click();
}
});
// Close menu on Escape key
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && !menuDropdown.classList.contains("hidden")) {
menuDropdown.classList.add("hidden");
menuBtn.setAttribute("aria-expanded", "false");
menuBtn.focus();
}
});
</script>
<button class="bigbutton" id="runCodeButton" title="Run your code" aria-label="Run your code">
<div class="icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="24" height="24">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"
/>
</svg>
</div>
</button>
<button class="bigbutton" id="stopCodeButton" title="Stop your code" aria-label="Stop your code">
<div class="icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="24" height="24">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"
/>
</svg>
</div>
</button>
<button
class="bigbutton"
id="openButton"
title="Open a project from a file on your computer"
aria-label="Open a project from a file on your computer"
tabindex="0"
>
<label for="fileInput" class="sr-only">Select project file to open</label>
<input type="file" id="fileInput" style="display: none" disabled />
<div class="icon" style="width: 1.25em; height: 1.25em" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"
/>
</svg>
</div>
</button>
<label for="projectName" class="sr-only">Project name</label>
<input
type="text"
style="
flex-shrink: 1;
width: 100%;
min-width: 10px;
max-width: 80px;
"
id="projectName"
placeholder="Project name"
aria-describedby="project-name-desc"
/>
<div id="project-name-desc" class="sr-only">Enter a name for your project to use when saving or exporting</div>
<button
class="bigbutton"
id="exportCodeButton"
title="Save this project to a file on your computer."
aria-label="Save this project to a file on your computer"
aria-describedby="export-desc"
>
<div class="icon" style="width: 1.25em; height: 1.25em" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill = "#511D91"
d="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"
/>
</svg>
</div>
</button>
<div id="export-desc" class="sr-only">Downloads your project as a JSON file to your computer</div>
<select
id="exampleSelect"
class="bigbutton"
title="Choose an example project to load."
style="font-size: 14px"
disabled
aria-label="Choose an example project to load"
aria-describedby="demo-desc"
>
<option value="" style="color: #511d91">Demo</option>
<option id="project-new" value="examples/new.json">New</option>
<option value="examples/starter.json">👋🏽 Starter</option>
<option value="examples/controller_starter.json">
🎮Controller Starter
</option>
<option value="examples/snow_globe.json">❄️ Snow globe</option>
<option value="examples/forest_base.json">🌲Forest Base</option>
<option value="examples/character_animation.json">
🎥Character Animation
</option>
<option value="examples/cube_art.json">🎨 Cube Art</option>
<option value="examples/physics_fun.json">👆🏾Physics Fun</option>
<option value="examples/collect_the_gems.json">
💎 Collect the Gems
</option>
<option value="examples/water_map.json">💧 Water Map</option>
<option value="examples/skittles.json">🎳 Skittles</option>
<option value="examples/beetle.json">🪲 Beetle</option>
<option value="examples/roominator.json">🛋️Roominator</option>
<option value="examples/ball_pit.json">🟠 Ball Pit</option>
<option value="examples/ur_enough.json">💗 UR Enough!</option>
<option value="examples/tallest_buildings.json">
📊 Tallest buildings
</option>
<option value="examples/candy_dash.json">🎃 Candy dash</option>
<option value="examples/flockenspiel.json">🎵 Flockenspiel</option>
<option value="examples/pendant.json">
📿 3D-printable pendant
</option>
<option value="examples/tent_lights.json">⛺Festival tent</option>
<option value="examples/my_place.json">🏠My place</option>
<option value="examples/microbit_monkey.json">
🐵 micro:bit monkey
</option>
</select>
<div id="demo-desc" class="sr-only">Select from pre-built example projects to explore different features and capabilities</div>
</div>
<div id="menuright">
<button
class="bigbutton"
id="toggleDesign"
title="Design your project"
aria-label="Switch to design mode"
aria-describedby="design-desc"
aria-pressed="false"
>
<div class="icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"
/>
</svg>
</div>
</button>
<div id="design-desc" class="sr-only">Toggle design mode to visually create and modify 3D objects in your scene</div>
<button class="bigbutton" id="togglePlay" title="Use your project" aria-label="Switch to play mode" aria-describedby="play-desc" aria-pressed="false">
<div class="icon" style="width: 2em" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"
/>
</svg>
</div>
</button>
<div id="play-desc" class="sr-only">Toggle play mode to interact with and test your 3D project</div>
<button
class="bigbutton"
title="Switch between fullscreen and normal views."
id="fullscreenToggle"
aria-label="Toggle fullscreen mode"
aria-describedby="fullscreen-desc"
>
<div class="icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path
fill="#511D91"
d="M200 32L56 32C42.7 32 32 42.7 32 56l0 144c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312l0 144c0 13.3 10.7 24 24 24l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l144 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-144c0-13.3-10.7-24-24-24L312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"
/>
</svg>
</div>
</button>
</div>
</nav>
</header>
<main role="main">
<section id="maincontent" aria-label="Main content area" tabindex="0">
<div id="rightArea">
<canvas id="renderCanvas" touch-action="none" tabindex="0" aria-label="3D scene canvas" role="img" aria-describedby="canvas-desc canvas-controls-desc"></canvas>
<div id="canvas-desc" class="sr-only">Interactive 3D scene where your project runs. Use keyboard controls to navigate and interact with objects.</div>
<div id="canvas-controls-desc" class="sr-only">Canvas keyboard controls: Arrow keys or WASD to move camera, Mouse to look around, Space for actions, Tab to navigate to other interface elements.</div>
<div id="fullscreen-desc" class="sr-only">Toggle between fullscreen and windowed view of the application</div>
<aside class="gizmo-buttons" id="gizmoButtons" aria-label="Design tools">
<div id="shape-menu">
<!-- Gizmo button to toggle the shape menu -->
<button
class="gizmo-button"
id="showShapesButton"
style="margin-left: 5px"
disabled
aria-label="Add shapes and models"
title="Add shapes and models"
aria-expanded="false"
aria-haspopup="true"
tabindex="10"
>
<img
src="./images/add.svg"
width="20px"
height="20px"
alt="Add"
onerror="this.style.display='none'; this.parentNode.textContent='+';"
/>
</button>
<!-- Dropdown for shapes and models -->
<span id="shapes-dropdown" style="display: none">
<!-- Shape Row -->
<ul id="shape-row">
<li onclick="selectShape('create_box')">
<img src="./images/box.png" alt="Box" />
</li>
<li onclick="selectShape('create_sphere')">
<img src="./images/sphere.png" alt="Sphere" />
</li>
<li onclick="selectShape('create_cylinder')">
<img src="./images/cylinder.png" alt="Cylinder" />
</li>
<li onclick="selectShape('create_capsule')">
<img src="./images/capsule.png" alt="Capsule" />
</li>
<li onclick="selectShape('create_plane')">
<img src="./images/plane.png" alt="Plane" />
</li>
</ul>
<!-- Model Row with scroll buttons -->
<div class="scrollable-container">
<button
class="scroll-button left"
id="scrollModelsLeftButton"
disabled
aria-label="Scroll models left"
>
⟪
</button>
<ul id="model-row">
<!-- Dynamically generated model items will be inserted here -->
</ul>
<button
class="scroll-button right"
id="scrollModelsRightButton"
disabled
aria-label="Scroll models right"
>
⟫
</button>
</div>
<!-- Object Row -->
<div class="scrollable-container">
<button
class="scroll-button left"
id="scrollObjectsLeftButton"
disabled
aria-label="Scroll objects left"
>
⟪
</button>
<ul id="object-row">
<!-- Dynamically generated object items will be inserted here -->
</ul>
<button
class="scroll-button right"
id="scrollObjectsRightButton"
disabled
aria-label="Scroll objects right"
>
⟫
</button>
</div>
<!-- Character Row -->
<div class="scrollable-container">
<button
class="scroll-button left"
id="scrollCharactersLeftButton"
disabled
aria-label="Scroll characters left"
>
⟪
</button>
<ul id="character-row">
<!-- Dynamically generated character items will be inserted here -->
</ul>
<button
class="scroll-button right"
id="scrollCharactersRightButton"
disabled
aria-label="Scroll characters right"
>
⟫
</button>
</div>
</span>
</div>
<label for="colorPickerButton" class="sr-only">Change object color</label>
<input type="color" id="colorPickerButton" disabled title="Change object color" tabindex="11" />
<button class="gizmo-button" id="positionButton" disabled aria-label="Move object position" title="Move object position" tabindex="12">
<img
src="./images/position.svg"
width="20px"
height="20px"
alt="Position"
onerror="this.style.display='none'; this.parentNode.textContent='⌖';"
/>
</button>
<button class="gizmo-button" id="rotationButton" disabled aria-label="Rotate object" title="Rotate object" tabindex="13">
<img
src="./images/rotate.svg"
width="20px"
height="20px"
alt="Rotate"
onerror="this.style.display='none'; this.parentNode.textContent='↻';"
/>
</button>
<button class="gizmo-button" id="scaleButton" disabled aria-label="Scale object size" title="Scale object size" tabindex="14">
<img
src="./images/scale.svg"
width="20px"
height="20px"
alt="Scale"
onerror="this.style.display='none'; this.parentNode.textContent='⚏';"
/>
</button>
<!--button class="gizmo-button" id="boundsButton" disabled>
<img
src="images/bounds.svg"
width="20px"
height="20px"
alt="bounds"
/>
</button-->
<!--button class="gizmo-button" id="focusButton" disabled>
<img
src="images/focus.svg"
width="20px"
height="20px"
alt="focus"
/-->
</button>
<button class="gizmo-button" id="hideButton" disabled aria-label="Select object" title="Select object" tabindex="15">
<img
src="./images/pointer.svg"
width="20px"
height="20px"
alt="Select"
onerror="this.style.display='none'; this.parentNode.textContent='👆';"
/>
</button>
<button class="gizmo-button" id="duplicateButton" disabled aria-label="Duplicate object" title="Duplicate object" tabindex="16">
<img
src="./images/duplicate.svg"
width="20px"
height="20px"
alt="Duplicate"
onerror="this.style.display='none'; this.parentNode.textContent='⧉';"
/>
</button>
<button class="gizmo-button" id="deleteButton" disabled aria-label="Delete object" title="Delete object" tabindex="17">
<img
src="./images/delete.svg"
width="20px"
height="20px"
alt="Delete"
onerror="this.style.display='none'; this.parentNode.textContent='🗑';"
/>
</button>
<button class="gizmo-button" id="cameraButton" disabled aria-label="Camera controls" title="Camera controls" tabindex="18">
<img
src="./images/camera2.svg"
width="20px"
height="20px"
alt="Camera"
onerror="this.style.display='none'; this.parentNode.textContent='📷';"
/>
</button>
</aside>
<!---
<button class="gizmo-button" id="cutButton" disabled>
<img
src="images/cut.svg"
width="20px"
height="20px"
alt="cut"
/>
</button>
<button class="gizmo-button" id="copyButton" disabled>
<img
src="images/copy.svg"
width="20px"
height="20px"
alt="copy"
/>
</button>
<button class="gizmo-button" id="pasteButton" disabled>
<img
src="images/paste.svg"
width="20px"
height="20px"
alt="paste"
/>
</button>
-->
<!-- Info panel collapse starts -->
<aside id="info-panel" role="complementary" aria-label="Information panel">
<button id="info-panel-toggle" style="cursor: pointer" aria-expanded="false" aria-controls="info-panel-content">
Show Info
</button>
<div id="info-panel-content" style="display: none">
<p>
Flock XR is a <strong>prototype</strong> made by
<a target="_blank" href="https://flipcomputing.com/flockxr/"
>Flip Computing</a
>. Please try it out but be aware that things may change and
some features aren't finished yet. We're currently looking for
support to develop Flock so that you can rely on it.
</p>
<div>
Take a look at the demos above to see what you can do.
Make some changes and click
<div
style="
display: inline-block;
margin-left: 2px;
margin-right: 2px;
"
>
<div
class="icon"
style="height: 1em; width: 1em; padding: 0px"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
>
<path
fill="#511D91"
d="M0 256a256 256 0 1 1 512 0 A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-0.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-0.5z"
/>
</svg>
</div>
</div>
run.
</div>
<p>
</p>
<p>View the <a target="_blank" href="https://flockxr.com/privacy-policy/">privacy policy</a> for Flock XR. <a href="https://flipcomputing.com/contact/" target="_blank"
>Get in touch</a
></p>
</div>
</aside>
<script>
const toggleButton = document.getElementById("info-panel-toggle");
const infoContent = document.getElementById("info-panel-content");
toggleButton.addEventListener("click", () => {
if (infoContent.style.display === "none") {
infoContent.style.display = "block";
toggleButton.textContent = "Hide Info";
toggleButton.setAttribute("aria-expanded", "true");
} else {
infoContent.style.display = "none";
toggleButton.textContent = "Show Info";
toggleButton.setAttribute("aria-expanded", "false");
}
});
</script>
<!-- Info panel collapse ends -->
<div id="flocklink">
<a href="https://flockxr.com/" target="_blank" id="info-panel-link" tabindex="20" aria-label="Visit Flock XR website - opens in new tab" title="Visit Flock XR website">
<img src="images/inline-flock-xr.png" alt="Flock XR logo" style="width: 100px;">
</a>
</div>
</div>
<div id="codePanel" aria-label="Code editor panel">
<!--button
value="Toolbox"
id="toolboxControl"
style="
z-index: 100000;
font-size: 16px;
border: none;
padding: 10px;
background-color: rgba(255, 101, 80, 0.45);
box-sizing: border-box;
"
>
<strong>+ Code</strong>
</button-->
<div id="blocklyDiv" role="application" aria-label="Visual programming workspace" aria-describedby="blockly-desc" tabindex="0"></div>
<div id="blockly-desc" class="sr-only">Drag and drop code blocks to create your program. Use arrow keys and Enter to navigate and interact with blocks.</div>
</div>
</section>
</main>
<div id="bottomBar" role="toolbar" aria-label="View switching controls">
<button id="switchViews" aria-label="Switch between code and canvas views" aria-describedby="switch-desc">Code >></button>
<div id="switch-desc" class="sr-only">Toggle between coding view and 3D scene view</div>
</div>
<!-- Live region for dynamic announcements -->
<div id="announcements" aria-live="polite" aria-atomic="true" class="sr-only"></div>
</div>
<script type="module" src="/main/main.js"></script>
</body>
</html>