File size: 16,913 Bytes
8fae33b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Harvard CV Generator AI</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script>
    <style>
        .dropzone {
            border: 2px dashed #3b82f6;
            transition: all 0.3s ease;
        }
        .dropzone.active {
            border-color: #10b981;
            background-color: #f0fdf4;
        }
        .dropzone.reject {
            border-color: #ef4444;
            background-color: #fef2f2;
        }
        .cv-preview {
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            min-height: 800px;
        }
        .harvard-style {
            font-family: 'Times New Roman', Times, serif;
            line-height: 1.5;
        }
        .section-divider {
            border-bottom: 1px solid #000;
            margin: 1rem 0;
        }
        .progress-bar {
            transition: width 0.5s ease;
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @media print {
            .no-print {
                display: none !important;
            }
            .cv-preview {
                box-shadow: none;
                border: none;
            }
        }
        .highlight-added {
            background-color: #d1fae5;
            padding: 0.1rem 0.2rem;
            border-radius: 0.2rem;
        }
        .highlight-removed {
            background-color: #fee2e2;
            padding: 0.1rem 0.2rem;
            border-radius: 0.2rem;
            text-decoration: line-through;
        }
        .highlight-changed {
            background-color: #bfdbfe;
            padding: 0.1rem 0.2rem;
            border-radius: 0.2rem;
        }
        .diff-view {
            font-family: monospace;
            white-space: pre-wrap;
            background-color: #f8fafc;
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #e2e8f0;
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <div class="container mx-auto px-4 py-8">
        <!-- Header -->
        <header class="bg-white rounded-xl shadow-md p-6 mb-8">
            <div class="flex flex-col md:flex-row items-center justify-between">
                <div class="mb-4 md:mb-0">
                    <h1 class="text-3xl font-bold text-blue-800">
                        <i class="fas fa-graduation-cap mr-2"></i> Harvard CV Generator AI
                    </h1>
                    <p class="text-gray-600 mt-2">Transform your resume into a professional Harvard-style CV tailored for your dream job</p>
                </div>
                <div class="flex items-center space-x-2">
                    <div class="bg-blue-100 p-3 rounded-full">
                        <i class="fas fa-robot text-blue-600 text-2xl"></i>
                    </div>
                    <div class="bg-green-100 p-3 rounded-full">
                        <i class="fas fa-file-pdf text-green-600 text-2xl"></i>
                    </div>
                </div>
            </div>
        </header>

        <!-- Main Content -->
        <main>
            <!-- Upload Section -->
            <section id="upload-section" class="bg-white rounded-xl shadow-md p-6 mb-8">
                <h2 class="text-xl font-semibold text-gray-800 mb-4">1. Upload Your Resume</h2>
                
                <div id="dropzone" class="dropzone rounded-lg p-8 text-center cursor-pointer mb-6">
                    <div class="flex flex-col items-center justify-center">
                        <i class="fas fa-cloud-upload-alt text-4xl text-blue-500 mb-3"></i>
                        <p class="text-lg font-medium text-gray-700">Drag & drop your PDF resume here</p>
                        <p class="text-gray-500 mt-1">or click to browse files</p>
                        <input type="file" id="file-upload" class="hidden" accept=".pdf,.doc,.docx,.txt">
                    </div>
                </div>
                
                <div class="grid md:grid-cols-2 gap-6">
                    <div>
                        <label for="job-title" class="block text-sm font-medium text-gray-700 mb-1">
                            Target Job Title
                        </label>
                        <input type="text" id="job-title" placeholder="e.g. Senior Data Scientist"
                                class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
                    </div>
                    
                    <div>
                        <label for="company-name" class="block text-sm font-medium text-gray-700 mb-1">
                            Target Company (optional)
                        </label>
                        <input type="text" id="company-name" placeholder="e.g. Google"
                                class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
                    </div>
                </div>
                
                <div class="mt-6">
                    <label for="job-description" class="block text-sm font-medium text-gray-700 mb-1">
                        Job Description (paste or upload)
                    </label>
                    <textarea id="job-description" rows="4"
                               class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"
                               placeholder="Paste the job description here..."></textarea>
                    <div class="mt-2 flex justify-between items-center">
                        <button id="upload-jd-btn" class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
                            <i class="fas fa-file-upload mr-2"></i> Upload JD File
                        </button>
                        <span class="text-sm text-gray-500">Supports .pdf, .docx, .txt</span>
                    </div>
                </div>
                
                <div class="mt-6">
                    <button id="analyze-btn" disabled class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
                        <i class="fas fa-magic mr-2"></i> Analyze & Adapt CV
                    </button>
                </div>
            </section>

            <!-- Processing Section -->
            <section id="processing-section" class="hidden bg-white rounded-xl shadow-md p-6 mb-8">
                <h2 class="text-xl font-semibold text-gray-800 mb-4">Processing Your CV</h2>
                
                <div class="mb-4">
                    <div class="flex justify-between text-sm text-gray-600 mb-1">
                        <span id="progress-text">0% completed</span>
                        <span id="step-text">Extracting text...</span>
                    </div>
                    <div class="w-full bg-gray-200 rounded-full h-2.5">
                        <div id="progress-bar" class="progress-bar bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
                    </div>
                </div>
                
                <div id="status-message" class="flex items-center p-4 mb-4 text-sm text-blue-700 bg-blue-100 rounded-lg">
                    <i class="fas fa-info-circle mr-2"></i>
                    <span id="status-text">Starting CV analysis...</span>
                </div>
                
                <div class="grid md:grid-cols-3 gap-4 mt-6">
                    <div class="bg-blue-50 p-4 rounded-lg border border-blue-200">
                        <div class="flex items-center">
                            <div class="bg-blue-100 p-3 rounded-full mr-3">
                                <i class="fas fa-file-alt text-blue-600"></i>
                            </div>
                            <div>
                                <p class="text-sm text-gray-500">Document Type</p>
                                <p id="doc-type" class="text-lg font-bold text-gray-800">PDF</p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-green-50 p-4 rounded-lg border border-green-200">
                        <div class="flex items-center">
                            <div class="bg-green-100 p-3 rounded-full mr-3">
                                <i class="fas fa-font text-green-600"></i>
                            </div>
                            <div>
                                <p class="text-sm text-gray-500">Text Extracted</p>
                                <p id="text-length" class="text-lg font-bold text-gray-800">0 words</p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-purple-50 p-4 rounded-lg border border-purple-200">
                        <div class="flex items-center">
                            <div class="bg-purple-100 p-3 rounded-full mr-3">
                                <i class="fas fa-brain text-purple-600"></i>
                            </div>
                            <div>
                                <p class="text-sm text-gray-500">AI Analysis</p>
                                <p id="ai-status" class="text-lg font-bold text-gray-800">Pending</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <button id="cancel-btn" class="mt-6 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
                    <i class="fas fa-stop-circle mr-2"></i> Cancel Processing
                </button>
            </section>

            <!-- Results Section -->
            <section id="results-section" class="hidden bg-white rounded-xl shadow-md p-6 mb-8">
                <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
                    <div>
                        <h2 class="text-xl font-semibold text-gray-800">Your Harvard-Style CV</h2>
                        <p class="text-gray-600">Tailored for <span id="target-job-display" class="font-medium">Senior Data Scientist</span> position</p>
                    </div>
                    <div class="mt-4 md:mt-0 flex space-x-2">
                        <button id="edit-btn" class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
                            <i class="fas fa-edit mr-2"></i> Edit
                        </button>
                        <button id="export-btn" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700">
                            <i class="fas fa-download mr-2"></i> Export
                        </button>
                    </div>
                </div>
                
                <div class="flex space-x-4 mb-4">
                    <button id="original-tab" class="px-4 py-2 text-sm font-medium text-blue-600 border-b-2 border-blue-600">
                        Original CV
                    </button>
                    <button id="harvard-tab" class="px-4 py-2 text-sm font-medium text-gray-500 hover:text-gray-700 border-b-2 border-transparent">
                        Harvard CV
                    </button>
                    <button id="comparison-tab" class="px-4 py-2 text-sm font-medium text-gray-500 hover:text-gray-700 border-b-2 border-transparent">
                        Comparison
                    </button>
                    <button id="diff-tab" class="px-4 py-2 text-sm font-medium text-gray-500 hover:text-gray-700 border-b-2 border-transparent">
                        Changes
                    </button>
                </div>
                
                <div id="original-cv" class="cv-preview bg-white p-6 rounded-lg border border-gray-200">
                    <div class="flex justify-center items-center h-full">
                        <div class="text-center">
                            <i class="fas fa-file-pdf text-4xl text-gray-400 mb-3"></i>
                            <p class="text-gray-500">Original CV will appear here</p>
                        </div>
                    </div>
                </div>
                
                <div id="harvard-cv" class="cv-preview bg-white p-6 rounded-lg border border-gray-200 harvard-style hidden">
                    <div class="flex justify-center items-center h-full">
                        <div class="text-center">
                            <i class="fas fa-university text-4xl text-gray-400 mb-3"></i>
                            <p class="text-gray-500">Harvard-style CV will appear here</p>
                        </div>
                    </div>
                </div>
                
                <div id="comparison-view" class="hidden">
                    <div class="grid md:grid-cols-2 gap-6">
                        <div class="cv-preview bg-white p-6 rounded-lg border border-gray-200">
                            <h3 class="text-lg font-semibold mb-4 text-center">Original CV</h3>
                            <!-- Original CV content will go here -->
                        </div>
                        <div class="cv-preview bg-white p-6 rounded-lg border border-gray-200 harvard-style">
                            <h3 class="text-lg font-semibold mb-4 text-center">Harvard CV</h3>
                            <!-- Harvard CV content will go here -->
                        </div>
                    </div>
                </div>

                <div id="diff-view" class="cv-preview bg-white p-6 rounded-lg border border-gray-200 hidden">
                    <div class="flex justify-center items-center h-full">
                        <div class="text-center">
                            <i class="fas fa-code-compare text-4xl text-gray-400 mb-3"></i>
                            <p class="text-gray-500">Changes between versions will appear here</p>
                        </div>
                    </div>
                </div>
                
                <div class="mt-6">
                    <h3 class="text-lg font-medium text-gray-800 mb-3">AI Adaptation Insights</h3>
                    <div id="ai-insights" class="space-y-3">
                        <!-- AI insights will be added here dynamically -->
                    </div>
                </div>
            </section>

            <!-- Export Modal -->
            <div id="export-modal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
                <div class="bg-white rounded-lg shadow-xl max-w-md w-full p-6">
                    <div class="flex justify-between items-center mb-4">
                        <h3 class="text-lg font-medium text-gray-900">Export Options</h3>
                        <button id="close-export-modal" class="text-gray-400 hover:text-gray-500">
                            <i class="fas fa-times"></i>
                        </button>
                    </div>
                    
                    <div class="space-y-4">
                        <button id="export-pdf" class="w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-md hover:bg-gray-50">
                            <div class="flex items-center">
                                <i class="fas fa-file-pdf text-red-500 text-xl mr-3"></i>
                                <span>PDF Document</span>
                            </div>
                            <i class="fas fa-chevron-right text-gray-400"></i>
                        </button>
                        
                        <button id="export-docx" class="w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-md hover:bg-gray-50">
                            <div class="flex items-center">
                                <i class="fas fa-file-word text-blue-500 text-xl mr-3
</html>