-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpseudocode.html
More file actions
1002 lines (941 loc) · 51.9 KB
/
Copy pathpseudocode.html
File metadata and controls
1002 lines (941 loc) · 51.9 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="de" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<title>Pseudocode & Algorithmen-Labor | AP2 FIAE Tracker</title>
<link rel="canonical" href="https://ap2.cwillam.de/pseudocode.html" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<!-- PWA Meta Tags -->
<link rel="manifest" href="manifest.json" />
<link rel="apple-touch-icon" href="favicon.svg" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<!-- Preload Fonts -->
<link
rel="preload"
href="assets/fonts/Inter-Regular.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link
rel="preload"
href="assets/fonts/Inter-SemiBold.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link
rel="preload"
href="assets/fonts/Inter-Bold.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<!-- Stylesheets -->
<link rel="stylesheet" href="assets/css/style.css?v=3.0.0" />
<!-- Tailwind Configuration -->
<script src="assets/js/tailwind.js?v=3.0.0"></script>
<script>
tailwind.config = {
darkMode: "class",
theme: {
extend: {
fontFamily: {
sans: [
"Inter",
"system-ui",
"-apple-system",
"BlinkMacSystemFont",
"Segoe UI",
"Roboto",
"sans-serif",
],
mono: [
"ui-monospace",
"SFMono-Regular",
"JetBrains Mono",
"Menlo",
"Monaco",
"Consolas",
"monospace",
],
},
colors: {
dark: {
bg: "#09090b",
card: "#121215",
"card-hover": "#18181d",
border: "#23232a",
"border-subtle": "#191920",
strong: "#383842",
text: "#f4f4f5",
muted: "#a1a1aa",
dim: "#71717a",
accent: "#8b5cf6",
"accent-hover": "#7c3aed",
"accent-dim": "rgba(139, 92, 246, 0.12)",
success: "#10b981",
"success-dim": "rgba(16, 185, 129, 0.12)",
warning: "#f59e0b",
"warning-dim": "rgba(245, 158, 11, 0.12)",
danger: "#ef4444",
"danger-dim": "rgba(239, 68, 68, 0.12)",
},
},
},
},
};
</script>
<style>
/* Smooth bar transitions */
.algo-bar {
transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
background-color 0.2s ease,
opacity 0.25s ease,
transform 0.2s ease;
}
/* Code line highlight */
.code-line {
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.code-line.active {
background-color: rgba(139, 92, 246, 0.22);
border-left: 3px solid #8b5cf6;
color: #c4b5fd;
}
/* Custom scrollbars */
.custom-scroll::-webkit-scrollbar {
height: 6px;
width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
background: #121215;
}
.custom-scroll::-webkit-scrollbar-thumb {
background: #23232a;
border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
background: #383842;
}
/* Table input states */
.trace-input {
font-size: 14px; /* Prevents auto-zoom on mobile iOS */
touch-action: manipulation;
}
.trace-input.correct {
background-color: rgba(16, 185, 129, 0.25) !important;
border-color: #10b981 !important;
color: #34d399 !important;
}
.trace-input.wrong {
background-color: rgba(239, 68, 68, 0.25) !important;
border-color: #ef4444 !important;
color: #f87171 !important;
}
/* Puzzle item animation */
.puzzle-line {
user-select: none;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* Mobile tap highlight reset */
button, a {
-webkit-tap-highlight-color: transparent;
}
</style>
</head>
<body
class="bg-dark-bg text-dark-text min-h-screen flex flex-col font-sans selection:bg-dark-accent selection:text-white antialiased"
>
<!-- Header -->
<header
class="w-full border-b border-dark-border bg-dark-bg/90 backdrop-blur-md sticky top-0 z-50"
>
<div
class="max-w-6xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between gap-4"
>
<div class="flex items-center gap-3">
<a
href="index.html"
class="flex items-center gap-2.5 group focus:outline-none"
title="Zurück zum Dashboard"
>
<div
class="w-8 h-8 rounded-lg bg-dark-card border border-dark-border flex items-center justify-center group-hover:border-dark-accent transition-colors"
>
<i
data-lucide="arrow-left"
class="w-4 h-4 text-dark-muted group-hover:text-dark-accent transition-colors"
></i>
</div>
<div class="flex items-center gap-1.5">
<span class="kbd-cap bg-purple-600/15 border-purple-500/40 text-purple-400 font-bold px-2 py-1 text-xs">AP2</span>
<span class="font-bold text-base tracking-tight text-white group-hover:text-purple-400 transition-colors">Tracker</span>
<span class="text-[9px] font-mono font-bold bg-purple-950/60 border border-purple-500/40 text-purple-400 px-1.5 py-0.5 rounded">FIAE</span>
</div>
</a>
<span class="hidden sm:inline-flex items-center font-mono text-[10px] text-dark-dim border border-dark-border rounded px-2 py-0.5 uppercase tracking-wider">
Pseudocode · v3.0.0
</span>
</div>
<!-- Quick Navigation & Stats -->
<div class="flex items-center gap-2 sm:gap-3">
<div class="hidden md:flex items-center gap-1.5 border-r border-dark-border pr-3 mr-1">
<a href="subnet.html" class="px-2.5 py-1.5 rounded-lg text-xs font-mono text-dark-muted hover:text-white hover:bg-dark-card transition-colors flex items-center gap-1.5" title="Subnetz-Trainer">
<i data-lucide="network" class="w-3.5 h-3.5 text-blue-400"></i>
<span>Subnetz</span>
</a>
<a href="sql.html" class="px-2.5 py-1.5 rounded-lg text-xs font-mono text-dark-muted hover:text-white hover:bg-dark-card transition-colors flex items-center gap-1.5" title="SQL-Labor">
<i data-lucide="database" class="w-3.5 h-3.5 text-emerald-400"></i>
<span>SQL</span>
</a>
<a href="glossar.html" class="px-2.5 py-1.5 rounded-lg text-xs font-mono text-dark-muted hover:text-white hover:bg-dark-card transition-colors flex items-center gap-1.5" title="Fach-Glossar">
<i data-lucide="book-open" class="w-3.5 h-3.5 text-amber-400"></i>
<span>Glossar</span>
</a>
</div>
<div
id="streakBadge"
class="flex items-center gap-1.5 px-2.5 py-1 bg-dark-card border border-dark-border rounded-lg text-xs font-mono text-orange-400 shadow-sm"
title="Erfolgreich gelöste Aufgaben"
>
<i data-lucide="flame" class="w-3.5 h-3.5"></i>
<span id="streakCount" class="font-bold text-white">0</span>
<span class="hidden sm:inline text-dark-muted">gelöst</span>
</div>
<!-- Support Button -->
<button
type="button"
onclick="openSupportModal()"
class="px-2.5 py-1.5 rounded-lg border border-dark-border hover:border-[#FFDD00]/40 bg-dark-card hover:bg-[#FFDD00]/10 text-dark-muted hover:text-[#FFDD00] transition-all text-xs flex items-center gap-1.5 shrink-0"
title="Support / Projekt unterstützen"
>
<i data-lucide="coffee" class="w-4 h-4 text-[#FFDD00]"></i>
<span class="hidden sm:inline font-mono text-[11px] font-medium">Support</span>
</button>
</div>
</div>
</header>
<!-- 3-MODULE NAVIGATOR -->
<div class="border-b border-dark-border bg-dark-bg/95 backdrop-blur-md sticky top-16 z-40 shadow-md">
<div class="max-w-6xl mx-auto px-3 sm:px-4 py-2 sm:py-2.5">
<!-- Tab Bar Header / Kicker -->
<div class="flex items-center justify-between text-[11px] font-mono mb-1.5 px-0.5">
<div class="flex items-center gap-1.5 font-bold uppercase tracking-wider text-slate-200">
<i data-lucide="layers" class="w-3.5 h-3.5 text-purple-400"></i>
<span>3 Labor-Module:</span>
</div>
<span class="text-[10px] text-dark-muted font-mono flex items-center gap-1">
<span class="inline-block w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"></span>
Klicke zum Wechseln
</span>
</div>
<!-- Segmented Tab Dock -->
<nav class="grid grid-cols-3 gap-1.5 sm:gap-2.5 p-1 sm:p-1.5 bg-dark-card/90 rounded-2xl border border-dark-border shadow-inner" aria-label="Hauptnavigation Module">
<!-- Tab 1 -->
<button
type="button"
id="tabBtn-guide"
onclick="switchTab('guide')"
class="tab-btn active flex flex-col sm:flex-row items-center justify-center sm:justify-start gap-1 sm:gap-2.5 p-2 sm:px-3.5 sm:py-2.5 rounded-xl text-center sm:text-left transition-all bg-gradient-to-r from-purple-600 to-indigo-600 text-white shadow-md shadow-purple-500/25 border border-purple-300/40 cursor-pointer"
>
<div class="tab-icon w-7 h-7 sm:w-8 sm:h-8 rounded-lg bg-white/20 flex items-center justify-center shrink-0 transition-colors">
<i data-lucide="book-open" class="w-4 h-4 text-white"></i>
</div>
<div class="min-w-0 flex-1">
<div class="flex items-center justify-center sm:justify-between gap-1">
<span class="tab-title text-[11px] sm:text-xs font-bold leading-tight truncate text-white">1. FIAE-Guide</span>
<span class="tab-badge text-[9px] font-mono px-1.5 py-0.5 rounded bg-white/20 text-white font-semibold hidden sm:inline-block">● Aktiv</span>
</div>
<div class="tab-sub text-[9px] sm:text-[10px] text-purple-100 hidden sm:block truncate opacity-95">O-Notation & Algos</div>
</div>
</button>
<!-- Tab 2 -->
<button
type="button"
id="tabBtn-visualizer"
onclick="switchTab('visualizer')"
class="tab-btn flex flex-col sm:flex-row items-center justify-center sm:justify-start gap-1 sm:gap-2.5 p-2 sm:px-3.5 sm:py-2.5 rounded-xl text-center sm:text-left transition-all bg-dark-bg/70 hover:bg-dark-bg border border-dark-border/80 hover:border-purple-500/40 text-slate-300 hover:text-white cursor-pointer group"
>
<div class="tab-icon w-7 h-7 sm:w-8 sm:h-8 rounded-lg bg-amber-500/15 border border-amber-500/30 flex items-center justify-center shrink-0 transition-colors">
<i data-lucide="play-circle" class="w-4 h-4 text-amber-400"></i>
</div>
<div class="min-w-0 flex-1">
<div class="flex items-center justify-center sm:justify-between gap-1">
<span class="tab-title text-[11px] sm:text-xs font-bold leading-tight truncate text-slate-300 group-hover:text-white">2. Visualizer</span>
<span class="tab-badge text-[9px] font-mono px-1.5 py-0.5 rounded bg-dark-card border border-dark-border text-dark-muted group-hover:text-white hidden sm:inline-block">Simulator</span>
</div>
<div class="tab-sub text-[9px] sm:text-[10px] text-slate-500 hidden sm:block truncate">Profi-Simulator</div>
</div>
</button>
<!-- Tab 3 -->
<button
type="button"
id="tabBtn-exercises"
onclick="switchTab('exercises')"
class="tab-btn flex flex-col sm:flex-row items-center justify-center sm:justify-start gap-1 sm:gap-2.5 p-2 sm:px-3.5 sm:py-2.5 rounded-xl text-center sm:text-left transition-all bg-dark-bg/70 hover:bg-dark-bg border border-dark-border/80 hover:border-purple-500/40 text-slate-300 hover:text-white cursor-pointer group"
>
<div class="tab-icon w-7 h-7 sm:w-8 sm:h-8 rounded-lg bg-purple-500/15 border border-purple-500/30 flex items-center justify-center shrink-0 transition-colors">
<i data-lucide="check-square" class="w-4 h-4 text-purple-400"></i>
</div>
<div class="min-w-0 flex-1">
<div class="flex items-center justify-center sm:justify-between gap-1">
<span class="tab-title text-[11px] sm:text-xs font-bold leading-tight truncate text-slate-300 group-hover:text-white">3. Üben & Test</span>
<span class="tab-badge text-[9px] font-mono px-1.5 py-0.5 rounded bg-dark-card border border-dark-border text-dark-muted group-hover:text-white hidden sm:inline-block">18 Tests</span>
</div>
<div class="tab-sub text-[9px] sm:text-[10px] text-slate-500 hidden sm:block truncate">FIAE Prüfungsset</div>
</div>
</button>
</nav>
</div>
</div>
<!-- Main Container -->
<main class="max-w-6xl mx-auto px-3 sm:px-4 py-5 sm:py-6 flex-1 w-full">
<!-- ============================================================ -->
<!-- TAB 1: FIAE-GUIDE & O-NOTATION (AUSFÜHRLICHE THEORIE) -->
<!-- ============================================================ -->
<section id="tabContent-guide" class="space-y-6 sm:space-y-8">
<!-- Hero Box -->
<div class="bg-gradient-to-br from-slate-900 via-dark-card to-slate-950 border border-dark-border rounded-2xl p-5 sm:p-7 shadow-card">
<div class="flex flex-col md:flex-row md:items-center justify-between gap-5">
<div>
<div class="flex items-center gap-2 text-dark-accent text-xs font-mono mb-2 uppercase tracking-wider">
<i data-lucide="code-2" class="w-4 h-4"></i>
<span>Spezialisierung Anwendungsentwicklung (FIAE)</span>
</div>
<h1 class="text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-tight">
Algorithmen, Sortierverfahren & Effizienz (O-Notation)
</h1>
<p class="text-slate-300 text-xs sm:text-sm mt-2 max-w-2xl leading-relaxed">
In der AP2 (FIAE) sind Algorithmen der absolute Dreh- und Angelpunkt:
Vergleich von <strong>Sortierverfahren</strong>, <strong>Binärer Suche</strong>,
<strong>Rekursion</strong> und deren mathematischer <strong>Laufzeitkomplexität</strong>.
</p>
</div>
<div class="flex flex-wrap gap-2.5 shrink-0">
<button
type="button"
onclick="switchTab('visualizer')"
class="w-full sm:w-auto px-4 py-3 bg-dark-accent hover:bg-dark-accent-hover text-white rounded-xl text-xs sm:text-sm font-bold flex items-center justify-center gap-2 shadow-lg shadow-purple-500/15 transition-all"
>
<span>Zum Live-Visualizer</span>
<i data-lucide="arrow-right" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
<!-- Big-O Explanation: Der Praxis-Vergleich -->
<div class="bg-dark-card border border-dark-border rounded-2xl p-5 sm:p-7 shadow-card">
<div class="flex items-start gap-3.5 mb-4">
<div class="w-8 h-8 rounded-xl bg-purple-500/10 border border-purple-500/30 flex items-center justify-center text-purple-400 font-bold font-mono shrink-0">O</div>
<div>
<h2 class="text-base sm:text-lg font-bold text-white">Was bedeutet die O-Notation in der Prüfung?</h2>
<p class="text-xs sm:text-sm text-slate-300 mt-1 leading-relaxed">
Die O-Notation (Landau-Symbol) beschreibt, wie stark die Laufzeit oder der Speicherbedarf wächst,
wenn die Datenmenge <code>n</code> größer wird. Sie misst keine Sekunden, sondern die <strong>Anzahl der Rechenschritte</strong>.
</p>
</div>
</div>
<!-- Practical Growth comparison -->
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4 font-mono text-xs">
<div class="bg-dark-bg border border-dark-border rounded-xl p-3.5">
<div class="text-emerald-400 font-bold text-sm">O(1)</div>
<div class="text-white font-semibold mt-1">Konstant</div>
<div class="text-[11px] text-slate-400 mt-1">Immer gleich schnell, egal wie groß n ist (z.B. Array-Zugriff <code>arr[5]</code>).</div>
</div>
<div class="bg-dark-bg border border-dark-border rounded-xl p-3.5">
<div class="text-sky-400 font-bold text-sm">O(log n)</div>
<div class="text-white font-semibold mt-1">Logarithmisch</div>
<div class="text-[11px] text-slate-400 mt-1">Extrem schnell! Verdoppelt sich n, braucht es nur 1 Schritt mehr (Binäre Suche).</div>
</div>
<div class="bg-dark-bg border border-dark-border rounded-xl p-3.5">
<div class="text-amber-400 font-bold text-sm">O(n)</div>
<div class="text-white font-semibold mt-1">Linear</div>
<div class="text-[11px] text-slate-400 mt-1">Wächst 1:1 mit den Daten. 1000 Elemente = 1000 Durchläufe (Einfache Schleife).</div>
</div>
<div class="bg-dark-bg border border-dark-border rounded-xl p-3.5">
<div class="text-rose-400 font-bold text-sm">O(n²)</div>
<div class="text-white font-semibold mt-1">Quadratisch</div>
<div class="text-[11px] text-slate-400 mt-1">Gefährlich langsam bei großen Daten! Schachtelschleifen (Bubble/Selection Sort).</div>
</div>
</div>
</div>
<!-- Big-O Notation Table (Comprehensive AP2 Standard) -->
<div class="bg-dark-card border border-dark-border rounded-2xl p-5 sm:p-7 shadow-card">
<div class="flex items-center justify-between mb-4">
<h3 class="font-bold text-base sm:text-lg text-white">Alle Prüfungs-Algorithmen im Laufzeit-Vergleich</h3>
<span class="text-[11px] text-purple-400 font-mono bg-purple-500/10 px-2.5 py-1 rounded-lg border border-purple-500/20">AP2 Pflichtwissen</span>
</div>
<div class="custom-scroll overflow-x-auto rounded-xl border border-dark-border">
<table class="w-full text-left text-xs font-mono border-collapse">
<thead>
<tr class="bg-slate-900 text-slate-300 border-b border-dark-border">
<th class="p-3 font-bold">Algorithmus</th>
<th class="p-3 font-bold">Best Case</th>
<th class="p-3 font-bold">Average Case</th>
<th class="p-3 font-bold">Worst Case</th>
<th class="p-3 font-bold">In-Place?</th>
<th class="p-3 font-bold">Stabilität?</th>
<th class="p-3 font-bold">Wann einsetzen?</th>
</tr>
</thead>
<tbody class="divide-y divide-dark-border/60 bg-dark-bg">
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-white">Lineare Suche</td>
<td class="p-3 text-emerald-400">O(1)</td>
<td class="p-3 text-amber-400">O(n)</td>
<td class="p-3 text-rose-400">O(n)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-slate-400">–</td>
<td class="p-3 text-slate-400">Unsortierte Daten; kleine Arrays.</td>
</tr>
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-purple-300">Binäre Suche</td>
<td class="p-3 text-emerald-400">O(1)</td>
<td class="p-3 text-emerald-400">O(log n)</td>
<td class="p-3 text-emerald-400">O(log n)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-slate-400">–</td>
<td class="p-3 text-slate-400"><strong>Zwingend sortiertes Array!</strong> Bei 1 Mio. Werten max. 20 Schritte.</td>
</tr>
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-white">Bubble Sort</td>
<td class="p-3 text-emerald-400">O(n)*</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-emerald-400">Stabil</td>
<td class="p-3 text-slate-400">Lehrzwecke; *Best-Case O(n) nur mit getauscht-Flag!</td>
</tr>
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-white">Selection Sort</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-rose-400">Instabil</td>
<td class="p-3 text-slate-400">Minimale Tausch-Anzahl (exakt n Tausche); z.B. bei teurem Flash-Speicher.</td>
</tr>
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-white">Insertion Sort</td>
<td class="p-3 text-emerald-400">O(n)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-emerald-400">Stabil</td>
<td class="p-3 text-slate-400">Hervorragend für <strong>bereits fast sortierte Daten</strong> oder Online-Streams.</td>
</tr>
<tr class="hover:bg-slate-900/40">
<td class="p-3 font-bold text-white">QuickSort</td>
<td class="p-3 text-emerald-400">O(n log n)</td>
<td class="p-3 text-emerald-400">O(n log n)</td>
<td class="p-3 text-rose-400">O(n²)</td>
<td class="p-3 text-emerald-400">Ja</td>
<td class="p-3 text-rose-400">Instabil</td>
<td class="p-3 text-slate-400">In der Praxis meist der schnellste Allrounder (Divide & Conquer).</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Detail: Die 5 Algorithmen mit Alltags-Analogien -->
<div class="bg-dark-card border border-dark-border rounded-2xl p-5 sm:p-7 shadow-card">
<h3 class="font-bold text-base sm:text-lg text-white mb-4">Die 5 FIAE-Sortier- und Suchverfahren im Detail</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6">
<!-- 1. Binäre Suche -->
<div class="bg-dark-bg border border-dark-border rounded-xl p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-2">
<span class="font-bold text-sm text-purple-400">1. Binäre Suche (Telefonbuch-Methode)</span>
<span class="text-[10px] text-emerald-400 font-mono">O(log n)</span>
</div>
<p class="text-xs text-slate-300 leading-relaxed mb-3">
Schlage das Buch in der <strong>Mitte</strong> auf. Ist der gesuchte Name weiter vorne, wirfst du die gesamte rechte Buchhälfte weg. Bei jedem Schritt halbiert sich die Arbeit!
</p>
<div class="bg-slate-950 p-3 rounded-lg border border-slate-800 font-mono text-xs text-slate-200 space-y-1">
<div>SOLANGE links <= rechts TUE</div>
<div class="pl-3">mitte = (links + rechts) // 2</div>
<div class="pl-3">WENN arr[mitte] == ziel DANN RÜCKGABE mitte</div>
<div class="pl-3">WENN arr[mitte] < ziel DANN links = mitte + 1</div>
<div class="pl-3">SONST rechts = mitte - 1</div>
<div>ENDE SOLANGE</div>
</div>
</div>
</div>
<!-- 2. Insertion Sort -->
<div class="bg-dark-bg border border-dark-border rounded-xl p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-2">
<span class="font-bold text-sm text-sky-400">2. Insertion Sort (Kartenspiel-Methode)</span>
<span class="text-[10px] text-sky-400 font-mono">O(n) bis O(n²)</span>
</div>
<p class="text-xs text-slate-300 leading-relaxed mb-3">
Wie beim Sortieren von Spielkarten auf der Hand: Du nimmst die nächste Karte, schaust von rechts nach links durch die bereits sortierten Karten und schiebst sie an die passende Stelle.
</p>
<div class="bg-slate-950 p-3 rounded-lg border border-slate-800 font-mono text-xs text-slate-200 space-y-1">
<div>FÜR i = 1 BIS n - 1</div>
<div class="pl-3">aktuell = arr[i], j = i - 1</div>
<div class="pl-3">SOLANGE j >= 0 UND arr[j] > aktuell TUE</div>
<div class="pl-6">arr[j + 1] = arr[j], j = j - 1</div>
<div class="pl-3">arr[j + 1] = aktuell</div>
</div>
</div>
</div>
<!-- 3. Selection Sort -->
<div class="bg-dark-bg border border-dark-border rounded-xl p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-2">
<span class="font-bold text-sm text-amber-400">3. Selection Sort (Such- & Tausch-Methode)</span>
<span class="text-[10px] text-amber-400 font-mono">Immer O(n²)</span>
</div>
<p class="text-xs text-slate-300 leading-relaxed mb-3">
Suche das absolute Minimum im gesamten Rest des Arrays. Wenn du es gefunden hast, tausche es mit dem Element ganz links. Wiederhole das für Position 1, 2, ...
</p>
<div class="bg-slate-950 p-3 rounded-lg border border-slate-800 font-mono text-xs text-slate-200 space-y-1">
<div>FÜR i = 0 BIS n - 2</div>
<div class="pl-3">minIdx = i</div>
<div class="pl-3">FÜR j = i + 1 BIS n - 1</div>
<div class="pl-6">WENN arr[j] < arr[minIdx] DANN minIdx = j</div>
<div class="pl-3">TAUSCHE arr[i], arr[minIdx]</div>
</div>
</div>
</div>
<!-- 4. QuickSort -->
<div class="bg-dark-bg border border-dark-border rounded-xl p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-2">
<span class="font-bold text-sm text-purple-400">4. QuickSort (Divide & Conquer)</span>
<span class="text-[10px] text-emerald-400 font-mono">O(n log n)</span>
</div>
<p class="text-xs text-slate-300 leading-relaxed mb-3">
Wähle ein Vergleichselement (<strong>Pivot</strong>). Sortiere alle kleineren Zahlen nach links und alle größeren nach rechts. Wende dasselbe rekursiv auf die linke und rechte Hälfte an.
</p>
<div class="bg-slate-950 p-3 rounded-lg border border-slate-800 font-mono text-xs text-slate-200 space-y-1">
<div>pivot = arr[rechts]</div>
<div>// Partitioniere: alle < pivot nach links</div>
<div>partition(arr, links, rechts)</div>
<div>quickSort(arr, links, pivotIdx - 1)</div>
<div>quickSort(arr, pivotIdx + 1, rechts)</div>
</div>
</div>
</div>
</div>
</div>
<!-- Rekursion & Call-Stack -->
<div class="bg-gradient-to-r from-purple-950/40 via-dark-card to-slate-900 border border-purple-500/30 rounded-2xl p-5 sm:p-7">
<div class="flex items-start gap-3.5">
<div class="w-8 h-8 rounded-xl bg-purple-500/10 border border-purple-500/30 flex items-center justify-center text-purple-400 shrink-0">
<i data-lucide="layers" class="w-5 h-5"></i>
</div>
<div>
<h3 class="text-base sm:text-lg font-bold text-white">Rekursion & der Call-Stack (Was passiert im RAM?)</h3>
<p class="text-xs sm:text-sm text-slate-300 mt-1 leading-relaxed">
Jedes Mal, wenn eine Funktion sich selbst aufruft, reserviert das Betriebssystem einen neuen <strong>Stack Frame</strong> im Arbeitsspeicher für die lokalen Variablen.
Fehlt die Abbruchbedingung (Basisfall), wächst der Stack unendlich, bis der Speicher voll ist: der berüchtigte <strong>Stack Overflow</strong>!
</p>
</div>
</div>
</div>
</section>
<!-- ============================================================ -->
<!-- TAB 2: PROFI-VISUALIZER (FEATURE-REICH & CLEAN) -->
<!-- ============================================================ -->
<section id="tabContent-visualizer" class="hidden space-y-5 sm:space-y-6">
<!-- Control Bar -->
<div class="bg-dark-card border border-dark-border rounded-2xl p-4 sm:p-6 shadow-card space-y-4">
<div class="flex flex-col lg:flex-row lg:items-center justify-between gap-4">
<!-- Algorithm Selector & Presets -->
<div class="flex flex-wrap items-center gap-2 sm:gap-3">
<label for="algoSelect" class="text-xs font-mono text-slate-400 uppercase tracking-wider shrink-0">Algorithmus:</label>
<select
id="algoSelect"
onchange="onAlgorithmChange()"
class="bg-dark-bg border border-dark-border rounded-xl px-3.5 py-2.5 text-xs sm:text-sm text-white font-medium focus:border-dark-accent focus:outline-none w-full sm:w-auto sm:min-w-[220px]"
>
<optgroup label="Suchalgorithmen">
<option value="binary_search">1. Binäre Suche (Binary Search)</option>
<option value="linear_search">2. Lineare Suche (Linear Search)</option>
</optgroup>
<optgroup label="Sortieralgorithmen">
<option value="bubble_sort">3. Bubble Sort (Optimiert)</option>
<option value="selection_sort">4. Selection Sort (Auswahl)</option>
<option value="insertion_sort">5. Insertion Sort (Einfügen)</option>
<option value="quick_sort">6. QuickSort (Divide & Conquer)</option>
</optgroup>
</select>
<!-- Presets Dropdown -->
<div class="flex items-center gap-1.5">
<select
id="presetSelect"
onchange="applyArrayPreset(this.value)"
class="bg-dark-bg border border-dark-border rounded-xl px-3 py-2 text-xs font-mono text-slate-300 focus:border-dark-accent focus:outline-none"
>
<option value="random">Datensatz: Zufall</option>
<option value="nearly_sorted">Fast sortiert</option>
<option value="reverse">Umgekehrt sortiert (Worst-Case)</option>
<option value="small_numbers">Kleine Werte (1 bis 20)</option>
<option value="duplicates">Mit Duplikaten</option>
</select>
<button
type="button"
onclick="generateNewArray()"
class="p-2.5 bg-dark-bg border border-dark-border hover:border-slate-600 rounded-xl text-slate-300 hover:text-white transition-colors shrink-0"
title="Neu mischen"
>
<i data-lucide="shuffle" class="w-4 h-4 text-dark-accent"></i>
</button>
</div>
</div>
<!-- Playback Controls -->
<div class="flex items-center justify-between sm:justify-end gap-1.5 sm:gap-2 pt-2 lg:pt-0 border-t lg:border-t-0 border-dark-border/60">
<button
type="button"
id="btnStepBack"
onclick="stepBackward()"
class="px-3.5 py-2.5 bg-dark-bg border border-dark-border hover:border-slate-600 rounded-xl text-xs font-mono text-slate-200 flex items-center gap-1.5 transition-colors active:scale-95"
title="Einen Schritt zurück"
>
<i data-lucide="skip-back" class="w-4 h-4"></i>
<span class="hidden sm:inline">Schritt</span>
</button>
<button
type="button"
id="btnPlayPause"
onclick="togglePlayPause()"
class="px-5 py-2.5 bg-dark-accent hover:bg-dark-accent-hover text-white rounded-xl text-xs sm:text-sm font-bold flex items-center gap-2 transition-all shadow-md shadow-purple-500/15 min-w-[100px] justify-center active:scale-95"
>
<i data-lucide="play" id="playIcon" class="w-4 h-4"></i>
<span id="playBtnText">Start</span>
</button>
<button
type="button"
id="btnStepForward"
onclick="stepForward()"
class="px-3.5 py-2.5 bg-dark-bg border border-dark-border hover:border-slate-600 rounded-xl text-xs font-mono text-slate-200 flex items-center gap-1.5 transition-colors active:scale-95"
title="Einen Schritt vor"
>
<span class="hidden sm:inline">Schritt</span>
<i data-lucide="skip-forward" class="w-4 h-4"></i>
</button>
<button
type="button"
id="btnReset"
onclick="resetAlgorithm()"
class="p-2.5 bg-dark-bg border border-dark-border hover:border-slate-600 rounded-xl text-slate-400 hover:text-white transition-colors ml-1 active:scale-95"
title="Zurück an den Anfang"
>
<i data-lucide="rotate-ccw" class="w-4 h-4"></i>
</button>
</div>
</div>
<!-- Sliders & Inputs -->
<div class="pt-3.5 border-t border-dark-border/80 flex flex-wrap items-center justify-between gap-3 text-xs">
<div class="flex items-center gap-2">
<span class="text-slate-400 text-[11px] font-mono">Tempo:</span>
<input
type="range"
id="speedSlider"
min="100"
max="1200"
step="50"
value="600"
onchange="updateSpeed(this.value)"
class="w-24 sm:w-32 accent-dark-accent cursor-pointer"
/>
<span id="speedLabel" class="text-[10px] font-mono text-slate-400 w-14">Normal</span>
</div>
<div class="flex items-center gap-2">
<span class="text-slate-400 text-[11px] font-mono">Elemente:</span>
<input
type="range"
id="sizeSlider"
min="5"
max="10"
step="1"
value="7"
onchange="updateArraySize(this.value)"
class="w-20 sm:w-24 accent-dark-accent cursor-pointer"
/>
<span id="sizeLabel" class="text-[10px] font-mono text-slate-400">7</span>
</div>
<div class="flex items-center gap-2 ml-auto">
<div id="targetValueWrapper" class="flex items-center gap-1.5">
<span class="text-slate-400 text-[11px] font-mono">Zielwert:</span>
<input
type="number"
id="targetSearchInput"
value="42"
class="w-16 bg-dark-bg border border-dark-border rounded-lg px-2 py-1 text-xs text-white font-mono text-center focus:border-dark-accent focus:outline-none"
onchange="updateSearchTarget(this.value)"
title="Gesuchter Wert (oder direkt auf einen Balken klicken)"
/>
<span class="text-[10px] text-slate-500 font-mono hidden sm:inline">(oder Klick auf Balken)</span>
</div>
</div>
</div>
<!-- Binary Search Sorted Notice -->
<div id="binarySearchBadge" class="hidden text-xs font-mono text-purple-300 bg-purple-950/40 border border-purple-800/50 rounded-xl px-3.5 py-2 flex items-center gap-2">
<i data-lucide="info" class="w-4 h-4 text-purple-400 shrink-0"></i>
<span>Hinweis: Für die binäre Suche wird das Array <strong>immer automatisch aufsteigend sortiert</strong> (Grundvoraussetzung für O(log n)).</span>
</div>
</div>
<!-- Visual Stage (Array Bars) -->
<div class="bg-dark-card border border-dark-border rounded-2xl p-4 sm:p-6 shadow-card">
<div class="flex flex-wrap items-center justify-between gap-2 mb-4">
<h2 class="text-xs sm:text-sm font-bold text-white flex items-center gap-2">
<i data-lucide="bar-chart-2" class="w-4 h-4 text-dark-accent"></i>
<span>Speicher & Zeiger (Visualisierung)</span>
</h2>
<div class="flex flex-wrap items-center gap-2.5 sm:gap-4 text-[10px] sm:text-[11px] font-mono text-slate-400">
<span class="flex items-center gap-1"><span class="w-2.5 h-2.5 rounded-sm bg-purple-500 inline-block"></span> Normal</span>
<span class="flex items-center gap-1"><span class="w-2.5 h-2.5 rounded-sm bg-amber-400 inline-block"></span> Mitte / Vergleich</span>
<span class="flex items-center gap-1"><span class="w-2.5 h-2.5 rounded-sm bg-rose-500 inline-block"></span> Tausch</span>
<span class="flex items-center gap-1"><span class="w-2.5 h-2.5 rounded-sm bg-emerald-500 inline-block"></span> Sortiert / Treffer</span>
</div>
</div>
<!-- Bar Canvas Container -->
<div
id="barContainer"
class="h-48 sm:h-64 flex items-end justify-center gap-2 sm:gap-4 px-2 pb-3 pt-6 border border-dark-border/60 bg-dark-bg/80 rounded-xl relative overflow-x-auto custom-scroll"
>
<!-- Generated dynamically by pseudocode.js -->
</div>
<!-- Step Narration Box (Plain German explanation) -->
<div class="mt-4 p-3.5 sm:p-4 bg-dark-bg border border-dark-border rounded-xl flex items-start gap-3">
<div class="w-7 h-7 rounded-lg bg-dark-accent/10 border border-dark-accent/30 flex items-center justify-center text-dark-accent shrink-0 mt-0.5">
<i data-lucide="message-square" class="w-4 h-4"></i>
</div>
<div class="flex-1">
<div class="text-[10px] font-mono uppercase tracking-wider text-slate-500">
Schritt <span id="currentStepNumber" class="text-purple-400 font-bold">0</span> von <span id="totalStepsNumber" class="text-white font-bold">0</span>
</div>
<p id="stepExplanation" class="text-xs sm:text-sm text-slate-100 mt-1 leading-relaxed font-medium">
Klicke auf "Start" oder "Schritt", um den Algorithmus schrittweise zu analysieren.
</p>
</div>
</div>
</div>
<!-- Side-by-Side: Code vs. Variable Inspector -->
<div class="grid grid-cols-1 lg:grid-cols-12 gap-5 sm:gap-6">
<div class="lg:col-span-7 bg-dark-card border border-dark-border rounded-2xl p-4 sm:p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<h3 class="font-bold text-xs sm:text-sm text-white flex items-center gap-2">
<i data-lucide="code" class="w-4 h-4 text-dark-accent"></i>
<span>FIAE-Pseudocode (Prüfungsstandard)</span>
</h3>
<span class="text-[10px] font-mono text-slate-400 bg-slate-900 px-2 py-0.5 rounded-md border border-slate-800">
Aktive Zeile leuchtet
</span>
</div>
<div
id="codeContainer"
class="font-mono text-xs text-slate-300 bg-dark-bg border border-dark-border rounded-xl p-3 sm:p-3.5 custom-scroll overflow-x-auto leading-relaxed space-y-0.5"
>
<!-- Generated dynamically -->
</div>
</div>
</div>
<div class="lg:col-span-5 bg-dark-card border border-dark-border rounded-2xl p-4 sm:p-5 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<h3 class="font-bold text-xs sm:text-sm text-white flex items-center gap-2">
<i data-lucide="cpu" class="w-4 h-4 text-purple-400"></i>
<span>Live-Trace & Variablen</span>
</h3>
<span class="text-[10px] font-mono text-purple-400">Speicher-Monitor</span>
</div>
<p class="text-xs text-slate-400 mb-3 leading-relaxed">
Variablenzustände, Grenzen und Zwischenergebnisse des aktuellen Schritts:
</p>
<div id="variableInspector" class="space-y-2">
<!-- Dynamically populated -->
</div>
</div>
<div class="mt-4 pt-3.5 border-t border-dark-border/80 text-[11px] text-slate-400 flex items-center justify-between">
<span>Status: <strong id="algoStatusText" class="text-purple-400">Bereit</strong></span>
<span id="operationCounter" class="font-mono text-slate-500">Vergleiche: 0</span>
</div>
</div>
</div>
</section>
<!-- ============================================================ -->
<!-- TAB 3: SCHREIBTISCHTEST & FIAE-ÜBUNGEN (GROSSES SET) -->
<!-- ============================================================ -->
<section id="tabContent-exercises" class="hidden space-y-5 sm:space-y-6">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-dark-card border border-dark-border rounded-2xl p-3 sm:p-4 shadow-card">
<div class="flex flex-col sm:flex-row sm:items-center gap-2 w-full sm:w-auto">
<span class="text-xs font-mono text-slate-400 uppercase tracking-wider hidden sm:inline">Modus:</span>
<div class="grid grid-cols-2 sm:inline-flex rounded-xl border border-dark-border bg-dark-bg p-1 text-xs w-full sm:w-auto">
<button
type="button"
id="btnSubMode-trace"
onclick="setExerciseSubMode('trace')"
class="px-2.5 sm:px-3.5 py-2 rounded-lg font-semibold transition-all bg-dark-accent text-white shadow-sm text-center text-[11px] sm:text-xs"
>
<span class="sm:hidden">Trace-Tabellen</span>
<span class="hidden sm:inline">Trace-Tabellen (Schreibtischtests)</span>
</button>
<button
type="button"
id="btnSubMode-puzzle"
onclick="setExerciseSubMode('puzzle')"
class="px-2.5 sm:px-3.5 py-2 rounded-lg font-semibold transition-all text-slate-400 hover:text-white text-center text-[11px] sm:text-xs"
>
<span class="sm:hidden">Code-Puzzles</span>
<span class="hidden sm:inline">Code-Puzzles (Zeilen ordnen)</span>
</button>
</div>
</div>
<div class="flex items-center gap-2 w-full sm:w-auto">
<label for="exerciseSelect" class="text-xs font-mono text-slate-400 shrink-0">Aufgabe:</label>
<select
id="exerciseSelect"
onchange="onExerciseChange()"
class="bg-dark-bg border border-dark-border rounded-xl px-3 py-2 text-xs sm:text-sm text-white focus:border-dark-accent focus:outline-none w-full sm:w-auto sm:max-w-[280px]"
>
<!-- Filled by JS -->
</select>
</div>
</div>
<div id="exerciseStage" class="bg-dark-card border border-dark-border rounded-2xl p-4 sm:p-6 shadow-card space-y-5">
<!-- Filled dynamically by JS -->
</div>
</section>
</main>
<!-- Footer -->
<footer class="border-t border-dark-border py-8 px-4 sm:px-6 text-xs font-mono text-dark-dim w-full mt-auto">
<div class="max-w-6xl mx-auto flex flex-col sm:flex-row items-center justify-between gap-4">
<div class="flex items-center gap-2">
<a href="https://github.com/cwillam" target="_blank" rel="noopener" class="text-white font-semibold hover:text-purple-400 transition-colors">cwillam</a>
<span>© 2026</span>
<span>·</span>
<span>Open Source & 100% Lokal</span>
</div>
<div class="flex flex-wrap items-center justify-center sm:justify-end gap-5 text-dark-muted">
<button onclick="openSupportModal()" class="hover:text-[#FFDD00] transition-colors flex items-center gap-1 font-bold">
<i data-lucide="coffee" class="w-3.5 h-3.5 text-[#FFDD00]"></i> Support
</button>
<a href="updates.html" class="hover:text-white transition-colors">Updates</a>
<a href="help.html" class="hover:text-white transition-colors">Hilfe & FAQ</a>
<a href="https://github.com/cwillam/ap2-tracker/issues/new?template=bug.yml" target="_blank" rel="noopener" class="hover:text-white transition-colors flex items-center gap-1.5">
<i data-lucide="bug" class="w-3.5 h-3.5 text-rose-400"></i> Bug melden
</a>
<a href="https://github.com/cwillam" target="_blank" rel="noopener" class="hover:text-white transition-colors flex items-center gap-1.5">
<i data-lucide="code-2" class="w-3.5 h-3.5"></i> GitHub
</a>
<a href="https://discord.gg/5BM5YJadDs" target="_blank" rel="noopener" class="hover:text-white transition-colors flex items-center gap-1.5">
<i data-lucide="message-square" class="w-3.5 h-3.5 text-[#5865F2]"></i> Discord
</a>
</div>
</div>
</footer>
<!-- Standardized Support Modal -->
<div
id="supportModal"
class="fixed inset-0 z-50 bg-black/85 backdrop-blur-sm hidden flex items-center justify-center p-4"
onclick="if(event.target === this) closeSupportModal()"
>
<div class="w-full max-w-md bg-dark-card border border-dark-border rounded-2xl p-6 shadow-2xl space-y-4 relative">
<div class="flex items-center justify-between pb-3 border-b border-dark-border">
<div class="flex items-center gap-2.5">
<div class="w-8 h-8 rounded-lg bg-[#FFDD00]/15 border border-[#FFDD00]/30 flex items-center justify-center text-[#FFDD00]">
<i data-lucide="coffee" class="w-4 h-4"></i>
</div>
<div>
<h3 class="font-bold text-base text-white leading-tight">Projekt unterstützen</h3>
<span class="text-[10px] font-mono text-dark-dim leading-none">Freiwillig & 100% werbefrei</span>
</div>
</div>
<button
onclick="closeSupportModal()"
class="w-8 h-8 rounded-lg border border-dark-border hover:border-dark-border/80 bg-dark-bg hover:bg-dark-border/40 text-dark-muted hover:text-white transition-all flex items-center justify-center"
title="Schließen"
aria-label="Modal schließen"
>
<i data-lucide="x" class="w-4 h-4"></i>
</button>
</div>
<p class="text-xs text-dark-muted leading-relaxed">
Die Tracker sind komplett kostenlos, werbefrei und quelloffen. Wenn dir das Tool bei der Prüfungsvorbereitung hilft, freue ich mich riesig über einen Kaffee!
</p>
<div class="flex flex-col gap-3 pt-1">
<!-- PayPal Button -->
<a
href="https://www.paypal.com/paypalme/parablepanorama"
target="_blank"
rel="noopener"
class="flex items-center justify-between p-3.5 rounded-xl bg-[#0070BA]/10 border border-[#0070BA]/30 hover:border-[#0070BA]/60 hover:bg-[#0070BA]/20 transition-all group"
>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg bg-[#0070BA]/20 flex items-center justify-center text-[#0079C1] group-hover:scale-105 transition-transform">
<i data-lucide="wallet" class="w-4 h-4"></i>
</div>
<div class="flex flex-col text-left">
<span class="font-bold text-white text-xs">PayPal</span>
<span class="text-[10px] text-dark-muted font-mono">paypal.me/parablepanorama · Schnell & unkompliziert</span>
</div>
</div>
<i data-lucide="chevron-right" class="w-4 h-4 text-dark-muted group-hover:translate-x-0.5 transition-transform"></i>
</a>
<!-- Buy Me A Coffee Button -->
<a
href="https://buymeacoffee.com/cwillam"
target="_blank"
rel="noopener"
class="flex items-center justify-between p-3.5 rounded-xl bg-[#FFDD00]/10 border border-[#FFDD00]/30 hover:border-[#FFDD00]/60 hover:bg-[#FFDD00]/20 transition-all group"
>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg bg-[#FFDD00]/20 flex items-center justify-center text-[#FFDD00] group-hover:scale-105 transition-transform">
<i data-lucide="coffee" class="w-4 h-4"></i>
</div>
<div class="flex flex-col text-left">
<span class="font-bold text-white text-xs">Buy Me a Coffee</span>
<span class="text-[10px] text-dark-muted font-mono">buymeacoffee.com/cwillam · Einmalig spenden</span>
</div>
</div>
<i data-lucide="chevron-right" class="w-4 h-4 text-dark-muted group-hover:translate-x-0.5 transition-transform"></i>
</a>
</div>
<div class="pt-2 border-t border-dark-border/60 flex items-center justify-center gap-1.5 text-[11px] font-mono text-dark-dim">
<i data-lucide="shield-check" class="w-3.5 h-3.5 text-emerald-400"></i>
<span>Sichere Weiterleitung · Keine Datenübertragung</span>
</div>
</div>
</div>
<!-- Scripts -->
<script src="assets/js/lucide.min.js?v=3.0.0"></script>
<script src="assets/js/confetti.js?v=3.0.0"></script>
<script src="assets/js/pseudocode.js?v=3.0.1"></script>
<script>
function openSupportModal() {
const modal = document.getElementById("supportModal");
if (modal) {
modal.classList.remove("hidden");
if (window.lucide) lucide.createIcons();
}
}
function closeSupportModal() {
const modal = document.getElementById("supportModal");
if (modal) modal.classList.add("hidden");
}
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") closeSupportModal();
});
if (window.lucide) lucide.createIcons();
</script>
<script>
// Service Worker Registration
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("sw.js?v=3.0.0").catch(() => {});
});
}
</script>