-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
1224 lines (1148 loc) · 52.1 KB
/
index.html
File metadata and controls
1224 lines (1148 loc) · 52.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
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
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="description" content="An interactive tool that maps out everything you know. Answer questions and watch your personalized knowledge map take shape.">
<title>Knowledge Mapper</title>
<!-- Open Graph meta tags -->
<meta property="og:title" content="Knowledge Mapper">
<meta property="og:description" content="An interactive tool that maps out everything you know. Answer questions and watch your personalized knowledge map take shape.">
<meta property="og:image" content="https://context-lab.com/mapper/og-preview.png">
<meta property="og:url" content="https://context-lab.com/mapper/">
<meta property="og:type" content="website">
<!-- Twitter Card meta tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Knowledge Mapper">
<meta name="twitter:description" content="An interactive tool that maps out everything you know. Answer questions and watch your personalized knowledge map take shape.">
<meta name="twitter:image" content="https://context-lab.com/mapper/og-preview.png">
<!-- KaTeX for LaTeX rendering -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css" integrity="sha384-5TcZemv2l/9On385z///+d7MSYlvIEw9FuZTIdZ14vJLqWphw7e7ZPuOiCHJcFCP" crossorigin="anonymous" onerror="window.__katexFailed=true; console.error('KaTeX CSS failed to load'); document.getElementById('cdn-warning').hidden=false;">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.js" integrity="sha384-cMkvdD8LoxVzGF/RPUKAcvmm49FQ0oxwDF3BGKtDXcEc+T1b2N+teh/OJfpU0jr6" crossorigin="anonymous" onerror="window.__katexFailed=true; console.error('KaTeX JS failed to load'); document.getElementById('cdn-warning').hidden=false;"></script>
<!-- Tutorial styles -->
<link rel="stylesheet" href="src/ui/tutorial.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha384-nRgPTkuX86pH8yjPJUAFuASXQSSl2/bBUiNV47vSYpKFxHJhbcrGnmlYpYJMeD7a" crossorigin="anonymous" onerror="console.error('Font Awesome failed to load'); document.body.classList.add('fa-failed'); document.getElementById('cdn-warning').hidden=false;">
<style>
:root {
--color-bg: #ffffff;
--color-surface: #f8fafc;
--color-surface-raised: #e2e8f0;
--color-primary: #00693e;
--color-primary-light: #1a8a5a;
--color-secondary: #267aba;
--color-tertiary: #10b981;
--color-accent: #d97706;
--color-text: #0f172a;
--color-text-muted: #64748b;
--color-correct: #059669;
--color-incorrect: #dc2626;
--color-border: rgba(203,213,225,1);
--color-glow-primary: rgba(0,105,62,0.15);
--color-glow-secondary: rgba(38,122,186,0.12);
--font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
--header-height: 56px;
--video-sidebar-width: 380px;
--quiz-sidebar-width: 380px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
font-family: var(--font-body);
background-color: var(--color-bg);
color: var(--color-text);
overflow: hidden;
height: 100vh;
height: 100dvh; /* accounts for mobile browser chrome */
width: 100vw;
}
:focus-visible {
outline: 2px solid var(--color-secondary);
outline-offset: 2px;
}
.skip-link {
position: absolute;
top: -100px;
left: 0;
background: var(--color-primary);
color: #fff;
padding: 0.5rem 1rem;
z-index: 9999;
text-decoration: none;
font-weight: bold;
font-family: var(--font-body);
transition: top 0.2s;
}
.skip-link:focus { top: 0; }
body.fa-failed .fa-map::before { content: "Map"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-brain::before { content: "Learn"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-graduation-cap::before { content: "Research"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-circle-info::before { content: "Info"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-arrow-up::before { content: "Start"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-check::before { content: "✓"; font-style: normal; }
body.fa-failed .fa-times::before { content: "✕"; font-style: normal; }
body.fa-failed .fa-share-nodes::before { content: "Share"; font-style: normal; font-size: 0.9em; }
body.fa-failed .fa-chevron-left::before { content: "◀"; font-style: normal; }
body.fa-failed .fa-chevron-right::before { content: "▶"; font-style: normal; }
body.fa-failed .fa-rotate-right::before { content: "↻"; font-style: normal; }
body.fa-failed .fa-download::before { content: "↓"; font-style: normal; }
body.fa-failed .fa-upload::before { content: "↑"; font-style: normal; }
body.fa-failed .fa-lightbulb::before { content: "💡"; font-style: normal; }
body.fa-failed .fa-linkedin::before { content: "in"; font-style: normal; font-size: 0.85em; font-weight: bold; }
body.fa-failed .fa-x-twitter::before { content: "𝕏"; font-style: normal; }
body.fa-failed .fa-bluesky::before { content: "☁"; font-style: normal; }
body.fa-failed .fa-copy::before { content: "📋"; font-style: normal; }
body.fa-failed .fa-trophy::before { content: "🏆"; font-style: normal; }
#app {
display: grid;
grid-template-rows: var(--header-height) 1fr;
height: 100%;
overflow: hidden;
}
#app-header {
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
box-shadow: 0 1px 12px var(--color-glow-primary);
padding: 0 1.25rem;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
max-width: 100vw;
box-sizing: border-box;
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-right {
display: flex; align-items: center; gap: 0.5rem;
overflow-x: scroll; overflow-y: hidden;
scrollbar-width: none; /* Firefox */
-webkit-overflow-scrolling: touch;
overscroll-behavior-x: contain;
flex-shrink: 1; min-width: 0;
margin-left: auto;
}
.header-right::-webkit-scrollbar { display: none; }
.header-actions {
display: flex; align-items: center; gap: 0.5rem;
margin-left: 0.75rem;
overflow-x: scroll; overflow-y: hidden;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
overscroll-behavior-x: contain;
flex-shrink: 1; min-width: 0;
}
.header-actions::-webkit-scrollbar { display: none; }
.header-actions .btn-icon,
.header-actions .control-btn { flex-shrink: 0; }
.header-right .btn-icon,
.header-right .control-btn { flex-shrink: 0; }
.logo {
font-family: var(--font-heading);
font-weight: 700;
font-size: 1rem;
color: #00693e;
letter-spacing: -0.02em;
transition: opacity 0.4s ease;
}
.domain-selector { font-size: 0.85rem; }
.btn-icon {
min-width: 38px;
min-height: 38px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: 1.5px solid var(--color-border);
border-radius: 8px;
color: var(--color-text-muted);
cursor: pointer;
font-size: 0.95rem;
transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-icon:hover:not(:disabled) {
color: var(--color-primary);
border-color: var(--color-primary);
box-shadow: 0 0 10px var(--color-glow-primary);
}
.btn-icon:disabled {
opacity: 0.35;
cursor: not-allowed;
}
/* ── Custom tooltip (JS-positioned, appended to body) ── */
.ui-tooltip {
position: fixed;
pointer-events: none;
z-index: 99999;
background: var(--color-surface);
color: var(--color-text);
padding: 6px 10px;
border-radius: 6px;
font-size: 0.72rem;
font-family: var(--font-body);
font-weight: 400;
line-height: 1.4;
white-space: nowrap;
border: 1.5px solid var(--color-border);
box-shadow: 0 4px 16px rgba(0,0,0,0.35);
opacity: 0;
transition: opacity 0.15s ease;
}
.ui-tooltip.visible { opacity: 1; }
#app-main {
display: flex;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
#map-container {
flex: 1;
min-width: 0;
position: relative;
z-index: 1;
background-color: var(--color-bg);
touch-action: none;
}
#landing {
position: absolute;
inset: 0;
background: transparent;
z-index: 50;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 2rem;
transition: opacity 0.5s ease;
}
#landing.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
/* Hide panels on welcome screen — no transition flash */
#app[data-screen="welcome"] #video-panel,
#app[data-screen="welcome"] #quiz-panel {
transition: none;
visibility: hidden;
}
#particle-canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: auto;
}
.landing-content {
position: relative;
z-index: 1;
max-width: 600px;
color: var(--color-text);
pointer-events: none;
}
.landing-content a,
.landing-content button,
.landing-content .custom-select {
pointer-events: auto;
}
.landing-content h1 {
font-family: var(--font-heading);
font-size: 2.5rem;
margin-bottom: 0.75rem;
font-weight: 700;
letter-spacing: -0.03em;
color: #00693e;
}
.landing-content h2 {
font-family: var(--font-body);
font-size: 1rem;
color: var(--color-text-muted);
margin-bottom: 2.5rem;
font-weight: 400;
line-height: 1.5;
}
.landing-content p {
font-family: var(--font-body);
line-height: 1.7;
margin-bottom: 1.25rem;
font-size: 0.9rem;
color: var(--color-text);
text-align: left;
}
.landing-content p i {
color: #555;
width: 1.5em;
text-align: center;
}
.landing-content a {
color: var(--color-primary);
text-decoration: underline;
text-underline-offset: 2px;
transition: color 0.2s ease;
}
.landing-content a:hover {
color: var(--color-primary-light);
}
.landing-start-btn {
margin-top: 2rem;
padding: 0.85rem 2.5rem;
font-family: var(--font-heading);
font-size: 1.1rem;
font-weight: 700;
color: #fff;
background: var(--color-primary);
border: none;
border-radius: 8px;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
box-shadow: 0 4px 12px rgba(0, 105, 62, 0.3);
}
.landing-start-btn:hover {
background: var(--color-primary-light);
box-shadow: 0 6px 20px rgba(0, 105, 62, 0.4);
transform: translateY(-1px);
}
.landing-start-btn:active {
transform: translateY(0);
box-shadow: 0 2px 8px rgba(0, 105, 62, 0.3);
}
.custom-select {
position: relative;
display: inline-block;
}
.custom-select-trigger {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
font-family: var(--font-body);
font-size: 0.85rem;
padding: 0.4rem 0.75rem;
border-radius: 6px;
border: 1.5px solid var(--color-border);
background: var(--color-surface-raised);
color: var(--color-text);
cursor: pointer;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
max-width: 240px;
white-space: nowrap;
}
.custom-select-trigger:hover,
.custom-select-trigger:focus {
border-color: var(--color-primary);
box-shadow: 0 0 8px var(--color-glow-primary);
}
.custom-select-arrow {
display: flex; align-items: center;
font-size: 0.75rem;
color: var(--color-text-muted);
transition: transform 0.2s;
}
.custom-select.open .custom-select-arrow {
transform: rotate(180deg);
}
.custom-select-options {
display: none;
position: absolute;
top: calc(100% + 4px);
left: 0;
min-width: 100%;
max-height: 320px;
overflow-y: auto;
background: var(--color-surface);
border: 1.5px solid var(--color-border);
border-radius: 6px;
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
z-index: 200;
padding: 4px 0;
}
.custom-select.open .custom-select-options {
display: block;
}
.custom-select-options::-webkit-scrollbar { width: 5px; }
.custom-select-options::-webkit-scrollbar-track { background: transparent; }
.custom-select-options::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.custom-select-options::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
.custom-select-option {
font-family: var(--font-body);
font-size: 0.85rem;
padding: 0.5rem 0.75rem;
color: var(--color-text);
cursor: pointer;
transition: background 0.15s, color 0.15s;
white-space: nowrap;
}
.custom-select-option:hover,
.custom-select-option.focused {
background: var(--color-surface-raised);
color: var(--color-primary);
}
.custom-select-option--child {
font-size: 0.8rem;
color: var(--color-text-muted);
}
.custom-select-option--child:hover,
.custom-select-option--child.focused {
color: var(--color-primary);
}
#quiz-panel {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: var(--quiz-sidebar-width);
background: var(--color-surface);
box-shadow: -2px 0 24px rgba(0,0,0,0.3), -1px 0 0 var(--color-border);
z-index: 10;
display: flex;
flex-direction: column;
padding: 0.6rem 1.25rem;
overflow: visible;
transform: translateX(100%);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
will-change: transform;
}
#quiz-panel.open {
transform: translateX(0);
}
/* Scrolling handled by .quiz-content so toggle button can overflow */
#quiz-panel.open .quiz-content {
overflow-y: auto;
overflow-x: hidden;
flex: 1;
min-height: 0;
}
.quiz-toggle-btn {
position: absolute;
top: 50%;
left: -28px;
transform: translateY(-50%);
z-index: 11;
width: 28px;
height: 56px;
border: 1.5px solid var(--color-border);
border-right: none;
border-radius: 8px 0 0 8px;
background: var(--color-surface);
color: var(--color-text-muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.4s ease;
box-shadow: -2px 0 8px rgba(0,0,0,0.15);
}
.quiz-toggle-btn:hover {
color: var(--color-primary);
border-color: var(--color-primary);
box-shadow: -2px 0 12px var(--color-glow-primary);
}
.quiz-toggle-btn[hidden] { display: none; }
/* Drawer pull: hidden on desktop, shown on mobile via media query */
.drawer-pull { display: none; }
.resize-handle {
position: absolute;
left: 0; top: 0; bottom: 0;
width: 6px;
cursor: col-resize;
z-index: 11;
background: transparent;
transition: background 0.2s;
}
.resize-handle:hover,
.resize-handle.active {
background: var(--color-primary);
box-shadow: 0 0 8px var(--color-glow-primary);
}
#quiz-panel::-webkit-scrollbar { width: 5px; }
#quiz-panel::-webkit-scrollbar-track { background: transparent; }
#quiz-panel::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
#quiz-panel::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
#minimap-container {
position: absolute;
bottom: 20px;
left: 20px;
width: 200px;
height: 150px;
background: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(0, 105, 62, 0.3);
border-radius: 8px;
z-index: 5;
overflow: hidden;
transition: opacity 0.3s;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
margin: 0;
padding: 0;
}
#minimap-container[hidden] { display: none; }
#progress-overlay {
position: absolute;
top: 0; left: 0;
width: 100%;
height: 3px;
background: transparent;
z-index: 200;
pointer-events: none;
}
.modal {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.7);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
pointer-events: none;
transition: opacity 0.25s ease;
}
.modal:not([hidden]) { opacity: 1; pointer-events: auto; }
.modal-content {
background: var(--color-surface);
color: var(--color-text);
padding: 2rem;
border-radius: 12px;
max-width: 600px;
width: 90%;
max-height: 85vh;
overflow-y: auto;
box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
border: 1.5px solid var(--color-border);
font-family: var(--font-body);
}
.modal-content a {
color: var(--color-secondary);
text-decoration: underline;
text-underline-offset: 2px;
transition: color 0.2s;
}
.modal-content a:hover {
color: var(--color-primary);
}
.modal-content {
position: relative;
}
.modal-close-x {
position: absolute;
top: 0.75rem;
right: 0.75rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: 1.5px solid var(--color-border);
border-radius: 6px;
color: var(--color-text-muted);
cursor: pointer;
font-size: 1rem;
transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
z-index: 1;
padding: 0;
}
.modal-close-x:hover {
color: var(--color-text);
border-color: var(--color-text-muted);
background: var(--color-surface-raised);
}
/* Loading modal */
#loading-modal {
z-index: 1100;
background: rgba(248, 250, 252, 0.92);
}
#loading-modal:not([hidden]) { opacity: 1; pointer-events: auto; }
.loading-modal-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
padding: 2.5rem 3rem;
background: var(--color-bg);
border-radius: 12px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
border: 1.5px solid var(--color-border);
min-width: 260px;
}
.loading-spinner {
width: 36px;
height: 36px;
border: 3px solid var(--color-surface-raised);
border-top-color: var(--color-primary);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.loading-track {
width: 100%;
height: 6px;
background: var(--color-surface-raised);
border-radius: 3px;
overflow: hidden;
}
.loading-fill {
height: 100%;
width: 0%;
background: var(--color-primary);
border-radius: 3px;
transition: width 0.2s ease;
}
/* Welcome screen: hide logo text, trophy, suggest, dropdown, and minimap */
#app[data-screen="welcome"] .logo span { display: none; }
#app[data-screen="welcome"] #trophy-btn { display: none; }
#app[data-screen="welcome"] #suggest-btn { display: none; }
#app[data-screen="welcome"] #tutorial-btn { display: none; }
#app[data-screen="welcome"] #minimap-container { display: none; }
#app[data-screen="welcome"] .domain-selector .custom-select { display: none; }
#app[data-screen="welcome"] .control-btn:not([aria-label="Import saved progress"]) { display: none; }
/* Welcome screen: hide action buttons except upload (which is in .header-actions) */
#app[data-screen="welcome"] .header-actions .btn-icon:not([aria-label="Import saved progress"]) { display: none; }
.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;
}
[hidden] { display: none !important; }
.notice-banner {
position: fixed;
top: var(--header-height);
left: 0;
right: 0;
background: var(--color-surface);
border-left: 4px solid var(--color-accent);
padding: 1rem 1.25rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
z-index: 150;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
animation: slideDown 0.3s ease-out;
font-size: 0.95rem;
color: var(--color-text);
}
.notice-banner.info {
border-left-color: var(--color-secondary);
}
.notice-banner-content {
flex: 1;
display: flex;
align-items: center;
gap: 0.75rem;
}
.notice-banner-dismiss {
flex-shrink: 0;
background: transparent;
border: none;
color: var(--color-text-muted);
cursor: pointer;
font-size: 1.25rem;
padding: 0.25rem;
display: flex;
align-items: center;
justify-content: center;
transition: color 0.2s ease;
}
.notice-banner-dismiss:hover {
color: var(--color-text);
}
.notice-banner.dismissing {
animation: fadeUp 0.3s ease-out forwards;
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-100%);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeUp {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(-100%);
}
}
#cdn-warning {
position: absolute; top: 0; left: 0; right: 0;
background: #ffeb3b; color: #000; font-size: 0.8rem;
padding: 4px; text-align: center; z-index: 2000;
}
@media (max-width: 768px) {
:root { --video-sidebar-width: 50%; --quiz-sidebar-width: 50%; }
#app-header { padding: 0 1rem; }
/* Hide logo text on narrow screens; keep icon */
.logo span { display: none; }
.logo { white-space: nowrap; }
#quiz-panel.open {
width: 50%;
}
}
/* Rotate overlay for phones that can't orientation-lock */
#rotate-overlay {
position: fixed; inset: 0; z-index: 10000;
background: rgba(0,0,0,0.85);
display: flex; align-items: center; justify-content: center;
}
#rotate-overlay[hidden] { display: none; }
.rotate-overlay-content {
text-align: center; color: white; padding: 2rem;
}
.rotate-icon {
font-size: 3rem; margin-bottom: 1rem;
display: block;
animation: rotate-hint 1.5s ease-in-out infinite;
}
@keyframes rotate-hint {
0%, 100% { transform: rotate(0deg); }
50% { transform: rotate(90deg); }
}
.rotate-overlay-content p {
font-size: 1.1rem; max-width: 280px; margin: 0 auto;
}
@media (max-width: 480px) {
:root { --header-height: 50px; }
#app-header { padding: 0 0.5rem; }
/* Hide logo on map screen to free header space for dropdown + buttons */
#app[data-screen="map"] .logo { display: none; }
.logo span { display: none; }
.logo { font-size: 0.95rem; }
.header-left { gap: 0.3rem; flex: 0 0 auto; }
.header-actions { gap: 0.25rem; flex: 1; min-width: 0; }
.header-right { gap: 0.25rem; flex: 1; min-width: 0; justify-content: flex-end; }
.btn-icon, .control-btn { min-width: 34px; min-height: 34px; font-size: 0.85rem; }
/* Make dropdown arrow easier to see on mobile */
.custom-select-arrow { font-size: 0.9rem; }
/* Hide custom tooltips on touch devices */
.ui-tooltip { display: none !important; }
/* ── Welcome screen: compact for small portrait screens ── */
#landing { padding: 0.75rem 1rem; overflow-y: auto; }
.landing-content h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.landing-content h2 { font-size: 0.85rem; margin-bottom: 0.75rem; }
.landing-content p { font-size: 0.8rem; line-height: 1.4; margin-bottom: 0.5rem; }
.landing-start-btn { margin-top: 0.75rem; padding: 0.6rem 1.8rem; font-size: 0.95rem; }
/* ── Quiz panel: compact mode buttons + auto-advance for mobile ── */
.modes-wrapper { gap: 0.2rem; margin-bottom: 0.2rem; padding-bottom: 0.2rem; }
.mode-btn { width: 28px; height: 28px; font-size: 0.75rem; }
.auto-advance-label { font-size: 0.7rem; margin: 0; padding: 0; line-height: 1; }
.auto-advance-label input { width: 24px; height: 14px; }
.auto-advance-wrap { margin: 0 !important; padding: 0 0.8rem !important; }
/* ── Quiz panel: bottom sheet ── */
#quiz-panel {
position: fixed;
top: auto; bottom: 0; left: 0; right: 0;
width: 100vw !important;
/* Drawer pull (32px) + safe-area (fallback 16px for Android gesture bar) */
height: calc(32px + env(safe-area-inset-bottom, 16px));
padding: 0;
padding-bottom: env(safe-area-inset-bottom, 16px);
transform: none;
border-radius: 16px 16px 0 0;
box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
z-index: 20;
transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
display: flex;
flex-direction: column;
background: var(--color-surface);
}
#quiz-panel:not(.open) .quiz-content { display: none; }
/* Hide everything except drawer pull when closed (important overrides inline styles) */
#quiz-panel:not(.open) > *:not(.drawer-pull) { display: none !important; }
#quiz-panel.open {
width: 100vw !important; height: 55vh;
padding: 0;
overflow: hidden; /* Panel itself doesn't scroll; .quiz-content does */
}
#quiz-panel.open .quiz-content {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
min-height: 0; /* Allow flex child to shrink below content size */
padding: 0.75rem 1rem 60px;
}
/* Add horizontal padding to progress bar when open */
#quiz-panel.open > *:not(.drawer-pull):not(.quiz-content) {
padding-left: 1rem;
padding-right: 1rem;
}
/* Compact quiz text on mobile */
#quiz-panel .quiz-question { font-size: 0.9rem; line-height: 1.35; }
#quiz-panel .quiz-option { padding: 0.5rem 0.75rem; font-size: 0.85rem; min-height: 44px; }
/* ── Drawer pull handle (mobile only) ── */
.drawer-pull {
display: block;
position: relative;
height: 32px;
width: 100% !important;
cursor: pointer;
flex-shrink: 0;
touch-action: none;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
order: -1; /* Always appear first in flex column */
padding: 0 !important;
margin: 0 !important;
box-sizing: border-box;
}
.drawer-pull-bar {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 56px;
height: 6px;
border-radius: 3px;
background: #999;
}
/* ── Quiz toggle: hidden on mobile (drawer pull replaces it) ── */
.quiz-toggle-btn { display: none !important; }
/* ── Video panel: bottom sheet on mobile (not hidden) ── */
#video-panel {
display: flex !important; /* Override video-panel.js display:none */
position: absolute;
top: auto; bottom: 0; left: 0; right: 0;
width: 100% !important; height: 0;
min-width: 0;
padding: 0;
transform: none;
border-radius: 16px 16px 0 0;
box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
z-index: 21; /* Above quiz panel */
transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-direction: column;
overflow: hidden;
}
#video-panel.open {
width: 100% !important; height: 55vh;
padding: 1rem 1.25rem;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.video-toggle-btn { display: none !important; } /* Hide side tab; use header button instead */
/* ── Domain dropdown: use fixed positioning so it's not clipped by overflow:hidden ── */
.domain-selector { flex-grow: 1; max-width: 160px; }
.custom-select-options {
position: fixed !important;
top: var(--header-height) !important;
bottom: auto !important;
left: 0 !important;
right: 0 !important;
max-height: 50vh;
min-width: unset;
border-radius: 0 0 12px 12px;
}
#minimap-container { display: none; }
.resize-handle { display: none; }
/* Colorbar: top-right on mobile to avoid quiz panel overlap */
.map-colorbar {
bottom: auto !important;
top: 8px !important;
right: 8px !important;
height: 80px !important;
z-index: 16 !important;
}
button, a, .quiz-option {
min-height: 44px;
min-width: 44px;
touch-action: manipulation;
}
}
/* ── Landscape phone: short viewport, wide screen ── */
@media (max-height: 500px) and (orientation: landscape) {
:root { --header-height: 44px; }
/* Compact welcome screen for short landscape viewports */
#landing { padding: 0.5rem 1rem; overflow-y: auto; }
.landing-content h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.landing-content h2 { font-size: 0.8rem; margin-bottom: 0.5rem; }
.landing-content p { font-size: 0.75rem; line-height: 1.3; margin-bottom: 0.4rem; }
.landing-start-btn { margin-top: 0.5rem; padding: 0.5rem 1.5rem; font-size: 0.9rem; }
#minimap-container {
width: 160px; height: 120px;
bottom: 12px; left: 12px;
z-index: 3; /* Below panels and toggles */
}
/* Quiz panel: right-side drawer in landscape */
#quiz-panel.open { height: auto; max-height: 100%; }
/* Video panel: left-side drawer in landscape */
#video-panel.open { height: auto; max-height: 100%; }
/* Compact quiz panel for landscape phones (#58) */
.modes-wrapper { gap: 0.2rem; margin-bottom: 0.15rem; padding-bottom: 0.15rem; }
.mode-btn { width: 26px; height: 26px; font-size: 0.7rem; }
.auto-advance-label { font-size: 0.7rem; margin: 0; padding: 0; line-height: 1; }
.auto-advance-label input { width: 24px; height: 14px; }
.auto-advance-wrap { margin: 0 !important; padding: 0 0.8rem !important; }
#quiz-panel .quiz-question { font-size: 0.78rem; line-height: 1.15; margin: 0.1rem 0; }
#quiz-panel .quiz-instruction { display: none; }
#quiz-panel .quiz-option { padding: 0.2rem 0.5rem; font-size: 0.76rem; min-height: 28px; }
#quiz-panel .quiz-content { padding: 0.2rem 0.8rem 0.2rem; gap: 0.05rem; }
#quiz-panel .quiz-feedback-area { gap: 0.15rem; }
#quiz-panel .skip-btn { font-size: 0.76rem; padding: 0.2rem 0.5rem; min-height: 28px; }
#quiz-panel .progress-summary { font-size: 0.7rem; margin: 0; padding: 0 0.8rem; line-height: 1.2; }
#quiz-panel .progress-summary + div { height: 2px; margin: 0 0.8rem; }
.quiz-toggle-btn { font-size: 0.8rem !important; }
}
</style>
</head>
<body>
<a href="#map-container" class="skip-link" data-skip-to-content>Skip to content</a>
<div id="cdn-warning" hidden>⚠ CDN loading failed: Some visual elements may not render correctly. Check your internet connection.</div>
<div id="app" data-screen="welcome">
<header id="app-header">
<div class="header-left">
<div class="logo" data-tooltip="Map my knowledge!"><i class="fa-solid fa-map"></i> <span>Knowledge Mapper</span></div>
<!-- Domain selector placeholder -->
<div class="domain-selector" hidden aria-label="Select knowledge domain"></div>
</div>
<div class="header-actions"></div>
<div class="header-right">
<button id="trophy-btn" class="btn-icon" aria-label="My areas of expertise" data-tooltip="My areas of expertise" disabled>
<i class="fa-solid fa-trophy"></i>
</button>
<button id="suggest-btn" class="btn-icon" aria-label="Suggest articles to learn" data-tooltip="Suggested learning" disabled>
<i class="fa-solid fa-graduation-cap"></i>
</button>
<button id="share-btn" class="btn-icon" aria-label="Share your knowledge map" data-tooltip="Share">
<i class="fa-solid fa-share-nodes"></i>
</button>
<button id="tutorial-btn" class="btn-icon" aria-label="Start tutorial" data-tooltip="Tutorial" hidden>
<i class="fa-solid fa-circle-question"></i>
</button>
<button id="about-btn" class="btn-icon" aria-label="About this project" data-tooltip="About">
<i class="fa-solid fa-circle-info"></i>
</button>
</div>
</header>
<main id="app-main">
<!-- Landing / Loading Screen -->
<section id="landing">
<canvas id="particle-canvas"></canvas>
<div class="landing-content">
<h1>Knowledge Mapper</h1>
<h2>Map out (an approximation of) everything you know!</h2>
<p>
<i class="fa-solid fa-map" style="margin-right: 8px;"></i>
Build and interact with a visualization of your own knowledge
</p>
<p>
<i class="fa-solid fa-brain" style="margin-right: 8px;"></i>
Answer questions to watch our system's model of <em>you</em> update in real time
</p>
<p>
<i class="fa-solid fa-graduation-cap" style="margin-right: 8px;"></i>
Click <a href="#" id="landing-info-link" style="white-space:nowrap;"><i class="fa-solid fa-circle-info" style="margin: 0 2px;"></i> info</a> in the upper right to learn more, or read our <a href="https://osf.io/preprints/psyarxiv/dh3q2" target="_blank" rel="noopener">research paper</a>.
</p>
<button id="landing-start-btn" class="landing-start-btn">Map my knowledge!</button>