-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1114 lines (963 loc) · 37.8 KB
/
Copy pathindex.html
File metadata and controls
1114 lines (963 loc) · 37.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Academic Cover Page Generator</title>
<!-- Google Fonts -->
<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=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap" rel="stylesheet">
<!-- JS PDF & html2canvas -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<style>
/* NATIVE CSS VARIABLES - Purple theme & Dark mode default */
:root {
--primary: #7c3aed; /* Brand Purple */
--primary-hover: #6d28d9;
--bg: #090d16;
--card-bg: #121a2e;
--text: #f8fafc;
--text-muted: #94a3b8;
--border: #1e293b;
--input-bg: #0b111e;
--shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
--font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
--font-serif: 'Times New Roman', Times, 'Lora', Georgia, serif;
}
/* Light Mode */
body.light-mode {
--bg: #f1f5f9;
--card-bg: #ffffff;
--text: #0f172a;
--text-muted: #64748b;
--border: #e2e8f0;
--input-bg: #f8fafc;
--shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
/* Reset Styles */
html, body {
width: 100%;
margin: 0;
padding: 0;
overflow-x: hidden; /* Prevent body scroll */
-webkit-text-size-adjust: 100%;
}
* {
box-sizing: border-box;
user-select: text !important; /* Fully enables copying text across the app */
}
body {
background-color: var(--bg);
color: var(--text);
font-family: var(--font-sans);
min-height: 100vh;
display: flex;
flex-direction: column;
position: relative;
padding: 16px;
}
/* Backdrop blur shapes */
.blob {
position: absolute;
border-radius: 50%;
filter: blur(80px);
z-index: -1;
opacity: 0.12;
}
.blob-purple {
top: -100px;
left: -100px;
width: 300px;
height: 300px;
background-color: var(--primary);
}
.blob-blue {
bottom: -100px;
right: -100px;
width: 300px;
height: 300px;
background-color: #3b82f6;
}
.app-container {
max-width: 1100px;
margin: 0 auto;
width: 100%;
z-index: 10;
}
/* Header */
header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px solid var(--border);
}
.logo-text h1 {
font-size: 18px;
font-weight: 700;
letter-spacing: -0.5px;
}
.logo-text p {
font-size: 11px;
color: var(--text-muted);
}
.theme-toggle-btn {
background-color: var(--card-bg);
border: 1px solid var(--border);
color: var(--text);
padding: 8px 12px;
border-radius: 10px;
font-size: 12px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
}
/* Main Responsive Layout */
.main-grid {
display: flex;
flex-direction: column;
gap: 20px;
width: 100%;
}
@media (min-width: 1024px) {
.main-grid {
flex-direction: row;
align-items: flex-start;
}
.form-card {
flex: 1.1;
}
.preview-section {
flex: 0.9;
position: sticky;
top: 20px;
}
}
.form-card {
background-color: var(--card-bg);
border: 1px solid var(--border);
border-radius: 16px;
padding: 20px;
box-shadow: var(--shadow);
width: 100%;
}
.section-title {
font-size: 15px;
font-weight: 700;
margin-bottom: 14px;
display: flex;
align-items: center;
gap: 8px;
}
.form-group {
margin-bottom: 12px;
}
.form-row {
display: grid;
grid-template-columns: 1fr;
gap: 12px;
}
@media (min-width: 640px) {
.form-row {
grid-template-columns: 1fr 1fr;
}
}
label {
display: block;
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
margin-bottom: 4px;
text-transform: uppercase;
}
input[type="text"], input[type="date"] {
width: 100%;
background-color: var(--input-bg);
border: 1px solid var(--border);
color: var(--text);
padding: 10px 12px;
border-radius: 8px;
font-family: var(--font-sans);
font-size: 13px;
outline: none;
}
input[type="text"]:focus, input[type="date"]:focus {
border-color: var(--primary);
}
/* Dimensions buttons */
.layout-picker {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.layout-btn {
background-color: var(--input-bg);
border: 1px solid var(--border);
color: var(--text);
padding: 10px;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
font-size: 13px;
}
.layout-btn.active {
border-color: var(--primary);
background-color: rgba(124, 58, 237, 0.08);
color: var(--primary);
}
/* Authors area */
.author-block {
background-color: var(--input-bg);
border: 1px solid var(--border);
border-radius: 10px;
padding: 12px;
margin-bottom: 8px;
}
.author-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.add-author-btn {
color: var(--primary);
background: none;
border: none;
font-size: 11px;
font-weight: 700;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 3px;
}
.remove-author-btn {
color: #ef4444;
background: none;
border: none;
font-size: 11px;
cursor: pointer;
}
hr {
border: 0;
height: 1px;
background-color: var(--border);
margin: 16px 0;
}
/* Action buttons grid layout */
.button-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-top: 16px;
}
.btn {
padding: 12px;
border-radius: 8px;
font-weight: 700;
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
border: none;
}
.btn-primary {
background-color: var(--primary);
color: #ffffff;
}
.btn-primary:hover {
background-color: var(--primary-hover);
}
.btn-secondary {
background-color: var(--border);
color: var(--text);
}
/* PREVIEW CONTAINER: Fluid, clean aspect ratio rendering */
.preview-section {
width: 100%;
}
.preview-viewport-container {
width: 100%;
max-width: 440px; /* Limits size on widescreen PCs for clean previewing */
margin: 0 auto;
container-type: inline-size; /* Triggers browser container query fonts */
}
/* Fluid Preview Card matching document layouts */
.preview-sheet {
width: 100%;
background-color: #ffffff !important;
color: #000000 !important;
box-shadow: 0 10px 25px rgba(0,0,0,0.15);
font-family: var(--font-serif);
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
text-align: center;
box-sizing: border-box;
padding: 8.5cqw 0 6.5cqw 0; /* Padding left/right managed globally by inner blocks to prevent baseline drift */
}
/* Dynamic Aspect Ratios */
.preview-sheet.size-a4 {
aspect-ratio: 1 / 1.4142; /* A4 Ratio */
}
.preview-sheet.size-letter {
aspect-ratio: 1 / 1.2941; /* Letter Ratio */
}
/* Font Sizes relative to current width of the card (cqw) */
.preview-sheet .doc-center-block {
padding-left: 12cqw;
padding-right: 12cqw;
width: 100%;
}
.preview-sheet .doc-inst-name {
font-size: 5.0cqw; /* Increased text scale size */
font-weight: 700;
text-transform: uppercase;
margin-bottom: 0.6cqw;
letter-spacing: 0.05cqw;
line-height: 1.2;
}
.preview-sheet .doc-dept-name {
font-size: 2.3cqw; /* Increased text scale size */
margin-bottom: 3.5cqw;
}
.preview-sheet .doc-type {
font-size: 2.3cqw; /* Increased text scale size */
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.2cqw;
margin-bottom: 2cqw;
}
.preview-sheet .doc-logo-wrapper {
margin: 1cqw 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 14cqw;
width: 100%;
}
.preview-sheet .doc-logo {
max-height: 24cqw; /* Increased logo size */
max-width: 34cqw; /* Increased logo size */
object-fit: contain;
}
/* Unified Aligned Lower Container: Combines Course block, columns, and date on the same vertical baseline */
.preview-sheet .doc-lower-container {
width: 100%;
padding-left: 12cqw; /* Symmetrical padding left & right */
padding-right: 12cqw;
text-align: left;
margin-top: 1cqw; /* Brought tight against the logo above */
margin-bottom: 2cqw;
display: flex;
flex-direction: column;
gap: 4cqw; /* Symmetrical, controlled gaps between sections */
flex-grow: 1; /* Automatically manages pushing date to bottom dynamically */
}
/* Left-Aligned Course Block (Aligns with left edge/margin) */
.preview-sheet .doc-course-info-block {
font-size: 2.1cqw; /* Increased course block text size */
font-weight: 700;
line-height: 1.7;
text-align: left;
width: 100%;
}
.preview-sheet .doc-sub-details {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4cqw;
font-size: 1.95cqw; /* Increased columns text size */
width: 100%;
}
.preview-sheet .doc-col-title {
font-weight: 700;
margin-bottom: 1.5cqw;
}
.preview-sheet .sub-item {
line-height: 1.5;
}
/* Supervisor & Student Name text weight is now normal (NOT BOLD) */
.preview-sheet .sub-item-name {
font-weight: normal;
}
.preview-sheet .sub-item p {
font-weight: normal;
}
.preview-sheet .doc-sub-date {
font-size: 1.95cqw; /* Increased submission date text size */
font-weight: 700;
text-align: left;
margin-top: auto; /* Pushes submission date to absolute bottom of page container */
padding-top: 4cqw;
}
/* Temp compilation container space toggles temporarily on-screen when exporting to force rasterization on mobile Chrome */
#hidden-print-container {
position: fixed;
width: 794px;
height: 1123px;
overflow: hidden;
opacity: 1; /* Keeps visible to rendering hardware */
pointer-events: none;
z-index: -99999 !important;
top: 0;
left: 100vw; /* Positioned safely off the visible screen width completely */
container-type: inline-size;
background-color: transparent !important;
}
/* FULLSCREEN CSS MODIFICATIONS */
body.fullscreen-active {
background-color: #000000 !important;
padding: 0 !important;
margin: 0 !important;
overflow: hidden !important;
}
body.fullscreen-active .form-card,
body.fullscreen-active header,
body.fullscreen-active footer,
body.fullscreen-active .blob {
display: none !important;
}
body.fullscreen-active .app-container {
max-width: 100% !important;
width: 100vw !important;
height: 100vh !important;
}
body.fullscreen-active .main-grid {
display: block !important;
width: 100% !important;
height: 100% !important;
}
body.fullscreen-active .preview-section {
width: 100vw !important;
height: 100vh !important;
display: flex !important;
justify-content: center !important;
align-items: center !important;
background-color: #000000 !important;
}
body.fullscreen-active .preview-viewport-container {
max-width: 92vh !important; /* Forces the sheet to scale to fit phone screen height */
width: 100% !important;
}
/* Floating exit helper button */
#exit-fullscreen-btn {
display: none;
position: fixed;
bottom: 24px;
right: 24px;
z-index: 9999999;
background-color: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.3);
color: #ffffff;
padding: 10px 18px;
border-radius: 30px;
font-family: var(--font-sans);
font-size: 12px;
font-weight: bold;
cursor: pointer;
backdrop-filter: blur(8px);
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
body.fullscreen-active #exit-fullscreen-btn {
display: block;
}
/* Footer Image 3 layout */
footer {
margin-top: 40px;
padding-top: 24px;
border-top: 1px solid var(--border);
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding-bottom: 30px;
}
.social-row {
display: flex;
gap: 16px;
}
.social-circle {
width: 44px;
height: 44px;
border-radius: 50%;
border: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
cursor: pointer;
text-decoration: none;
}
.social-circle:hover {
color: var(--primary);
border-color: var(--primary);
transform: translateY(-2px);
}
.social-circle.github:hover {
border-color: #7c3aed;
color: #7c3aed;
}
.copyright {
font-size: 13px;
color: var(--text-muted);
}
</style>
</head>
<body class="dark-mode">
<div class="blob blob-purple"></div>
<div class="blob blob-blue"></div>
<!-- Safe compilation workspace container -->
<div id="hidden-print-container"></div>
<!-- Floating exit trigger button appears only in fullscreen mode -->
<button id="exit-fullscreen-btn">Exit Full Screen</button>
<div class="app-container">
<!-- Top Header Bar -->
<header>
<div class="logo-area">
<div class="logo-text">
<h1>CoverCraft</h1>
<p>Academic Page Builder</p>
</div>
</div>
<!-- Theme Switcher -->
<button class="theme-toggle-btn" id="theme-toggle">
<svg id="sun-icon" style="display:none; width:15px; height:15px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364-6.364l-.707.707M6.343 17.657l-.707.707m12.728 0l-.707-.707M6.343 6.343l-.707-.707M12 8a4 4 0 100 8 4 4 0 000-8z"></path></svg>
<svg id="moon-icon" style="width:15px; height:15px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path></svg>
<span id="theme-text">Light Mode</span>
</button>
</header>
<!-- Main Grid Content -->
<div class="main-grid">
<!-- Left Input Panel -->
<div class="form-card">
<div class="section-title">
<svg style="width:16px; height:16px; color:var(--primary);" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" 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"></path></svg>
Document Information
</div>
<!-- Layout Selector (A4 selected default) -->
<div class="form-group">
<label>Page Layout Dimension</label>
<div class="layout-picker">
<button class="layout-btn active" id="layout-a4">A4 Size</button>
<button class="layout-btn" id="layout-letter">Letter Size</button>
</div>
</div>
<hr>
<!-- Institution Details -->
<div class="section-title" style="font-size: 14px;">Institution Details</div>
<div class="form-group">
<label for="input-institution">University Name</label>
<input type="text" id="input-institution" value="CITY UNIVERSITY">
</div>
<div class="form-row">
<div class="form-group">
<label for="input-department">Department</label>
<input type="text" id="input-department" value="Computer science and engineering">
</div>
<div class="form-group">
<label for="input-type">Work Type</label>
<input type="text" id="input-type" value="PROJECT">
</div>
</div>
<div class="form-group">
<label for="input-logo">Logo Image Link</label>
<input type="text" id="input-logo" value="https://i.ibb.co.com/99H8b71b/20260709-125535.png">
</div>
<hr>
<!-- Course Details -->
<div class="section-title" style="font-size: 14px;">Course & Curriculum</div>
<div class="form-group">
<label for="input-course-title">Course Title</label>
<input type="text" id="input-course-title" value="Software engineering laboratory">
</div>
<div class="form-row">
<div class="form-group">
<label for="input-course-code">Course Code</label>
<input type="text" id="input-course-code" value="CSE- 416">
</div>
<div class="form-group">
<label for="input-batch">Batch</label>
<input type="text" id="input-batch" value="33">
</div>
</div>
<hr>
<!-- Recipient Assignment -->
<div class="section-title" style="font-size: 14px;">Submitted To</div>
<div class="form-row">
<div class="form-group">
<label for="input-subto-name">Supervisor Name</label>
<input type="text" id="input-subto-name" value="Shisir kumar">
</div>
<div class="form-group">
<label for="input-subto-desig">Designation</label>
<input type="text" id="input-subto-desig" value="Lecturer">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="input-subto-dept">Department</label>
<input type="text" id="input-subto-dept" value="Department of CSE">
</div>
<div class="form-group">
<label for="input-subto-inst">University / College</label>
<input type="text" id="input-subto-inst" value="City University">
</div>
</div>
<hr>
<!-- Dynamic Submitted By Section -->
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
<div class="section-title" style="font-size: 14px; margin: 0;">Submitted By</div>
<button class="add-author-btn" id="add-author">
<svg style="width:12px; height:12px;" fill="none" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4"></path></svg>
Add Student
</button>
</div>
<div id="authors-container"></div>
<hr>
<!-- Date Submission -->
<div class="form-group">
<label for="input-date">Submission Date</label>
<input type="date" id="input-date">
</div>
<!-- Action Row -->
<div class="button-container">
<button class="btn btn-primary" id="download-pdf-btn">
<svg style="width:16px; height:16px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" 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"></path></svg>
Download PDF
</button>
<button class="btn btn-secondary" id="download-jpg-btn">
<svg style="width:16px; height:16px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" 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"></path></svg>
Download JPG
</button>
<button class="btn btn-secondary" id="fullscreen-btn" style="grid-column: span 2; margin-top: 4px;">
<svg style="width:18px; height:18px; margin-right: 4px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"></path></svg>
View Full Screen Preview
</button>
</div>
</div>
<!-- Right Interactive Document Preview Panel (100% responsive fluid view) -->
<div class="preview-section">
<div class="preview-viewport-container" id="preview-boundary">
<!-- Liquid, self-proportioning sheet preview -->
<div class="preview-sheet size-a4" id="document-rendered">
<div class="doc-center-block">
<div class="doc-inst-name" id="preview-institution">CITY UNIVERSITY</div>
<div class="doc-dept-name" id="preview-department">Computer science and engineering</div>
<div class="doc-type" id="preview-type">PROJECT</div>
</div>
<div class="doc-logo-wrapper">
<img src="https://i.ibb.co.com/99H8b71b/20260709-125535.png" alt="University Logo" class="doc-logo" id="preview-logo" crossorigin="anonymous">
</div>
<br> <br>
<!-- Unified lower page wrapper: aligns all items to the exact same left margin -->
<div class="doc-lower-container">
<!-- Left-Aligned Course Block (Aligned with columns below) -->
<div class="doc-course-info-block">
<p>Course title: <span id="preview-course-title">Software engineering laboratory</span></p>
<p>Course code: <span id="preview-course-code">CSE- 416</span></p>
<p>Batch : <span id="preview-batch">33</span></p>
</div>
<div class="doc-sub-details">
<!-- Column Left (Submitted To) -->
<div class="sub-item">
<p class="doc-col-title"><h3>Submitted To:</h3></p>
<p class="sub-item-name" id="preview-subto-name">Shisir kumar</p>
<p id="preview-subto-desig">Lecturer</p>
<p id="preview-subto-dept">Department of CSE</p>
<p id="preview-subto-inst">City University</p>
</div>
<!-- Column Right (Submitted By) -->
<div class="sub-item" id="preview-subby-container">
<p class="doc-col-title"><h3>Submitted By:</h3></h3></p>
<!-- Dynamic student listings -->
</div>
</div>
<!-- Bottom Left-aligned Date -->
<div class="doc-sub-date">
Date of Submission : <span id="preview-date">23-09-2017</span>
</div>
</div>
</div> <!-- /Document rendered -->
</div>
</div>
</div> <!-- /Grid -->
<!-- Footer mirroring styling and layout of Image 3 -->
<footer>
<div class="social-row">
<a href="https://github.com/marufkhanop/" target="_blank" class="social-circle github" title="Github Link">
<svg style="width:18px; height:18px;" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482C19.138 20.193 22 16.44 22 12.017 22 6.484 17.522 2 12 2z"/></svg>
</a>
<a href="https://www.linkedin.com/in/marufkhanop" target="_blank" class="social-circle" title="LinkedIn Profile">
<svg style="width:16px; height:16px;" fill="currentColor" viewBox="0 0 24 24"><path d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.779-1.75-1.75s.784-1.75 1.75-1.75 1.75.779 1.75 1.75-.784 1.75-1.75 1.75zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/></svg>
</a>
<a href="#" class="social-circle" title="Contact Direct">
<svg style="width:16px; height:16px;" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
</a>
</div>
<div class="copyright">
© 2026 Maruf Khan. All rights reserved.
</div>
</footer>
</div>
<script>
// VANILLA JS STATE SYSTEM
const state = {
darkMode: true,
pageSize: 'a4', // 'a4' default
institution: 'CITY UNIVERSITY',
department: 'Computer science and engineering',
type: 'PROJECT',
logoUrl: 'https://i.ibb.co.com/99H8b71b/20260709-125535.png',
courseTitle: 'Software engineering laboratory',
courseCode: 'CSE- 416',
batch: '33',
subToName: 'Shisir kumar',
subToDesig: 'Lecturer',
subToDept: 'Department of CSE',
subToInst: 'City University',
students: [
{ name: 'Maruf Khan ', id: '13233218' },
{ name: 'David Malan', id: '12129399' }
],
submissionDate: '2026-07-12'
};
function formatDate(dateString) {
if (!dateString) return '';
const parts = dateString.split('-');
if (parts.length === 3) {
return `${parts[2]}-${parts[1]}-${parts[0]}`;
}
return dateString;
}
// Dynamic Student List rendering (Decoupled layout listeners from DOM compilation for smooth, lag-free keystroke updates)
function renderAuthorsSection() {
const formContainer = document.getElementById('authors-container');
const previewContainer = document.getElementById('preview-subby-container');
formContainer.innerHTML = '';
previewContainer.innerHTML = '<p class="doc-col-title"><h3>Submitted By:</h3></p>';
state.students.forEach((student, index) => {
// Build Input Row markup once
const authorDiv = document.createElement('div');
authorDiv.className = 'author-block';
authorDiv.innerHTML = `
<div class="author-header">
<span class="author-title">Author #${index + 1}</span>
${state.students.length > 1 ? `<button class="remove-author-btn" onclick="removeStudent(${index})">Remove</button>` : ''}
</div>
<div class="form-row">
<div class="form-group" style="margin:0;">
<input type="text" class="student-name-input" data-index="${index}" placeholder="Full Name" value="${student.name || ''}">
</div>
<div class="form-group" style="margin:0;">
<input type="text" class="student-id-input" data-index="${index}" placeholder="ID Number" value="${student.id || ''}">
</div>
</div>
`;
formContainer.appendChild(authorDiv);
// Render matching Preview target element
const studentPreviewDiv = document.createElement('div');
studentPreviewDiv.style.marginBottom = '8px';
studentPreviewDiv.innerHTML = `
<div id="preview-student-name-${index}" class="sub-item-name" style="font-weight: normal !important;">${student.name || ''}</div>
<div id="preview-student-id-${index}" style="font-weight: normal !important;">${student.id ? 'ID:' + student.id : ''}</div>
`;
previewContainer.appendChild(studentPreviewDiv);
});
// Bind instant key listeners (Enables 100% instant, keystroke-by-keystroke text updates)
formContainer.querySelectorAll('.student-name-input').forEach(input => {
input.addEventListener('input', function() {
const idx = parseInt(this.getAttribute('data-index'));
state.students[idx].name = this.value;
document.getElementById(`preview-student-name-${idx}`).innerText = this.value;
});
});
formContainer.querySelectorAll('.student-id-input').forEach(input => {
input.addEventListener('input', function() {
const idx = parseInt(this.getAttribute('data-index'));
state.students[idx].id = this.value;
document.getElementById(`preview-student-id-${idx}`).innerText = this.value ? `ID:${this.value}` : '';
});
});
}
window.updateStudent = function(index, field, value) {
state.students[index][field] = value;
}
document.getElementById('add-author').addEventListener('click', () => {
state.students.push({ name: '', id: '' });
renderAuthorsSection();
});
window.removeStudent = function(index) {
if (state.students.length > 1) {
state.students.splice(index, 1);
renderAuthorsSection();
}
}
// Direct Live Sync binds
function syncAllFields() {
document.getElementById('input-institution').value = state.institution;
document.getElementById('input-department').value = state.department;
document.getElementById('input-type').value = state.type;
document.getElementById('input-logo').value = state.logoUrl;
document.getElementById('input-course-title').value = state.courseTitle;
document.getElementById('input-course-code').value = state.courseCode;
document.getElementById('input-batch').value = state.batch;
document.getElementById('input-subto-name').value = state.subToName;
document.getElementById('input-subto-desig').value = state.subToDesig;
document.getElementById('input-subto-dept').value = state.subToDept;
document.getElementById('input-subto-inst').value = state.subToInst;
document.getElementById('input-date').value = state.submissionDate;
document.getElementById('preview-institution').innerText = state.institution;
document.getElementById('preview-department').innerText = state.department;
document.getElementById('preview-type').innerText = state.type;
document.getElementById('preview-logo').src = state.logoUrl;
document.getElementById('preview-course-title').innerText = state.courseTitle;
document.getElementById('preview-course-code').innerText = state.courseCode;
document.getElementById('preview-batch').innerText = state.batch;
document.getElementById('preview-subto-name').innerText = state.subToName;
document.getElementById('preview-subto-desig').innerText = state.subToDesig;
document.getElementById('preview-subto-dept').innerText = state.subToDept;
document.getElementById('preview-subto-inst').innerText = state.subToInst;
document.getElementById('preview-date').innerText = formatDate(state.submissionDate);
}
function setupLiveListeners() {
const fields = [
{ id: 'input-institution', prop: 'institution', previewId: 'preview-institution' },
{ id: 'input-department', prop: 'department', previewId: 'preview-department' },
{ id: 'input-type', prop: 'type', previewId: 'preview-type' },
{ id: 'input-logo', prop: 'logoUrl', previewId: 'preview-logo', isImg: true },
{ id: 'input-course-title', prop: 'courseTitle', previewId: 'preview-course-title' },
{ id: 'input-course-code', prop: 'courseCode', previewId: 'preview-course-code' },
{ id: 'input-batch', prop: 'batch', previewId: 'preview-batch' },
{ id: 'input-subto-name', prop: 'subToName', previewId: 'preview-subto-name' },
{ id: 'input-subto-desig', prop: 'subToDesig', previewId: 'preview-subto-desig' },
{ id: 'input-subto-dept', prop: 'subToDept', previewId: 'preview-subto-dept' },
{ id: 'input-subto-inst', prop: 'subToInst', previewId: 'preview-subto-inst' }
];
fields.forEach(f => {
document.getElementById(f.id).addEventListener('input', function(e) {
state[f.prop] = e.target.value;
if (f.isImg) {
document.getElementById(f.previewId).src = e.target.value;
} else {
document.getElementById(f.previewId).innerText = e.target.value;
}
});
});
document.getElementById('input-date').addEventListener('input', function(e) {
state.submissionDate = e.target.value;
document.getElementById('preview-date').innerText = formatDate(e.target.value);
});
}
// Page Layout Switches
document.getElementById('layout-a4').addEventListener('click', function() {
state.pageSize = 'a4';
this.classList.add('active');
document.getElementById('layout-letter').classList.remove('active');
const doc = document.getElementById('document-rendered');
doc.className = 'preview-sheet size-a4';
});
document.getElementById('layout-letter').addEventListener('click', function() {
state.pageSize = 'letter';
this.classList.add('active');