-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeaky-peek-course.html
More file actions
2199 lines (2050 loc) · 123 KB
/
peaky-peek-course.html
File metadata and controls
2199 lines (2050 loc) · 123 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">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inside Peaky Peek — An Interactive Course</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
/* ============================================================
DESIGN SYSTEM
============================================================ */
:root {
/* Backgrounds */
--color-bg: #FAF7F2;
--color-bg-warm: #F5F0E8;
--color-bg-code: #1E1E2E;
--color-text: #2C2A28;
--color-text-secondary: #6B6560;
--color-text-muted: #9E9790;
--color-border: #E5DFD6;
--color-border-light: #EEEBE5;
--color-surface: #FFFFFF;
--color-surface-warm: #FDF9F3;
/* Accent — teal for "X-ray vision" debugging */
--color-accent: #2A7B9B;
--color-accent-hover: #236B87;
--color-accent-light: #E4F2F7;
--color-accent-muted: #5CA0BA;
/* Semantic */
--color-success: #2D8B55;
--color-success-light: #E8F5EE;
--color-error: #C93B3B;
--color-error-light: #FDE8E8;
--color-info: #2A7B9B;
--color-info-light: #E4F2F7;
/* Actor colors */
--color-actor-1: #2A7B9B;
--color-actor-2: #D94F30;
--color-actor-3: #7B6DAA;
--color-actor-4: #D4A843;
--color-actor-5: #2D8B55;
/* Typography */
--font-display: 'Bricolage Grotesque', Georgia, serif;
--font-body: 'DM Sans', -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
--text-4xl: 2.25rem;
--text-5xl: 3rem;
--text-6xl: 3.75rem;
--leading-tight: 1.15;
--leading-snug: 1.3;
--leading-normal: 1.6;
--leading-loose: 1.8;
/* Spacing */
--space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
--space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
--space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
--space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
--content-width: 800px;
--content-width-wide: 1000px;
--nav-height: 50px;
--radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-full: 9999px;
/* Shadows */
--shadow-sm: 0 1px 2px rgba(44,42,40,0.05);
--shadow-md: 0 4px 12px rgba(44,42,40,0.08);
--shadow-lg: 0 8px 24px rgba(44,42,40,0.1);
--shadow-xl: 0 16px 48px rgba(44,42,40,0.12);
/* Animation */
--ease-out: cubic-bezier(0.16,1,0.3,1);
--ease-in-out: cubic-bezier(0.65,0,0.35,1);
--duration-fast: 150ms;
--duration-normal: 300ms;
--duration-slow: 500ms;
--stagger-delay: 120ms;
}
/* ============================================================
BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-snap-type: y proximity; scroll-behavior: smooth; }
body {
font-family: var(--font-body);
font-size: var(--text-base);
line-height: var(--leading-normal);
color: var(--color-text);
background: var(--color-bg);
background-image: radial-gradient(ellipse at 20% 50%, rgba(42,123,155,0.03) 0%, transparent 50%);
-webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-display); line-height: var(--leading-snug); }
pre, code { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; }
pre::-webkit-scrollbar, .translation-code::-webkit-scrollbar { display: none; }
/* ============================================================
SCROLLBAR
============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
/* ============================================================
ANIMATE IN
============================================================ */
.animate-in {
opacity: 0; transform: translateY(20px);
transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
.stagger-children > .animate-in { transition-delay: calc(var(--stagger-index, 0) * var(--stagger-delay)); }
/* ============================================================
NAVIGATION
============================================================ */
.nav {
position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
background: rgba(250,247,242,0.9); backdrop-filter: blur(12px);
border-bottom: 1px solid var(--color-border-light);
}
.progress-bar {
position: absolute; bottom: 0; left: 0; height: 3px;
background: var(--color-accent); width: 0;
transition: width 0.1s linear;
}
.nav-inner {
max-width: var(--content-width-wide); margin: 0 auto;
padding: var(--space-3) var(--space-6);
display: flex; align-items: center; justify-content: space-between;
}
.nav-title {
font-family: var(--font-display); font-weight: 700;
font-size: var(--text-sm); color: var(--color-text-secondary);
}
.nav-dots { display: flex; gap: var(--space-2); }
.nav-dot {
width: 12px; height: 12px; border-radius: 50%;
border: 2px solid var(--color-text-muted); background: transparent;
cursor: pointer; transition: all var(--duration-normal);
position: relative;
}
.nav-dot.current { border-color: var(--color-accent); background: var(--color-accent); box-shadow: 0 0 8px rgba(42,123,155,0.3); }
.nav-dot.visited { background: var(--color-accent); border-color: var(--color-accent); }
.nav-dot::after {
content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px);
left: 50%; transform: translateX(-50%); white-space: nowrap;
font-size: var(--text-xs); color: var(--color-text-secondary);
background: var(--color-bg-code); color: #CDD6F4;
padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
opacity: 0; pointer-events: none; transition: opacity var(--duration-fast);
}
.nav-dot:hover::after { opacity: 1; }
/* ============================================================
HERO
============================================================ */
.hero {
min-height: 100vh; display: flex; align-items: center; justify-content: center;
padding: var(--space-16) var(--space-6);
background: linear-gradient(170deg, var(--color-bg) 0%, var(--color-bg-warm) 100%);
text-align: center;
}
.hero-content { max-width: 640px; }
.hero-badge {
display: inline-block; font-family: var(--font-mono);
font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em;
color: var(--color-accent); background: var(--color-accent-light);
padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
margin-bottom: var(--space-6);
}
.hero h1 {
font-size: var(--text-5xl); font-weight: 800;
color: var(--color-text); margin-bottom: var(--space-6);
}
.hero h1 span { color: var(--color-accent); }
.hero p {
font-size: var(--text-lg); color: var(--color-text-secondary);
line-height: var(--leading-loose); margin-bottom: var(--space-8);
}
.hero-cta {
display: inline-flex; align-items: center; gap: var(--space-2);
background: var(--color-accent); color: white;
padding: var(--space-4) var(--space-8); border-radius: var(--radius-full);
font-family: var(--font-display); font-weight: 600; font-size: var(--text-base);
text-decoration: none; border: none; cursor: pointer;
transition: background var(--duration-fast), transform var(--duration-fast);
}
.hero-cta:hover { background: var(--color-accent-hover); transform: translateY(-2px); }
/* ============================================================
MODULES
============================================================ */
.module {
min-height: 100vh; scroll-snap-align: start;
padding: var(--space-16) var(--space-6);
padding-top: calc(var(--nav-height) + var(--space-12));
}
.module-content { max-width: var(--content-width); margin: 0 auto; }
.module-header { margin-bottom: var(--space-12); }
.module-number {
font-family: var(--font-display); font-size: var(--text-6xl); font-weight: 800;
color: var(--color-accent); opacity: 0.15; display: block; line-height: 1;
}
.module-title { font-size: var(--text-4xl); font-weight: 700; margin-top: var(--space-2); }
.module-subtitle {
font-size: var(--text-lg); color: var(--color-text-secondary);
margin-top: var(--space-3); line-height: var(--leading-normal);
}
.screen { margin-bottom: var(--space-12); }
.screen-heading {
font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-6);
}
.screen p { margin-bottom: var(--space-4); max-width: var(--content-width); }
/* ============================================================
CODE ↔ ENGLISH TRANSLATION BLOCKS
============================================================ */
.translation-block {
display: grid; grid-template-columns: 1fr 1fr; gap: 0;
border-radius: var(--radius-md); overflow: hidden;
box-shadow: var(--shadow-md); margin: var(--space-8) 0;
}
.translation-code {
background: var(--color-bg-code); color: #CDD6F4;
padding: var(--space-6); font-family: var(--font-mono);
font-size: var(--text-sm); line-height: 1.8; position: relative;
overflow-x: hidden;
}
.translation-code pre, .translation-code code { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; }
.translation-english {
background: var(--color-surface-warm); padding: var(--space-6);
font-size: var(--text-sm); line-height: 1.8;
border-left: 3px solid var(--color-accent);
}
.translation-label {
position: absolute; top: var(--space-2); right: var(--space-3);
font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5;
font-family: var(--font-mono);
}
.translation-english .translation-label { color: var(--color-text-muted); }
.tl { margin-bottom: var(--space-2); color: var(--color-text-secondary); }
.tl strong { color: var(--color-text); }
/* Syntax highlighting */
.code-keyword { color: #CBA6F7; }
.code-string { color: #A6E3A1; }
.code-function { color: #89B4FA; }
.code-comment { color: #6C7086; }
.code-number { color: #FAB387; }
.code-property { color: #F9E2AF; }
.code-operator { color: #94E2D5; }
.code-decorator { color: #89B4FA; }
.code-class { color: #89DCEB; }
/* ============================================================
PATTERN / FEATURE CARDS
============================================================ */
.pattern-cards {
display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4);
}
.pattern-card {
background: var(--color-surface); border-radius: var(--radius-md);
padding: var(--space-6); box-shadow: var(--shadow-sm);
transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal);
}
.pattern-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pattern-icon {
width: 48px; height: 48px; border-radius: var(--radius-md);
display: flex; align-items: center; justify-content: center;
font-size: 1.25rem; margin-bottom: var(--space-3);
}
.pattern-title { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; margin-bottom: var(--space-2); }
.pattern-desc { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: var(--leading-normal); }
/* ============================================================
ICON-ROWS
============================================================ */
.icon-rows { display: flex; flex-direction: column; gap: var(--space-4); }
.icon-row {
display: flex; align-items: center; gap: var(--space-4);
padding: var(--space-4); background: var(--color-surface);
border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.icon-row p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.icon-circle {
width: 48px; height: 48px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 1.25rem; flex-shrink: 0;
}
/* ============================================================
STEP CARDS
============================================================ */
.step-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.step-card {
display: flex; align-items: flex-start; gap: var(--space-4);
padding: var(--space-4) var(--space-5); background: var(--color-surface);
border-radius: var(--radius-md); border-left: 3px solid var(--color-accent);
box-shadow: var(--shadow-sm);
}
.step-num {
width: 32px; height: 32px; border-radius: 50%;
background: var(--color-accent); color: white; font-weight: 700;
display: flex; align-items: center; justify-content: center;
font-family: var(--font-display); flex-shrink: 0; font-size: var(--text-sm);
}
.step-body strong { display: block; margin-bottom: var(--space-1); }
.step-body p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
/* ============================================================
CALLOUT BOXES
============================================================ */
.callout {
display: flex; gap: var(--space-4); padding: var(--space-5);
border-radius: var(--radius-md); margin: var(--space-8) 0;
}
.callout-accent { background: var(--color-accent-light); border-left: 4px solid var(--color-accent); }
.callout-info { background: var(--color-info-light); border-left: 4px solid var(--color-info); }
.callout-warning { background: var(--color-error-light); border-left: 4px solid var(--color-error); }
.callout-icon { font-size: 1.5rem; flex-shrink: 0; }
.callout-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); margin-bottom: var(--space-1); }
.callout-content p { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: var(--leading-normal); }
/* ============================================================
GLOSSARY TOOLTIPS
============================================================ */
.term {
border-bottom: 1.5px dashed var(--color-accent-muted);
cursor: pointer; position: relative;
}
.term:hover, .term.active { border-bottom-color: var(--color-accent); color: var(--color-accent); }
.term-tooltip {
position: fixed; background: var(--color-bg-code); color: #CDD6F4;
padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
font-size: var(--text-sm); font-family: var(--font-body);
line-height: var(--leading-normal);
width: max(200px, min(320px, 80vw));
box-shadow: var(--shadow-lg); pointer-events: none;
opacity: 0; transition: opacity var(--duration-fast); z-index: 10000;
}
.term-tooltip::after {
content: ''; position: absolute; top: 100%; left: 50%;
transform: translateX(-50%); border: 6px solid transparent;
border-top-color: var(--color-bg-code);
}
.term-tooltip.flip { bottom: auto; }
.term-tooltip.flip::after {
top: auto; bottom: 100%;
border-top-color: transparent; border-bottom-color: var(--color-bg-code);
}
.term-tooltip.visible { opacity: 1; }
/* ============================================================
QUIZZES
============================================================ */
.quiz-container { margin-top: var(--space-6); }
.quiz-question-block { margin-bottom: var(--space-6); }
.quiz-question {
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-base); margin-bottom: var(--space-4);
}
.quiz-options { display: flex; flex-direction: column; gap: var(--space-2); }
.quiz-option {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-4);
border: 2px solid var(--color-border); border-radius: var(--radius-sm);
background: var(--color-surface); cursor: pointer; width: 100%;
transition: border-color var(--duration-fast), background var(--duration-fast);
font-family: var(--font-body); font-size: var(--text-sm); text-align: left; color: var(--color-text);
}
.quiz-option:hover { border-color: var(--color-accent-muted); }
.quiz-option.selected { border-color: var(--color-accent); background: var(--color-accent-light); }
.quiz-option.correct { border-color: var(--color-success); background: var(--color-success-light); }
.quiz-option.incorrect { border-color: var(--color-error); background: var(--color-error-light); }
.quiz-option-radio {
width: 18px; height: 18px; border-radius: 50%;
border: 2px solid var(--color-border); transition: all var(--duration-fast); flex-shrink: 0;
}
.quiz-option.selected .quiz-option-radio {
border-color: var(--color-accent); background: var(--color-accent);
box-shadow: inset 0 0 0 3px white;
}
.quiz-feedback {
max-height: 0; overflow: hidden; opacity: 0;
transition: max-height var(--duration-normal), opacity var(--duration-normal);
font-size: var(--text-sm); border-radius: var(--radius-sm);
}
.quiz-feedback.show { max-height: 300px; opacity: 1; padding: var(--space-3); margin-top: var(--space-2); }
.quiz-feedback.success { background: var(--color-success-light); color: var(--color-success); }
.quiz-feedback.error { background: var(--color-error-light); color: var(--color-error); }
.quiz-check-btn, .quiz-reset-btn {
padding: var(--space-3) var(--space-6); border-radius: var(--radius-sm);
font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
cursor: pointer; border: none; transition: background var(--duration-fast);
margin-right: var(--space-2); margin-top: var(--space-2);
}
.quiz-check-btn { background: var(--color-accent); color: white; }
.quiz-check-btn:hover { background: var(--color-accent-hover); }
.quiz-reset-btn { background: var(--color-border); color: var(--color-text); }
.quiz-reset-btn:hover { background: var(--color-border-light); }
/* Scenario block */
.scenario-block {
background: var(--color-surface-warm); border: 1px solid var(--color-border-light);
border-radius: var(--radius-md); padding: var(--space-5); margin-bottom: var(--space-4);
}
.scenario-label {
font-family: var(--font-mono); font-size: var(--text-xs);
text-transform: uppercase; letter-spacing: 0.1em;
color: var(--color-accent); margin-bottom: var(--space-2);
}
/* ============================================================
GROUP CHAT
============================================================ */
.chat-window {
background: var(--color-surface); border-radius: var(--radius-md);
box-shadow: var(--shadow-md); overflow: hidden; margin: var(--space-8) 0;
}
.chat-header {
padding: var(--space-3) var(--space-5);
border-bottom: 1px solid var(--color-border-light);
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-sm); color: var(--color-text-secondary);
}
.chat-messages { padding: var(--space-5); min-height: 200px; max-height: 420px; overflow-y: auto; }
.chat-message {
display: none; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4);
animation: fadeSlideUp 0.3s var(--ease-out);
}
.chat-message.show { display: flex; }
.chat-avatar {
width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
color: white; font-weight: 700; font-size: var(--text-sm);
font-family: var(--font-display); flex-shrink: 0;
}
.chat-bubble {
background: var(--color-bg-warm); border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
padding: var(--space-3) var(--space-4); max-width: 80%;
}
.chat-sender { font-size: var(--text-xs); font-weight: 600; display: block; margin-bottom: var(--space-1); }
.chat-bubble p { margin: 0; font-size: var(--text-sm); color: var(--color-text); line-height: var(--leading-normal); }
.chat-typing {
display: none; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-5);
}
.chat-typing.show { display: flex; }
.typing-dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--color-text-muted);
animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.chat-controls {
display: flex; align-items: center; gap: var(--space-2);
padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border-light);
}
.chat-controls button {
padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
border: 1px solid var(--color-border); background: var(--color-surface);
font-family: var(--font-body); font-size: var(--text-xs);
cursor: pointer; transition: all var(--duration-fast); color: var(--color-text);
}
.chat-controls button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.chat-progress { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }
@keyframes fadeSlideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
/* ============================================================
MESSAGE FLOW ANIMATION
============================================================ */
.flow-animation {
background: var(--color-surface); border-radius: var(--radius-md);
box-shadow: var(--shadow-md); padding: var(--space-8); margin: var(--space-8) 0;
}
.flow-actors {
display: flex; justify-content: space-between; align-items: flex-end;
gap: var(--space-4); margin-bottom: var(--space-8); flex-wrap: wrap;
}
.flow-actor {
display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
transition: all var(--duration-normal) var(--ease-out);
}
.flow-actor.active { transform: scale(1.08); }
.flow-actor-icon {
width: 56px; height: 56px; border-radius: var(--radius-md);
display: flex; align-items: center; justify-content: center;
font-size: 1.5rem; box-shadow: var(--shadow-sm);
transition: box-shadow var(--duration-normal);
}
.flow-actor.active .flow-actor-icon {
box-shadow: 0 0 0 3px var(--color-accent), 0 0 20px rgba(42,123,155,0.25);
}
.flow-actor span { font-size: var(--text-xs); font-weight: 600; font-family: var(--font-display); color: var(--color-text-secondary); }
.flow-actor.active span { color: var(--color-accent); }
.flow-arrows {
display: flex; justify-content: center; align-items: center;
flex: 1; position: relative; min-height: 60px;
}
.flow-packet {
position: absolute; width: 36px; height: 36px;
background: var(--color-accent); border-radius: 50%;
display: none; align-items: center; justify-content: center;
color: white; font-size: var(--text-sm); font-weight: 700;
box-shadow: 0 0 12px rgba(42,123,155,0.4);
z-index: 2;
}
.flow-packet.animate {
display: flex;
animation: flowPulse 0.8s var(--ease-out);
}
.flow-step-label {
text-align: center; font-size: var(--text-sm);
color: var(--color-text-secondary); min-height: 3em;
line-height: var(--leading-normal); margin-bottom: var(--space-4);
padding: var(--space-3); background: var(--color-bg-warm);
border-radius: var(--radius-sm);
}
.flow-controls {
display: flex; align-items: center; gap: var(--space-2); justify-content: center;
}
.flow-controls button {
padding: var(--space-2) var(--space-5); border-radius: var(--radius-sm);
border: 1px solid var(--color-border); background: var(--color-surface);
font-family: var(--font-body); font-size: var(--text-sm);
cursor: pointer; transition: all var(--duration-fast); color: var(--color-text);
}
.flow-controls button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.flow-controls button:disabled { opacity: 0.4; cursor: default; }
.flow-progress { font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); }
@keyframes flowPulse { 0%{transform:scale(0.5);opacity:0} 50%{transform:scale(1.2)} 100%{transform:scale(1);opacity:1} }
/* ============================================================
ARCHITECTURE DIAGRAM
============================================================ */
.arch-diagram {
background: var(--color-surface); border-radius: var(--radius-md);
box-shadow: var(--shadow-md); padding: var(--space-8); margin: var(--space-8) 0;
}
.arch-zone {
margin-bottom: var(--space-6);
}
.arch-zone-label {
font-family: var(--font-mono); font-size: var(--text-xs);
text-transform: uppercase; letter-spacing: 0.1em;
color: var(--color-text-muted); margin-bottom: var(--space-3);
}
.arch-components {
display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3);
}
.arch-component {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-4); background: var(--color-bg);
border: 1px solid var(--color-border-light); border-radius: var(--radius-sm);
cursor: pointer; transition: all var(--duration-fast);
}
.arch-component:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.arch-component.active { border-color: var(--color-accent); background: var(--color-accent-light); box-shadow: var(--shadow-sm); }
.arch-icon { font-size: 1.25rem; }
.arch-component span { font-size: var(--text-sm); font-weight: 500; }
.arch-description {
margin-top: var(--space-4); padding: var(--space-4);
background: var(--color-surface-warm); border-radius: var(--radius-sm);
font-size: var(--text-sm); color: var(--color-text-secondary);
line-height: var(--leading-normal); min-height: 3em;
border-left: 3px solid var(--color-accent);
}
/* ============================================================
FILE TREE
============================================================ */
.file-tree { font-family: var(--font-mono); font-size: var(--text-sm); }
.ft-folder, .ft-file {
padding: var(--space-2) var(--space-3);
border-left: 2px solid var(--color-border-light); margin-left: var(--space-4);
}
.ft-folder.open > .ft-name { color: var(--color-accent); font-weight: 600; }
.ft-name::before { content: '\1F4C1 '; font-size: 0.9em; }
.ft-file .ft-name::before { content: '\1F4C4 '; font-size: 0.9em; }
.ft-desc { color: var(--color-text-secondary); font-family: var(--font-body); margin-left: var(--space-2); font-size: var(--text-xs); }
.ft-children { margin-left: var(--space-4); }
/* ============================================================
BADGE LIST
============================================================ */
.badge-list { display: flex; flex-direction: column; gap: var(--space-2); }
.badge-item {
display: flex; align-items: center; gap: var(--space-4);
padding: var(--space-3) var(--space-4);
border: 1px solid var(--color-border-light); border-radius: var(--radius-sm);
}
.badge-code {
font-family: var(--font-mono); font-size: var(--text-sm);
background: var(--color-bg-code); color: #CBA6F7;
padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
white-space: nowrap;
}
.badge-desc { font-size: var(--text-sm); color: var(--color-text-secondary); }
/* ============================================================
SPOT THE BUG
============================================================ */
.bug-challenge { margin: var(--space-8) 0; }
.bug-challenge h3 { font-family: var(--font-display); margin-bottom: var(--space-4); }
.bug-code {
background: var(--color-bg-code); color: #CDD6F4; border-radius: var(--radius-md);
overflow: hidden; box-shadow: var(--shadow-md);
}
.bug-line {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-2) var(--space-4); cursor: pointer;
transition: background var(--duration-fast); font-family: var(--font-mono); font-size: var(--text-sm);
}
.bug-line:hover { background: rgba(255,255,255,0.05); }
.bug-line.correct { background: rgba(45,139,85,0.2); }
.bug-line.incorrect { background: rgba(201,59,59,0.15); }
.line-num { color: var(--color-text-muted); font-size: var(--text-xs); min-width: 24px; text-align: right; user-select: none; }
.bug-feedback {
max-height: 0; overflow: hidden; opacity: 0;
transition: max-height var(--duration-normal), opacity var(--duration-normal);
font-size: var(--text-sm); border-radius: var(--radius-sm);
}
.bug-feedback.show { max-height: 200px; opacity: 1; padding: var(--space-3); margin-top: var(--space-2); }
.bug-feedback.success { background: var(--color-success-light); color: var(--color-success); }
.bug-feedback.error { background: var(--color-error-light); color: var(--color-error); }
/* ============================================================
DRAG AND DROP
============================================================ */
.dnd-container { margin: var(--space-8) 0; }
.dnd-instruction { font-size: var(--text-sm); color: var(--color-text-secondary); margin-bottom: var(--space-4); }
.dnd-chips {
display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6);
}
.dnd-chip {
padding: var(--space-2) var(--space-4); background: var(--color-surface);
border: 2px solid var(--color-border); border-radius: var(--radius-full);
font-family: var(--font-display); font-size: var(--text-sm); font-weight: 500;
cursor: grab; transition: all var(--duration-fast); user-select: none;
}
.dnd-chip:hover { border-color: var(--color-accent); }
.dnd-chip.dragging { opacity: 0.5; }
.dnd-chip.placed { opacity: 0.4; pointer-events: none; border-color: var(--color-success); background: var(--color-success-light); }
.dnd-chip.correct-place { border-color: var(--color-success); background: var(--color-success-light); }
.dnd-chip.incorrect-place { border-color: var(--color-error); background: var(--color-error-light); }
.dnd-zones { display: flex; flex-direction: column; gap: var(--space-3); }
.dnd-zone {
padding: var(--space-3) var(--space-4); background: var(--color-bg);
border: 2px dashed var(--color-border); border-radius: var(--radius-sm);
}
.dnd-zone-label { font-size: var(--text-sm); color: var(--color-text-secondary); margin-bottom: var(--space-2); }
.dnd-zone-target {
min-height: 36px; display: flex; align-items: center;
padding: var(--space-2); border-radius: var(--radius-sm);
font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm);
transition: background var(--duration-fast);
}
.dnd-zone-target.drag-over { background: var(--color-accent-light); }
.dnd-zone-target:empty::after {
content: 'Drop here'; color: var(--color-text-muted); font-style: italic;
}
/* ============================================================
FLOW STEPS (horizontal)
============================================================ */
.flow-steps {
display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
margin: var(--space-6) 0;
}
.flow-step {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-4); background: var(--color-surface);
border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.flow-step-num {
width: 28px; height: 28px; border-radius: 50%;
background: var(--color-accent); color: white; font-weight: 700;
display: flex; align-items: center; justify-content: center;
font-family: var(--font-display); font-size: var(--text-xs); flex-shrink: 0;
}
.flow-step p { margin: 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.flow-arrow { color: var(--color-text-muted); font-size: var(--text-lg); font-weight: 300; }
/* ============================================================
RESPONSIVE
============================================================ */
@media (max-width: 768px) {
:root { --text-4xl: 1.875rem; --text-5xl: 2.25rem; --text-6xl: 3rem; }
.translation-block { grid-template-columns: 1fr; }
.translation-english { border-left: none; border-top: 3px solid var(--color-accent); }
.pattern-cards { grid-template-columns: 1fr 1fr; }
.flow-steps { flex-direction: column; }
.flow-arrow { transform: rotate(90deg); }
.nav-dots { gap: var(--space-1); }
.nav-dot { width: 10px; height: 10px; }
.hero h1 { font-size: var(--text-4xl); }
}
@media (max-width: 480px) {
:root { --text-4xl: 1.5rem; --text-5xl: 1.875rem; --text-6xl: 2.25rem; }
.module { padding: var(--space-8) var(--space-4); }
.pattern-cards { grid-template-columns: 1fr; }
.arch-components { grid-template-columns: 1fr; }
}
/* ============================================================
FOOTER
============================================================ */
.footer {
text-align: center; padding: var(--space-12) var(--space-6);
color: var(--color-text-muted); font-size: var(--text-sm);
border-top: 1px solid var(--color-border-light);
}
.footer a { color: var(--color-accent); text-decoration: none; }
</style>
</head>
<body>
<!-- ============================================================
NAVIGATION
============================================================ -->
<nav class="nav" role="navigation">
<div class="progress-bar" id="progress-bar" role="progressbar" aria-valuenow="0"></div>
<div class="nav-inner">
<a href="https://github.com/acailic/agent_debugger" target="_blank" rel="noopener" style="display:flex;align-items:center;gap:var(--space-2);text-decoration:none;color:var(--color-text-secondary);font-family:var(--font-display);font-weight:700;font-size:var(--text-sm);transition:color var(--duration-fast);">
<svg width="18" height="18" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>
<span>Inside Peaky Peek</span>
</a>
<div class="nav-dots">
<button class="nav-dot" data-target="module-1" data-tooltip="What is Peaky Peek?" aria-label="Module 1"></button>
<button class="nav-dot" data-target="module-2" data-tooltip="Meet the Cast" aria-label="Module 2"></button>
<button class="nav-dot" data-target="module-3" data-tooltip="Spies & Cameras" aria-label="Module 3"></button>
<button class="nav-dot" data-target="module-4" data-tooltip="Journey of an Event" aria-label="Module 4"></button>
<button class="nav-dot" data-target="module-5" data-tooltip="Mission Control" aria-label="Module 5"></button>
<button class="nav-dot" data-target="module-6" data-tooltip="Safety Systems" aria-label="Module 6"></button>
<button class="nav-dot" data-target="module-7" data-tooltip="The Big Picture" aria-label="Module 7"></button>
</div>
</div>
</nav>
<!-- ============================================================
HERO
============================================================ -->
<section class="hero" id="hero">
<div class="hero-content">
<div class="hero-badge">Interactive Course</div>
<h1>How to <span>X-Ray</span> Your AI Agent</h1>
<p>Peaky Peek is a local-first agent debugger with replay, failure memory, smart highlights, and drift detection. Think of it as a flight recorder for AI — it captures everything that happens during execution so you can replay, inspect, and understand failures. This course teaches you how it works under the hood.</p>
<a href="#module-1" class="hero-cta">Start Learning ↓</a>
</div>
</section>
<!-- ============================================================
MODULE 1: What is Peaky Peek?
============================================================ -->
<section class="module" id="module-1" style="background: var(--color-bg)">
<div class="module-content">
<header class="module-header animate-in">
<span class="module-number">01</span>
<h1 class="module-title">What is Peaky Peek?</h1>
<p class="module-subtitle">Like a flight recorder for AI agents — it captures every decision, tool call, and conversation so you can debug what went wrong.</p>
</header>
<div class="module-body">
<!-- Screen 1: The Problem -->
<section class="screen animate-in">
<h2 class="screen-heading">The Black Box Problem</h2>
<p>When an AI agent goes wrong — gives a wrong answer, loops forever, or silently fails — you're usually left guessing. You can see the input and the output, but everything in between is a mystery.</p>
<p>Peaky Peek solves this by recording the <span class="term" data-definition="An event is a single record of something that happened during execution — like a snapshot in time. Each event has a type (tool call, decision, error), a timestamp, and data about what happened.">event</span> trail: every <span class="term" data-definition="An LLM (Large Language Model) is the AI brain — like GPT-4 or Claude — that processes text and generates responses. When we say 'the agent called the LLM,' we mean it sent a question to the AI model and got an answer back.">LLM</span> request, every tool call, every decision the agent made, and every error. It's like having a DVR for your AI's thought process.</p>
<div class="callout callout-accent animate-in">
<div class="callout-icon">💡</div>
<div class="callout-content">
<strong class="callout-title">Key Insight</strong>
<p>The word "debug" comes from the early days of computing when a real moth was found inside a computer, causing it to malfunction. The engineer taped it in the logbook with the note "First actual case of bug being found." Debugging has always been about <em>seeing</em> what's happening — Peaky Peek just makes the invisible visible.</p>
</div>
</div>
</section>
<!-- Screen 2: The Vocabulary — EventType -->
<section class="screen animate-in">
<h2 class="screen-heading">The Alphabet of Debugging</h2>
<p>Before Peaky Peek can record anything, it needs a vocabulary — a set of event types that describe every possible thing an AI agent might do. Here's that vocabulary, straight from the codebase:</p>
<div class="translation-block animate-in">
<div class="translation-code">
<span class="translation-label">CODE</span>
<pre><code data-lang="python">class EventType(StrEnum):
AGENT_START = "agent_start"
AGENT_END = "agent_end"
TOOL_CALL = "tool_call"
TOOL_RESULT = "tool_result"
LLM_REQUEST = "llm_request"
LLM_RESPONSE = "llm_response"
DECISION = "decision"
ERROR = "error"
CHECKPOINT = "checkpoint"
SAFETY_CHECK = "safety_check"
REFUSAL = "refusal"
POLICY_VIOLATION = "policy_violation"</code></pre>
</div>
<div class="translation-english">
<span class="translation-label">PLAIN ENGLISH</span>
<div class="translation-lines">
<p class="tl"><strong>A dictionary of everything an AI agent can do.</strong> Each line is a type of event — a category of "thing that happened."</p>
<p class="tl"><strong>AGENT_START/END</strong> — The agent woke up or went to sleep.</p>
<p class="tl"><strong>TOOL_CALL/RESULT</strong> — The agent used a tool (like a web search) and got a result back.</p>
<p class="tl"><strong>LLM_REQUEST/RESPONSE</strong> — The agent asked the AI brain a question and got an answer.</p>
<p class="tl"><strong>DECISION</strong> — The agent made a choice (e.g., "I'll search instead of calculate").</p>
<p class="tl"><strong>ERROR</strong> — Something broke.</p>
<p class="tl"><strong>SAFETY_CHECK, REFUSAL, POLICY_VIOLATION</strong> — The agent hit a guardrail.</p>
</div>
</div>
</div>
<p>This <span class="term" data-definition="An enum (enumeration) is a fixed list of options. Like a multiple-choice question where you can only pick from the listed answers — no write-ins allowed. In code, it prevents typos and makes sure everyone uses the exact same words.">enum</span> is the foundation of the entire system. Every event that Peaky Peek captures is typed as one of these. Without this shared vocabulary, the SDK wouldn't know what to record, and the frontend wouldn't know how to display it.</p>
</section>
<!-- Screen 3: Quiz -->
<section class="screen animate-in">
<h2 class="screen-heading">Quick Check</h2>
<div class="quiz-container" id="quiz-1">
<div class="quiz-question-block" data-question="q1" data-correct="option-b">
<h3 class="quiz-question">An AI agent gives a confidently wrong answer to a user's question. Which event type would be most useful for understanding why?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>AGENT_START — to see how the agent was initialized</span></button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>DECISION — to see what reasoning led to the wrong choice</span></button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>CHECKPOINT — to see a saved state snapshot</span></button>
<button class="quiz-option" data-value="option-d" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>AGENT_END — to see when the agent finished</span></button>
</div>
<div class="quiz-feedback" id="q1-feedback"></div>
</div>
<div class="quiz-question-block" data-question="q2" data-correct="option-c">
<h3 class="quiz-question">You want to understand the complete chain of events from start to finish. What makes Peaky Peek different from just reading log files?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>It writes logs to a faster database</span></button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>It encrypts the logs for security</span></button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>It links events together into a tree showing cause and effect, not just a flat list</span></button>
<button class="quiz-option" data-value="option-d" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>It compresses logs to save disk space</span></button>
</div>
<div class="quiz-feedback" id="q2-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-1')">Check Answers</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-1')">Try Again</button>
</div>
</section>
</div>
</div>
</section>
<!-- ============================================================
MODULE 2: Meet the Cast
============================================================ -->
<section class="module" id="module-2" style="background: var(--color-bg-warm)">
<div class="module-content">
<header class="module-header animate-in">
<span class="module-number">02</span>
<h1 class="module-title">Meet the Cast</h1>
<p class="module-subtitle">Peaky Peek has three main parts that work together like departments in a hospital — each with a distinct role, but all serving the same patient.</p>
</header>
<div class="module-body">
<!-- Screen 1: The Three Departments -->
<section class="screen animate-in">
<h2 class="screen-heading">Three Departments, One Mission</h2>
<div class="icon-rows stagger-children">
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-1)">🎥</div>
<div>
<strong>The SDK (Field Medic)</strong>
<p>Works closest to the patient — your AI agent. It instruments the code to capture events as they happen, then ships them to the server. Think of it as the wearable heart monitor.</p>
</div>
</div>
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-2)">🏢</div>
<div>
<strong>The API Server (Central Records)</strong>
<p>Receives events from the SDK, stores them in a <span class="term" data-definition="SQLite is a tiny database that lives in a single file on your computer. Unlike big databases that run on separate servers, SQLite needs zero setup — it just works. Think of it as a filing cabinet that's always in the room with you.">SQLite</span> database, and serves them to the frontend when asked. Built with <span class="term" data-definition="FastAPI is a Python framework for building web servers. It's designed to be fast (hence the name) and automatically generates documentation for every endpoint. Think of it as the reception desk that routes requests to the right department.">FastAPI</span>.</p>
</div>
</div>
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-3)">📊</div>
<div>
<strong>The Frontend (Monitoring Station)</strong>
<p>A <span class="term" data-definition="React is a library for building user interfaces. It breaks the screen into reusable components — like LEGO blocks that snap together. Each component manages its own piece of the display.">React</span> + <span class="term" data-definition="TypeScript is JavaScript with superpowers — it catches mistakes before they happen by making you declare what type of data each variable holds. Like spell-check for your code's logic.">TypeScript</span> app that visualizes the trace data. Decision trees, timelines, replay controls — this is where you actually see what happened.</p>
</div>
</div>
</div>
</section>
<!-- Screen 2: Group Chat -->
<section class="screen animate-in">
<h2 class="screen-heading">Listen to Them Introduce Themselves</h2>
<p>Click "Play All" to watch the three components explain their roles in their own words.</p>
<div class="chat-window" id="chat-cast">
<div class="chat-header">Team Introduction</div>
<div class="chat-messages" id="chat-cast-messages">
<div class="chat-message" data-msg="0" data-sender="sdk">
<div class="chat-avatar" style="background: var(--color-actor-1)">SDK</div>
<div class="chat-bubble"><span class="chat-sender" style="color: var(--color-actor-1)">SDK</span><p>Hey everyone! I'm the SDK. I live inside the agent's code. Every time the agent does something — calls a tool, makes a decision, talks to the LLM — I create an event record and ship it to the server.</p></div>
</div>
<div class="chat-message" data-msg="1" data-sender="api">
<div class="chat-avatar" style="background: var(--color-actor-2)">API</div>
<div class="chat-bubble"><span class="chat-sender" style="color: var(--color-actor-2)">API Server</span><p>And I'm the API! I receive those events from you, SDK, and store them permanently in our SQLite database. When the frontend asks "show me session #123," I fetch all the events and send them back.</p></div>
</div>
<div class="chat-message" data-msg="2" data-sender="frontend">
<div class="chat-avatar" style="background: var(--color-actor-3)">UI</div>
<div class="chat-bubble"><span class="chat-sender" style="color: var(--color-actor-3)">Frontend</span><p>I'm the Frontend! I take all those events from the API and turn them into something humans can understand — decision trees, timelines, replay controls. I also stream events live so you can watch the agent in real time.</p></div>
</div>
<div class="chat-message" data-msg="3" data-sender="sdk">
<div class="chat-avatar" style="background: var(--color-actor-1)">SDK</div>
<div class="chat-bubble"><span class="chat-sender" style="color: var(--color-actor-1)">SDK</span><p>The cool part? I can be set up in three ways — a decorator, a context manager, or even zero code changes with auto-patching. The developer chooses how much control they want.</p></div>
</div>
<div class="chat-message" data-msg="4" data-sender="api">
<div class="chat-avatar" style="background: var(--color-actor-2)">API</div>
<div class="chat-bubble"><span class="chat-sender" style="color: var(--color-actor-2)">API Server</span><p>And I handle the messy parts — retrying when the network hiccups, scoring events by importance, and detecting anomalies. I'm the brains behind the scenes.</p></div>
</div>
</div>
<div class="chat-typing" id="chat-cast-typing">
<div class="chat-avatar" id="chat-cast-typing-avatar">?</div>
<div class="chat-typing-dots"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></div>
</div>
<div class="chat-controls">
<button onclick="playChat('chat-cast', 1)">Next</button>
<button onclick="playChatAll('chat-cast')">Play All</button>
<button onclick="resetChat('chat-cast')">Replay</button>
<span class="chat-progress" id="chat-cast-progress">0 / 5</span>
</div>
</div>
</section>
<!-- Screen 3: Tech Stack -->
<section class="screen animate-in">
<h2 class="screen-heading">The Tools They Use</h2>
<div class="pattern-cards stagger-children">
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-1)">
<div class="pattern-icon" style="background: var(--color-accent-light)">🐍</div>
<h4 class="pattern-title">Python + dataclasses</h4>
<p class="pattern-desc">The SDK uses Python dataclasses — lightweight containers that hold event data. No heavy framework needed — just clean, typed data structures.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-2)">
<div class="pattern-icon" style="background: var(--color-error-light)">⚡</div>
<h4 class="pattern-title">FastAPI + SQLAlchemy</h4>
<p class="pattern-desc">The server uses FastAPI for lightning-fast request handling and SQLAlchemy to talk to the database. Async everything — no waiting around.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-3)">
<div class="pattern-icon" style="background: #E8E0F0">⚛️</div>
<h4 class="pattern-title">React + D3.js</h4>
<p class="pattern-desc">The frontend combines React for the UI structure with D3.js for the decision tree visualization. D3 draws the tree nodes and connections on an SVG canvas.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-4)">
<div class="pattern-icon" style="background: #F5EDDA">💾</div>
<h4 class="pattern-title">SQLite + SSE</h4>
<p class="pattern-desc">All data stays local in SQLite. Real-time updates use Server-Sent Events (SSE) — simpler than WebSockets and perfect for one-directional streaming.</p>
</div>
</div>
</section>
<!-- Screen 4: Quiz -->
<section class="screen animate-in">
<h2 class="screen-heading">Quick Check</h2>
<div class="quiz-container" id="quiz-2">
<div class="quiz-question-block" data-question="q1" data-correct="option-a">
<h3 class="quiz-question">You want to add a new visualization to the UI — a bar chart showing how many tool calls happened per session. Which two parts of Peaky Peek would you need to touch?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>The API Server (to aggregate the data) and the Frontend (to draw the chart)</span></button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>The SDK (to capture more data) and the Frontend (to draw the chart)</span></button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>The SDK (to capture more data) and the API Server (to store it)</span></button>
<button class="quiz-option" data-value="option-d" onclick="selectOption(this)"><div class="quiz-option-radio"></div><span>Only the Frontend — the data is already there</span></button>
</div>
<div class="quiz-feedback" id="quiz-2-q1-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-2')">Check Answer</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-2')">Try Again</button>
</div>
</section>
</div>
</div>
</section>