-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
999 lines (957 loc) · 33.7 KB
/
index.html
File metadata and controls
999 lines (957 loc) · 33.7 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
<!doctype html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MD2DOCX | KYOTU Technology</title>
<meta
name="description"
content="Convert Markdown to professional Word documents - by KYOTU Technology"
/>
<link rel="icon" type="image/svg+xml" href="./assets/favicon.svg" />
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
kyotu: {
orange: "#f97c00",
"orange-light": "#ff9e29",
dark: "#0f0f0f",
gray: "#1f2937",
},
},
fontFamily: {
sans: ["Inter", "system-ui", "sans-serif"],
mono: ["JetBrains Mono", "Consolas", "monospace"],
},
},
},
};
</script>
<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=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/github.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docx@9.5.1/dist/index.iife.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfmake@0.3/build/pdfmake.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfmake@0.3/build/vfs_fonts.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js"></script>
<style>
.dropzone.dragover {
border-color: #f97c00;
background: linear-gradient(
135deg,
rgba(249, 124, 0, 0.05) 0%,
rgba(255, 158, 41, 0.05) 100%
);
}
.gradient-text {
background: linear-gradient(135deg, #ff9e29 0%, #f97c00 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.gradient-border {
position: relative;
}
.gradient-border::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, #ff9e29 0%, #f97c00 100%);
}
.btn-primary {
background: linear-gradient(135deg, #ff9e29 0%, #f97c00 100%);
transition: all 0.2s ease;
}
.btn-primary:hover {
box-shadow: 0 4px 20px rgba(249, 124, 0, 0.4);
transform: translateY(-1px);
}
.btn-primary:active {
transform: translateY(0);
}
#preview {
font-family: Georgia, system-ui, serif;
line-height: 1.6;
}
#preview .doc-title {
font-weight: 700;
}
#preview .doc-subtitle {
font-weight: 500;
}
#preview .doc-author {
font-weight: 500;
}
#preview h1,
#preview h2,
#preview h3,
#preview h4 {
font-weight: 700;
}
#preview pre {
overflow-x: auto;
}
#preview pre code.hljs {
background: transparent !important;
padding: 0;
}
#preview .checklist {
list-style: none;
padding-left: 0;
}
#preview a {
text-decoration: none;
transition: border-color 0.2s;
}
#preview a:hover {
border-bottom-color: currentColor;
}
.scrollbar-thin::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-track {
background: #f1f5f9;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 3px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
.resizer {
width: 6px;
background: #e5e7eb;
cursor: col-resize;
transition: background 0.2s;
position: relative;
flex-shrink: 0;
}
.resizer:hover,
.resizer.dragging {
background: #f97c00;
}
.resizer::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 2px;
height: 30px;
background: #9ca3af;
border-radius: 1px;
}
.resizer:hover::after,
.resizer.dragging::after {
background: white;
}
.settings-panel {
max-height: 0;
overflow: hidden;
transition:
max-height 0.3s ease,
padding 0.3s ease;
}
.settings-panel.open {
max-height: 200px;
}
.score-badge {
display: inline-flex;
align-items: center;
gap: 0.25rem;
font-size: 0.75rem;
font-weight: 600;
padding: 0.125rem 0.5rem;
border-radius: 9999px;
cursor: pointer;
transition: opacity 0.2s;
}
.score-badge:hover {
opacity: 0.8;
}
.readability-panel {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
.readability-panel.open {
max-height: 600px;
}
.metrics-table {
width: 100%;
border-collapse: collapse;
font-size: 0.8rem;
}
.metrics-table th {
text-align: left;
color: #6b7280;
font-weight: 500;
padding: 0.25rem 0.5rem;
border-bottom: 2px solid #e5e7eb;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.metrics-table th:not(:first-child) {
text-align: right;
}
.metrics-table td {
padding: 0.2rem 0.5rem;
border-bottom: 1px solid #f3f4f6;
}
.metrics-table td:not(:first-child) {
text-align: right;
font-family: monospace;
font-weight: 500;
}
.metrics-table .metrics-total td {
border-top: 2px solid #e5e7eb;
border-bottom: none;
font-weight: 700;
padding-top: 0.375rem;
}
.metrics-table .metrics-zero td:not(:first-child) {
color: #d1d5db;
}
.toggle-switch {
position: relative;
width: 36px;
height: 20px;
background: #374151;
border-radius: 10px;
cursor: pointer;
transition: background 0.2s;
}
.toggle-switch.active {
background: #f97c00;
}
.toggle-switch::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 16px;
height: 16px;
background: white;
border-radius: 50%;
transition: transform 0.2s;
}
.toggle-switch.active::after {
transform: translateX(16px);
}
.scroll-highlight {
background-color: rgba(249, 124, 0, 0.12);
transition: background-color 0.3s;
}
.preview-mode-btn.active {
background: linear-gradient(135deg, #ff9e29 0%, #f97c00 100%);
color: white;
}
#preview.page-mode {
background: #e5e7eb;
padding: 20px;
}
.pagedjs_pages {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
.pagedjs_page {
background: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin: 0 auto;
}
.pagedjs_page_content {
font-family: Georgia, serif;
}
.pagedjs_margin-top-center,
.pagedjs_margin-bottom-center {
font-family: Calibri, sans-serif;
font-size: 10pt;
color: #6b7280;
}
.pagedjs_margin-bottom-center {
border-top: 1px solid #e5e7eb;
padding-top: 8px;
}
.formatting-toolbar {
position: fixed;
z-index: 150;
background: #1f2937;
border: 1px solid #374151;
border-radius: 8px;
padding: 4px;
display: flex;
gap: 2px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
opacity: 0;
transform: translateY(4px);
transition:
opacity 0.15s,
transform 0.15s;
pointer-events: none;
}
.formatting-toolbar.visible {
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}
.formatting-toolbar button {
width: 32px;
height: 32px;
border-radius: 6px;
border: none;
background: transparent;
color: #d1d5db;
font-size: 14px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.1s;
}
.formatting-toolbar button:hover {
background: #374151;
color: white;
}
.formatting-toolbar button.active {
background: #f97c00;
color: white;
}
.formatting-toolbar-sep {
width: 1px;
background: #374151;
margin: 4px 2px;
}
.explorer-item {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 10px;
cursor: pointer;
font-size: 12px;
color: #4b5563;
transition: background 0.1s;
position: relative;
}
.explorer-item:hover {
background: #e5e7eb;
}
.explorer-item.active {
background: #dbeafe;
color: #1d4ed8;
font-weight: 500;
}
.explorer-item .main-star {
color: #f97c00;
font-size: 11px;
flex-shrink: 0;
cursor: pointer;
opacity: 0.3;
transition: opacity 0.15s;
}
.explorer-item .main-star:hover {
opacity: 0.7;
}
.explorer-item .main-star.is-main {
opacity: 1;
}
.explorer-item .doc-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.explorer-item .item-actions {
display: none;
gap: 2px;
flex-shrink: 0;
}
.explorer-item:hover .item-actions {
display: flex;
}
.explorer-item .item-actions button {
padding: 2px;
color: #9ca3af;
border-radius: 3px;
transition:
color 0.1s,
background 0.1s;
}
.explorer-item .item-actions button:hover {
color: #ef4444;
background: rgba(239, 68, 68, 0.1);
}
.explorer-item .inline-rename {
flex: 1;
font-size: 13px;
padding: 1px 4px;
border: 1px solid #f97c00;
border-radius: 3px;
outline: none;
background: white;
}
.explorer-item .include-hint {
font-size: 10px;
color: #9ca3af;
display: none;
white-space: nowrap;
}
.explorer-item:hover .include-hint {
display: block;
}
#explorerPanel.explorer-dragover {
background: #fffaf5;
box-shadow: inset 0 0 0 2px #f97c00;
}
#explorerPanel.explorer-dragover #fileList::after {
content: "Drop files here";
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
margin: 8px;
border: 2px dashed #f97c00;
border-radius: 8px;
color: #f97c00;
font-size: 12px;
font-weight: 500;
}
.include-autocomplete {
position: fixed;
z-index: 200;
background: #1f2937;
border: 1px solid #374151;
border-radius: 8px;
padding: 4px;
min-width: 180px;
max-width: 300px;
max-height: 200px;
overflow-y: auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
display: none;
font-size: 13px;
}
.include-autocomplete-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 10px;
color: #d1d5db;
border-radius: 6px;
cursor: pointer;
transition: background 0.1s;
}
.include-autocomplete-item:hover,
.include-autocomplete-item.selected {
background: #374151;
color: white;
}
</style>
</head>
<body class="h-full flex flex-col bg-gray-50 font-sans">
<header class="bg-kyotu-dark gradient-border shrink-0">
<div class="px-4 py-3 flex items-center justify-between">
<div class="flex items-center gap-4">
<img src="./assets/logo-white.svg" alt="KYOTU" class="h-8" />
<div class="hidden sm:block h-6 w-px bg-gray-700"></div>
<div class="hidden sm:flex items-center gap-2">
<span class="text-white font-semibold">MD2DOCX</span>
<span class="text-gray-500 text-sm">Markdown → Word</span>
</div>
</div>
<div class="flex items-center gap-2">
<select
id="themeSelect"
class="text-sm bg-gray-800 text-gray-300 border border-gray-700 rounded px-3 py-1.5 focus:outline-none focus:border-kyotu-orange cursor-pointer hover:bg-gray-700 transition-colors"
></select>
<button
id="manageTemplatesBtn"
class="text-gray-400 hover:text-white p-1.5 rounded hover:bg-white/10 transition-colors"
title="Manage Templates"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"
/>
</svg>
</button>
<div
id="previewModeToggle"
class="flex bg-gray-800 rounded border border-gray-700 overflow-hidden"
>
<button
id="modeContinuous"
class="preview-mode-btn px-2 py-1.5 text-gray-300 hover:bg-gray-700 transition-colors"
title="Continuous scroll"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<button
id="modePages"
class="preview-mode-btn px-2 py-1.5 text-gray-300 hover:bg-gray-700 transition-colors"
title="Page view"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg>
</button>
</div>
<button
id="settingsBtn"
class="text-gray-400 hover:text-white p-1.5 rounded hover:bg-white/10 transition-colors"
title="Advanced Settings"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
/>
</svg>
</button>
<button
id="shareBtn"
class="text-gray-400 hover:text-white p-1.5 rounded hover:bg-white/10 transition-colors"
title="Share document (Ctrl+Shift+L)"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"
/>
</svg>
</button>
<div class="h-6 w-px bg-gray-700 hidden sm:block"></div>
<button
id="loadExample"
class="text-sm text-gray-400 hover:text-white px-3 py-1.5 rounded hover:bg-white/10 transition-colors"
>
Example
</button>
<label
class="text-sm text-gray-400 hover:text-white px-3 py-1.5 rounded hover:bg-white/10 transition-colors cursor-pointer"
>
<input type="file" id="fileInput" accept=".md,.txt" class="hidden" />
Load File
</label>
<div class="relative">
<button
id="generateBtn"
class="btn-primary text-white text-sm font-medium py-2 px-5 rounded-lg flex items-center gap-2"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg>
<span id="generateBtnText">DOCX</span>
<svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
<div
id="formatDropdown"
class="absolute right-0 top-full mt-1 bg-gray-800 border border-gray-700 rounded-lg shadow-xl hidden z-50 min-w-[140px]"
>
<button
data-format="docx"
class="format-option w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white rounded-t-lg flex items-center gap-2"
>
<svg
class="w-4 h-4 text-blue-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg>
Download DOCX
</button>
<button
data-format="pdf"
class="format-option w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white flex items-center gap-2"
>
<svg
class="w-4 h-4 text-red-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"
/>
</svg>
Download PDF
</button>
<button
data-format="html"
class="format-option w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white flex items-center gap-2"
>
<svg
class="w-4 h-4 text-orange-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"
/>
</svg>
Download HTML
</button>
<button
data-format="all"
class="format-option w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white rounded-b-lg flex items-center gap-2 border-t border-gray-700"
>
<svg
class="w-4 h-4 text-green-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
/>
</svg>
Download All
</button>
</div>
</div>
</div>
</div>
<div id="settingsPanel" class="settings-panel bg-gray-900 border-t border-gray-800">
<div class="px-4 py-3 flex flex-wrap items-center gap-6">
<span class="text-xs text-gray-500 uppercase tracking-wider font-medium"
>Document Options</span
>
<label class="flex items-center gap-2 cursor-pointer group">
<div id="toggleTitlePage" class="toggle-switch active"></div>
<span class="text-sm text-gray-400 group-hover:text-gray-300">Title Page</span>
</label>
<label class="flex items-center gap-2 cursor-pointer group">
<div id="toggleToc" class="toggle-switch active"></div>
<span class="text-sm text-gray-400 group-hover:text-gray-300">Table of Contents</span>
</label>
<label class="flex items-center gap-2 cursor-pointer group">
<div id="toggleHeader" class="toggle-switch active"></div>
<span class="text-sm text-gray-400 group-hover:text-gray-300">Header</span>
</label>
<label class="flex items-center gap-2 cursor-pointer group">
<div id="toggleFooter" class="toggle-switch active"></div>
<span class="text-sm text-gray-400 group-hover:text-gray-300">Footer</span>
</label>
<div class="flex items-center gap-2">
<span class="text-sm text-gray-500">Logo:</span>
<label
class="text-xs text-gray-400 hover:text-white px-2 py-1 rounded bg-gray-800 hover:bg-gray-700 transition-colors cursor-pointer flex items-center gap-1"
>
<input type="file" id="logoInput" accept="image/*" class="hidden" />
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
/>
</svg>
<span id="logoFileName">KYOTU (default)</span>
</label>
<button id="resetLogo" class="text-xs text-gray-500 hover:text-gray-300 hidden">
✕
</button>
</div>
</div>
</div>
</header>
<main class="flex-1 flex flex-col lg:flex-row min-h-0 relative">
<div
id="explorerPanel"
class="hidden lg:flex flex-col min-h-0 bg-white border-r border-gray-200 overflow-hidden absolute left-0 top-0 bottom-0 z-30 shadow-lg"
style="
width: 0;
min-width: 0;
pointer-events: none;
transition:
width 0.2s ease,
min-width 0.2s ease,
box-shadow 0.2s ease;
"
>
<div
class="px-3 py-2 bg-white border-b border-gray-200 flex items-center justify-between shrink-0"
>
<span class="text-xs font-medium text-gray-500 uppercase tracking-wider">Files</span>
<div class="flex items-center gap-1">
<button
id="addDocBtn"
class="text-gray-400 hover:text-kyotu-orange transition-colors p-0.5"
title="New document"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 4v16m8-8H4"
/>
</svg>
</button>
<button
id="explorerClose"
class="text-gray-400 hover:text-gray-600 transition-colors p-0.5"
title="Close (Ctrl+B)"
>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
</div>
<div id="fileList" class="flex-1 overflow-y-auto scrollbar-thin"></div>
</div>
<div id="editorPanel" class="flex flex-col min-h-0" style="flex: 1 1 50%">
<div
class="px-4 py-2.5 bg-white border-b border-gray-200 flex items-center justify-between shrink-0"
>
<div class="flex items-center gap-2">
<button
id="explorerToggle"
class="opacity-50 hover:opacity-80 text-gray-500 transition-all hidden lg:block"
title="Toggle file explorer (Ctrl+B)"
>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"
/>
</svg>
</button>
<div
class="w-2 h-2 rounded-full bg-gradient-to-r from-kyotu-orange-light to-kyotu-orange"
></div>
<span class="text-sm font-medium text-gray-700">Markdown Input</span>
<span id="currentDocName" class="text-xs text-gray-400 truncate max-w-[120px]"></span>
</div>
<span id="charCount" class="text-xs text-gray-400 font-mono">0 chars</span>
</div>
<div
id="dropzone"
class="dropzone flex-1 min-h-0 transition-all duration-200 border-2 border-transparent"
>
<textarea
id="markdown"
class="w-full h-full p-4 font-mono text-sm resize-none focus:outline-none bg-white text-gray-800 placeholder-gray-400"
placeholder="Paste your Markdown here or drag & drop a .md file..."
spellcheck="false"
></textarea>
</div>
</div>
<div id="resizer" class="resizer hidden lg:block"></div>
<div id="previewPanel" class="flex flex-col min-h-0 bg-white" style="flex: 1 1 50%">
<div
class="px-4 py-2.5 bg-white border-b border-gray-200 flex items-center justify-between shrink-0"
>
<div class="flex items-center gap-2">
<div class="w-2 h-2 rounded-full bg-green-500"></div>
<span class="text-sm font-medium text-gray-700">Live Preview</span>
</div>
<div class="flex items-center gap-3">
<button
id="scrollSyncToggle"
class="flex items-center gap-1 text-xs px-2 py-1 rounded transition-colors text-gray-400 hover:text-gray-600"
title="Sync scroll (Ctrl+Shift+S)"
>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6"
/>
</svg>
<span>Sync</span>
</button>
<span id="readabilityBadge" class="score-badge" style="display: none"></span>
<div id="metaInfo" class="text-xs text-gray-400 font-mono hidden">
<span id="metaElements">0</span> elements
</div>
</div>
</div>
<div
id="readabilityPanel"
class="readability-panel bg-gray-50 border-b border-gray-200 px-4"
>
<div id="readabilityMetrics" class="py-3"></div>
</div>
<div id="preview" class="flex-1 min-h-0 overflow-y-auto p-6 scrollbar-thin">
<div class="text-center py-12">
<div
class="w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-kyotu-orange-light/20 to-kyotu-orange/20 flex items-center justify-center"
>
<svg
class="w-8 h-8 text-kyotu-orange"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg>
</div>
<p class="text-gray-400">Document preview will appear here</p>
<p class="text-gray-300 text-sm mt-1">Start typing or load an example</p>
</div>
</div>
</div>
</main>
<footer class="bg-kyotu-dark px-4 py-2 flex items-center justify-between text-xs shrink-0">
<div class="flex items-center gap-3 text-gray-500">
<span>© 2026 KYOTU Technology</span>
<span class="text-gray-700">•</span>
<span id="appVersion">__APP_VERSION__</span>
</div>
<div class="flex items-center gap-3 text-gray-500">
<div class="flex items-center gap-1">
<kbd class="px-1.5 py-0.5 bg-gray-800 rounded text-gray-400 font-mono text-[10px]"
>Ctrl+B</kbd
>
<span class="hidden sm:inline text-[10px]">files</span>
</div>
<div class="flex items-center gap-1">
<kbd class="px-1.5 py-0.5 bg-gray-800 rounded text-gray-400 font-mono text-[10px]"
>Ctrl+K</kbd
>
<span class="hidden sm:inline text-[10px]">search</span>
</div>
<div class="flex items-center gap-1">
<kbd class="px-1.5 py-0.5 bg-gray-800 rounded text-gray-400 font-mono text-[10px]"
>Ctrl+Shift+S</kbd
>
<span class="hidden sm:inline text-[10px]">sync</span>
</div>
<div class="flex items-center gap-1">
<kbd class="px-1.5 py-0.5 bg-gray-800 rounded text-gray-400 font-mono text-[10px]"
>Ctrl+Shift+L</kbd
>
<span class="hidden sm:inline text-[10px]">share</span>
</div>
<div class="flex items-center gap-1">
<kbd class="px-1.5 py-0.5 bg-gray-800 rounded text-gray-400 font-mono text-[10px]"
>Ctrl+Enter</kbd
>
<span class="hidden sm:inline text-[10px]">generate</span>
</div>
</div>
</footer>
<div
id="status"
class="fixed bottom-0 left-0 right-0 bg-kyotu-dark text-white px-4 py-3 text-sm hidden z-50"
>
<div class="flex items-center gap-3">
<div
class="w-4 h-4 border-2 border-kyotu-orange border-t-transparent rounded-full animate-spin"
></div>
<span id="statusText">Processing...</span>
</div>
</div>
<button
id="jumpToBtn"
class="fixed z-50 right-6 bottom-20 bg-kyotu-orange text-white px-3 py-1.5 rounded-full shadow-lg text-sm font-medium opacity-0 pointer-events-none transition-all duration-200 flex items-center gap-1.5 hover:bg-kyotu-orange-light"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M14 5l7 7m0 0l-7 7m7-7H3"
/>
</svg>
<span>Jump to preview</span>
</button>
<script type="module" src="./src/main.js"></script>
</body>
</html>