-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1517 lines (1337 loc) · 47.2 KB
/
index.html
File metadata and controls
1517 lines (1337 loc) · 47.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Personal Wiki / Knowledge Base</title>
<meta name="description" content="A single-file personal wiki and knowledge base with markdown notes, local editing, search, theme toggle, and syntax-highlighted documentation." />
<meta property="og:title" content="Personal Wiki / Knowledge Base" />
<meta property="og:description" content="Single-file browser-based wiki with markdown rendering, editable notes, search, folders, and local persistence." />
<meta property="og:type" content="website" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism-tomorrow.min.css" />
<script defer src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/prism.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-bash.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-json.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.min.js"></script>
<style>
:root,
[data-theme="light"] {
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
--text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
--text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2rem);
--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;
--radius-sm: 0.375rem;
--radius-md: 0.75rem;
--radius-lg: 1rem;
--radius-xl: 1.25rem;
--transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
--font-body: 'Satoshi', Inter, system-ui, sans-serif;
--font-display: 'Source Serif 4', Georgia, serif;
--color-bg: #f7f6f2;
--color-surface: #fbfbf9;
--color-surface-2: #f3f0ec;
--color-surface-offset: #ece9e3;
--color-surface-accent: color-mix(in oklch, #01696f 7%, #fbfbf9);
--color-border: #d4d1ca;
--color-divider: #dfdcd6;
--color-text: #28251d;
--color-text-muted: #69655d;
--color-text-faint: #8d8980;
--color-text-inverse: #f9f8f4;
--color-primary: #01696f;
--color-primary-hover: #0c4e54;
--color-primary-highlight: #dce9e8;
--color-success: #437a22;
--color-warning: #964219;
--shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
--shadow-md: 0 8px 24px oklch(0.2 0.01 80 / 0.08);
--sidebar-width: 21rem;
--header-height: 4.25rem;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
--color-bg: #171614;
--color-surface: #1c1b19;
--color-surface-2: #22211f;
--color-surface-offset: #2a2926;
--color-surface-accent: color-mix(in oklch, #4f98a3 10%, #1c1b19);
--color-border: #393836;
--color-divider: #2a2926;
--color-text: #e2e0db;
--color-text-muted: #b2aea6;
--color-text-faint: #858179;
--color-text-inverse: #171614;
--color-primary: #4f98a3;
--color-primary-hover: #79b3bc;
--color-primary-highlight: #273436;
--color-success: #6daa45;
--color-warning: #fdab43;
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.24);
--shadow-md: 0 10px 30px oklch(0 0 0 / 0.32);
}
}
[data-theme="dark"] {
--color-bg: #171614;
--color-surface: #1c1b19;
--color-surface-2: #22211f;
--color-surface-offset: #2a2926;
--color-surface-accent: color-mix(in oklch, #4f98a3 10%, #1c1b19);
--color-border: #393836;
--color-divider: #2a2926;
--color-text: #e2e0db;
--color-text-muted: #b2aea6;
--color-text-faint: #858179;
--color-text-inverse: #171614;
--color-primary: #4f98a3;
--color-primary-hover: #79b3bc;
--color-primary-highlight: #273436;
--color-success: #6daa45;
--color-warning: #fdab43;
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.24);
--shadow-md: 0 10px 30px oklch(0 0 0 / 0.32);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
-moz-text-size-adjust: none;
-webkit-text-size-adjust: none;
text-size-adjust: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
scroll-behavior: smooth;
}
body {
min-height: 100dvh;
line-height: 1.6;
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--color-text);
background: var(--color-bg);
overflow: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; }
a, button, input, textarea, select {
transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
button { cursor: pointer; background: none; border: none; }
:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 3px;
border-radius: var(--radius-sm);
}
::selection { background: color-mix(in oklch, var(--color-primary) 22%, transparent); }
.sr-only {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}
.skip-link {
position: absolute; left: var(--space-4); top: -3rem; background: var(--color-primary); color: var(--color-text-inverse);
padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); z-index: 50; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }
.app-shell {
display: grid;
grid-template-columns: var(--sidebar-width) 1fr;
height: 100dvh;
}
.sidebar {
background: linear-gradient(180deg, var(--color-surface), var(--color-surface-2));
border-right: 1px solid color-mix(in oklch, var(--color-text) 12%, transparent);
display: flex;
flex-direction: column;
overflow: hidden;
min-width: 0;
}
.sidebar-header {
padding: var(--space-5);
border-bottom: 1px solid var(--color-divider);
display: grid;
gap: var(--space-4);
background: color-mix(in oklch, var(--color-surface) 76%, var(--color-bg));
}
.brand-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
}
.brand {
display: flex;
align-items: center;
gap: var(--space-3);
min-width: 0;
}
.brand-mark {
width: 2.5rem;
height: 2.5rem;
padding: 0.45rem;
border-radius: 0.85rem;
background: var(--color-surface-accent);
color: var(--color-primary);
box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--color-primary) 18%, transparent);
flex: 0 0 auto;
}
.brand-copy strong {
display: block;
font-size: var(--text-sm);
letter-spacing: 0.01em;
}
.brand-copy span {
display: block;
color: var(--color-text-muted);
font-size: var(--text-xs);
}
.icon-button,
.action-button,
.nav-item,
.editor-button,
.save-button,
.cancel-button,
.mobile-menu-button {
min-height: 44px;
}
.icon-button,
.mobile-menu-button {
width: 44px;
height: 44px;
display: inline-grid;
place-items: center;
border-radius: var(--radius-md);
border: 1px solid color-mix(in oklch, var(--color-text) 10%, transparent);
background: var(--color-surface);
}
.icon-button:hover,
.mobile-menu-button:hover {
background: var(--color-surface-accent);
border-color: color-mix(in oklch, var(--color-primary) 28%, transparent);
}
.search-wrap {
position: relative;
}
.search-wrap svg {
position: absolute;
left: var(--space-3);
top: 50%;
transform: translateY(-50%);
color: var(--color-text-faint);
width: 1rem;
height: 1rem;
pointer-events: none;
}
.search-input,
.title-input,
.folder-input,
.editor-textarea {
width: 100%;
border: 1px solid color-mix(in oklch, var(--color-text) 12%, transparent);
border-radius: var(--radius-md);
background: var(--color-surface);
color: var(--color-text);
}
.search-input {
padding: 0.8rem 0.9rem 0.8rem 2.5rem;
font-size: var(--text-sm);
}
.search-input::placeholder,
.title-input::placeholder,
.folder-input::placeholder,
.editor-textarea::placeholder {
color: var(--color-text-faint);
}
.search-meta {
display: flex;
justify-content: space-between;
align-items: center;
gap: var(--space-3);
color: var(--color-text-muted);
font-size: var(--text-xs);
}
.sidebar-body {
flex: 1;
overflow-y: auto;
padding: var(--space-4);
overscroll-behavior: contain;
}
.folder-section {
display: grid;
gap: var(--space-2);
margin-bottom: var(--space-5);
}
.folder-heading {
display: flex;
justify-content: space-between;
align-items: center;
gap: var(--space-2);
color: var(--color-text-muted);
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: 0.08em;
padding: 0 var(--space-2);
}
.folder-count {
background: var(--color-surface-offset);
border-radius: var(--radius-full);
padding: 0.15rem 0.5rem;
font-size: var(--text-xs);
color: var(--color-text-muted);
}
.nav-list {
display: grid;
gap: var(--space-2);
}
.nav-item {
width: 100%;
text-align: left;
display: grid;
gap: 0.18rem;
padding: 0.8rem 0.95rem;
border-radius: var(--radius-md);
background: transparent;
border: 1px solid transparent;
}
.nav-item:hover {
background: color-mix(in oklch, var(--color-primary) 5%, var(--color-surface));
border-color: color-mix(in oklch, var(--color-primary) 14%, transparent);
transform: translateY(-1px);
}
.nav-item.active {
background: var(--color-surface-accent);
border-color: color-mix(in oklch, var(--color-primary) 24%, transparent);
box-shadow: var(--shadow-sm);
}
.nav-title {
font-size: var(--text-sm);
font-weight: 600;
color: var(--color-text);
}
.nav-description {
font-size: var(--text-xs);
color: var(--color-text-muted);
line-height: 1.4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
-webkit-line-clamp: 2;
}
.sidebar-footer {
padding: var(--space-4);
border-top: 1px solid var(--color-divider);
background: color-mix(in oklch, var(--color-surface) 80%, var(--color-bg));
display: flex;
gap: var(--space-3);
flex-wrap: wrap;
}
.action-button,
.save-button,
.cancel-button,
.editor-button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: 0.8rem 1rem;
border-radius: var(--radius-md);
border: 1px solid color-mix(in oklch, var(--color-text) 12%, transparent);
font-size: var(--text-sm);
font-weight: 600;
}
.action-button.primary,
.save-button {
background: var(--color-primary);
color: var(--color-text-inverse);
border-color: var(--color-primary);
}
.action-button.primary:hover,
.save-button:hover {
background: var(--color-primary-hover);
border-color: var(--color-primary-hover);
}
.action-button.secondary,
.cancel-button,
.editor-button {
background: var(--color-surface);
color: var(--color-text);
}
.action-button.secondary:hover,
.cancel-button:hover,
.editor-button:hover {
background: var(--color-surface-accent);
}
.main-panel {
min-width: 0;
display: grid;
grid-template-rows: auto 1fr;
overflow: hidden;
}
.topbar {
min-height: var(--header-height);
border-bottom: 1px solid var(--color-divider);
background: color-mix(in oklch, var(--color-bg) 88%, var(--color-surface));
backdrop-filter: blur(12px);
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-4);
padding: var(--space-4) var(--space-5);
position: sticky;
top: 0;
z-index: 10;
}
.topbar-left,
.topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
min-width: 0;
}
.page-kicker {
font-size: var(--text-xs);
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.page-title-wrap h1 {
font-size: var(--text-lg);
font-weight: 700;
letter-spacing: -0.02em;
}
.page-title-wrap p {
color: var(--color-text-muted);
font-size: var(--text-sm);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 38ch;
}
.content-scroll {
overflow-y: auto;
overscroll-behavior: contain;
padding: clamp(var(--space-4), 3vw, var(--space-8));
}
.reading-shell {
max-width: 78rem;
margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, 1fr) 19rem;
gap: var(--space-6);
align-items: start;
}
.article-panel,
.meta-panel,
.editor-panel {
background: var(--color-surface);
border: 1px solid color-mix(in oklch, var(--color-text) 10%, transparent);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-sm);
}
.article-panel {
overflow: hidden;
}
.article-hero {
padding: clamp(var(--space-5), 4vw, var(--space-8));
border-bottom: 1px solid var(--color-divider);
background: linear-gradient(135deg, color-mix(in oklch, var(--color-primary) 7%, var(--color-surface)), var(--color-surface));
display: grid;
gap: var(--space-3);
}
.article-badges {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
align-items: center;
}
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 0.25rem 0.6rem;
border-radius: var(--radius-full);
background: color-mix(in oklch, var(--color-primary) 12%, var(--color-surface));
color: var(--color-primary);
font-size: var(--text-xs);
font-weight: 700;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.article-hero h2 {
font-size: var(--text-xl);
font-family: var(--font-display);
font-weight: 700;
letter-spacing: -0.03em;
max-width: 18ch;
}
.article-hero p {
color: var(--color-text-muted);
max-width: 60ch;
}
.article-content {
padding: clamp(var(--space-5), 4vw, var(--space-8));
content-visibility: auto;
}
.article-content > * + * { margin-top: var(--space-4); }
.article-content h1,
.article-content h2,
.article-content h3 {
font-family: var(--font-display);
letter-spacing: -0.02em;
margin-top: var(--space-8);
margin-bottom: var(--space-3);
}
.article-content h1 { font-size: var(--text-xl); }
.article-content h2 { font-size: var(--text-lg); }
.article-content h3 { font-size: 1.2rem; }
.article-content p,
.article-content li,
.article-content blockquote {
max-width: 72ch;
}
.article-content ul,
.article-content ol {
padding-left: 1.3rem;
display: grid;
gap: var(--space-2);
}
.article-content a {
color: var(--color-primary);
text-underline-offset: 0.18em;
}
.article-content blockquote {
padding: var(--space-4) var(--space-5);
border-left: 3px solid color-mix(in oklch, var(--color-primary) 36%, transparent);
background: color-mix(in oklch, var(--color-primary) 5%, var(--color-surface-2));
border-radius: 0 var(--radius-md) var(--radius-md) 0;
color: var(--color-text-muted);
}
.article-content table {
width: 100%;
border-collapse: collapse;
margin-block: var(--space-5);
display: block;
overflow-x: auto;
}
.article-content th,
.article-content td {
border: 1px solid var(--color-divider);
padding: 0.8rem 0.9rem;
text-align: left;
vertical-align: top;
min-width: 9rem;
}
.article-content th {
background: var(--color-surface-2);
font-size: var(--text-sm);
}
.article-content :not(pre) > code {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
background: color-mix(in oklch, var(--color-primary) 8%, var(--color-surface-2));
padding: 0.15rem 0.4rem;
border-radius: 0.4rem;
font-size: 0.95em;
}
.article-content pre[class*="language-"] {
border-radius: var(--radius-lg);
padding: var(--space-4);
box-shadow: inset 0 0 0 1px color-mix(in oklch, white 8%, transparent);
overflow-x: auto;
}
.article-content hr {
border: 0;
border-top: 1px solid var(--color-divider);
margin-block: var(--space-6);
}
.meta-panel {
position: sticky;
top: calc(var(--space-4));
padding: var(--space-5);
display: grid;
gap: var(--space-5);
}
.meta-block {
display: grid;
gap: var(--space-2);
}
.meta-label {
font-size: var(--text-xs);
color: var(--color-text-muted);
letter-spacing: 0.08em;
text-transform: uppercase;
}
.meta-value {
font-size: var(--text-sm);
color: var(--color-text);
}
.meta-list {
display: grid;
gap: var(--space-2);
list-style: none;
}
.meta-list li {
padding: 0.7rem 0.85rem;
background: var(--color-surface-2);
border-radius: var(--radius-md);
border: 1px solid color-mix(in oklch, var(--color-text) 8%, transparent);
font-size: var(--text-sm);
}
.empty-state {
min-height: 50vh;
display: grid;
place-items: center;
text-align: center;
padding: var(--space-8);
}
.empty-card {
max-width: 34rem;
padding: var(--space-8);
background: var(--color-surface);
border: 1px solid color-mix(in oklch, var(--color-text) 10%, transparent);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-sm);
display: grid;
gap: var(--space-4);
}
.empty-card h2 {
font-size: var(--text-xl);
font-family: var(--font-display);
}
.empty-card p {
color: var(--color-text-muted);
max-width: 40ch;
margin: 0 auto;
}
.editor-panel {
padding: var(--space-5);
display: none;
gap: var(--space-4);
}
.editor-panel.active {
display: grid;
}
.editor-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--space-4);
}
.field-group {
display: grid;
gap: var(--space-2);
}
.field-group label {
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--color-text-muted);
font-weight: 700;
}
.title-input,
.folder-input {
padding: 0.8rem 0.9rem;
background: var(--color-surface-2);
}
.editor-textarea {
min-height: 24rem;
resize: vertical;
padding: 1rem;
background: var(--color-surface-2);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.95rem;
line-height: 1.6;
}
.editor-actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
}
.status-pill {
display: inline-flex;
align-items: center;
gap: var(--space-2);
padding: 0.45rem 0.7rem;
border-radius: var(--radius-full);
background: color-mix(in oklch, var(--color-success) 12%, var(--color-surface));
color: var(--color-success);
font-size: var(--text-xs);
font-weight: 700;
}
.status-pill.warning {
background: color-mix(in oklch, var(--color-warning) 14%, var(--color-surface));
color: var(--color-warning);
}
.mobile-menu-button { display: none; }
.hidden { display: none !important; }
@media (max-width: 1080px) {
.reading-shell {
grid-template-columns: minmax(0, 1fr);
}
.meta-panel {
position: static;
}
}
@media (max-width: 860px) {
body { overflow: auto; }
.app-shell {
grid-template-columns: 1fr;
height: auto;
min-height: 100dvh;
}
.sidebar {
position: fixed;
inset: 0 auto 0 0;
width: min(88vw, 22rem);
z-index: 30;
transform: translateX(-100%);
transition: transform var(--transition-interactive);
box-shadow: var(--shadow-md);
}
.sidebar.open {
transform: translateX(0);
}
.sidebar-backdrop {
position: fixed;
inset: 0;
background: oklch(0 0 0 / 0.48);
z-index: 20;
}
.mobile-menu-button { display: inline-grid; }
.topbar {
padding-inline: var(--space-4);
}
.page-title-wrap p {
max-width: 22ch;
}
.content-scroll {
overflow: visible;
padding: var(--space-4);
}
.editor-grid {
grid-template-columns: 1fr;
}
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
</style>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
<div class="app-shell">
<aside class="sidebar" id="sidebar" aria-label="Wiki navigation">
<div class="sidebar-header">
<div class="brand-row">
<div class="brand">
<svg class="brand-mark" viewBox="0 0 64 64" fill="none" aria-label="Wiki logo">
<path d="M14 18.5C14 14.9101 16.9101 12 20.5 12H43.5C47.0899 12 50 14.9101 50 18.5V45.5C50 49.0899 47.0899 52 43.5 52H20.5C16.9101 52 14 49.0899 14 45.5V18.5Z" stroke="currentColor" stroke-width="3"/>
<path d="M22 22H42" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
<path d="M22 32H42" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
<path d="M22 42H33" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
</svg>
<div class="brand-copy">
<strong>Personal Wiki</strong>
<span>Offline-friendly note hub</span>
</div>
</div>
<button class="icon-button" type="button" id="themeToggle" aria-label="Toggle dark mode" title="Toggle theme">
<span aria-hidden="true">◐</span>
</button>
</div>
<div class="search-wrap">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="11" cy="11" r="7"></circle><path d="M20 20l-3.5-3.5"></path></svg>
<label class="sr-only" for="searchInput">Search pages</label>
<input id="searchInput" class="search-input" type="search" placeholder="Search pages, folders, commands..." autocomplete="off" />
</div>
<div class="search-meta">
<span id="resultCount">0 notes</span>
<span>Cmd/Ctrl + K focuses search</span>
</div>
</div>
<div class="sidebar-body" id="navContainer"></div>
<div class="sidebar-footer">
<button class="action-button primary" type="button" id="newNoteButton">New note</button>
<button class="action-button secondary" type="button" id="resetButton">Reset sample data</button>
</div>
</aside>
<div class="main-panel">
<header class="topbar">
<div class="topbar-left">
<button class="mobile-menu-button" type="button" id="mobileMenuButton" aria-label="Open navigation">☰</button>
<div class="page-title-wrap">
<div class="page-kicker" id="pageFolder">Knowledge Base</div>
<h1 id="pageTitle">Loading…</h1>
<p id="pageSummary">Select a note from the sidebar.</p>
</div>
</div>
<div class="topbar-right">
<button class="editor-button" type="button" id="editButton">Edit note</button>
<button class="editor-button" type="button" id="previewButton">Preview</button>
</div>
</header>
<main class="content-scroll" id="main-content" tabindex="-1">
<section class="editor-panel" id="editorPanel" aria-label="Note editor">
<div class="editor-grid">
<div class="field-group">
<label for="titleInput">Note title</label>
<input id="titleInput" class="title-input" type="text" placeholder="For example: Router Recovery" />
</div>
<div class="field-group">
<label for="folderInput">Folder</label>
<input id="folderInput" class="folder-input" type="text" placeholder="For example: Infrastructure" />
</div>
</div>
<div class="field-group">
<label for="editorTextarea">Markdown content</label>
<textarea id="editorTextarea" class="editor-textarea" spellcheck="false" placeholder="# New note\n\nWrite your instructions here."></textarea>
</div>
<div class="editor-actions">
<button class="save-button" type="button" id="saveButton">Save note</button>
<button class="cancel-button" type="button" id="cancelButton">Cancel</button>
<span class="status-pill warning">Saved in your browser via localStorage</span>
</div>
</section>
<div class="reading-shell" id="readingShell">
<article class="article-panel" aria-live="polite">
<div class="article-hero">
<div class="article-badges">
<span class="badge" id="heroFolderBadge">Folder</span>
<span class="badge" id="heroStatusBadge">Ready</span>
</div>
<h2 id="heroTitle">Loading note</h2>
<p id="heroDescription">Your selected article will render here with Markdown and syntax highlighting.</p>
</div>
<div class="article-content" id="articleContent"></div>
</article>
<aside class="meta-panel" aria-label="Article details">
<div class="meta-block">
<div class="meta-label">Storage</div>
<div class="meta-value">Edits persist locally in this browser.</div>
</div>
<div class="meta-block">
<div class="meta-label">Quick tips</div>
<ul class="meta-list">
<li>Use Markdown headings to build clear runbooks.</li>
<li>Add fenced code blocks with <code>bash</code>, <code>json</code>, or <code>yaml</code>.</li>
<li>Use folders to group recovery, finance, and account notes.</li>
</ul>
</div>
<div class="meta-block">
<div class="meta-label">Current note</div>
<div class="meta-value" id="noteStats">0 words</div>
</div>
</aside>
</div>
</main>
</div>
</div>
<script>
const STORAGE_KEY = 'personalWikiData.v1';
const THEME_KEY = 'personalWikiTheme';
const defaultWiki = {
notes: [
{
id: 'getting-started',
title: 'Getting Started',
folder: 'Welcome',
summary: 'How the single-file wiki works, how to add notes, and how local saving behaves.',
updatedAt: '2026-04-09T15:09:00Z',
content: `# Getting Started
Welcome to your **Personal Wiki / Knowledge Base**. This file is built to behave like a compact browser-based documentation app.
## What is already included
- A fixed navigation sidebar with folders.
- A Markdown-powered reading area using Marked.js.
- Prism syntax highlighting for terminal and config snippets.
- A quick search box for instant filtering.
- Browser saving using \`localStorage\`.
- A built-in editor so you can maintain your "Hit by a Bus" instructions directly in the page.
## How notes are stored
This wiki loads starter notes from a JavaScript object named \`defaultWiki\`. After that, your saved version is written to \`localStorage\`, so edits stay in this browser.
## How to add a new note
1. Click **New note** in the sidebar.
2. Enter a title and folder name.
3. Write your content in Markdown.
4. Click **Save note**.
## How to edit the starter data in code
If you prefer editing the source file directly, open the \`defaultWiki.notes\` array and add another object in this format:
\`\`\`json
{
"id": "my-note-id",
"title": "My New Note",
"folder": "Operations",
"summary": "One-line description for search results.",
"updatedAt": "2026-04-09T15:09:00Z",
"content": "# My New Note\\n\\nWrite markdown here."
}
\`\`\`
## Markdown example
Use fenced code blocks for commands you may need under pressure:
\`\`\`bash
ssh admin@192.168.1.10
sudo systemctl restart nginx
docker compose ps
\`\`\`
## Suggested folders
- Welcome
- Home Lab
- Accounts
- Bills
- Insurance