File size: 19,445 Bytes
4b499b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI CV Summarizer | Smart Document Analysis</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">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Inter', sans-serif;
            background-color: #f8fafc;
        }
        .file-upload:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.2);
        }
        .summary-area {
            min-height: 200px;
            transition: all 0.3s ease;
        }
        .radio-custom {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border: 2px solid #e2e8f0;
            border-radius: 50%;
            outline: none;
            cursor: pointer;
            transition: all 0.2s;
        }
        .radio-custom:checked {
            border-color: #4f46e5;
            background-color: #4f46e5;
            background-image: radial-gradient(circle, white 35%, transparent 40%);
        }
        .drag-active {
            border-color: #4f46e5;
            background-color: #eef2ff;
        }
    </style>
</head>
<body>
    <div class="min-h-screen flex flex-col">
        <!-- Header -->
        <header class="bg-gradient-to-r from-indigo-600 to-purple-600 text-white py-8 px-4 shadow-lg">
            <div class="container mx-auto max-w-6xl">
                <div class="flex flex-col md:flex-row items-center justify-between gap-6">
                    <div>
                        <h1 class="text-3xl md:text-4xl font-bold mb-2 flex items-center gap-3">
                            <i class="fas fa-brain"></i> AI CV Summarizer
                        </h1>
                        <p class="text-indigo-100 opacity-90">Extract key insights from documents in seconds</p>
                    </div>
                    <div class="flex items-center gap-4">
                        <span class="px-3 py-1 bg-white/20 rounded-full text-sm flex items-center gap-2">
                            <i class="fas fa-bolt text-yellow-300"></i> Powered by Gemini 2.5
                        </span>
                    </div>
                </div>
            </div>
        </header>

        <!-- Main Content -->
        <main class="flex-1 py-8 px-4">
            <div class="container mx-auto max-w-6xl">
                <div class="flex flex-col gap-8">
                    <!-- Upload Section -->
                    <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-100">
                        <h2 class="text-xl font-semibold mb-4 text-gray-800 flex items-center gap-2">
                            <i class="fas fa-cloud-upload-alt text-indigo-500"></i> Upload Your Document
                        </h2>
                        
                        <div class="flex mb-4 gap-2">
                            <button id="tabPdf" class="flex-1 py-2 px-4 rounded-lg border border-indigo-500 text-indigo-500 font-medium bg-indigo-50">PDF Upload</button>
                            <button id="tabText" class="flex-1 py-2 px-4 rounded-lg border border-gray-300 text-gray-500 font-medium">Text Input</button>
                        </div>

                        <div id="pdfSection">
                            <div id="dropZone" class="file-upload border-2 border-dashed border-gray-300 rounded-lg p-8 text-center cursor-pointer transition-all duration-300 mb-6">
                                <div class="flex flex-col items-center justify-center">
                                    <i class="fas fa-file-pdf text-5xl text-indigo-400 mb-4"></i>
                                    <input type="file" id="fileInput" class="hidden" accept=".pdf" />
                                    <button id="uploadBtn" class="bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-2 rounded-lg font-medium mb-2 transition-colors duration-300">
                                        Select PDF File
                                    </button>
                                    <p class="text-gray-500 text-sm">or drag and drop here</p>
                                    <p class="text-gray-400 text-xs mt-2">PDF up to 10MB</p>
                                </div>
                            </div>
                        </div>

                        <div id="textSection" class="hidden">
                            <textarea id="cvTextInput" class="w-full h-40 p-4 border border-gray-300 rounded-lg mb-4 focus:border-indigo-500 focus:ring-indigo-500" placeholder="Paste your CV content here..."></textarea>
                        </div>

                        <div class="mb-4">
                            <label class="block text-sm font-medium text-gray-700 mb-2">Job Description (JD)</label>
                            <textarea id="jdTextInput" class="w-full h-40 p-4 border border-gray-300 rounded-lg mb-4 focus:border-indigo-500 focus:ring-indigo-500" placeholder="Paste the job description here..."></textarea>
                        </div>
                        
                        <div class="space-y-5">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-1">Output Language</label>
                                <select class="w-full rounded-lg border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 shadow-sm">
                                    <option selected>Vietnamese</option>
                                    <option>English</option>
                                    <option>Spanish</option>
                                    <option>French</option>
                                    <option>German</option>
                                    <option>Chinese</option>
                                </select>
                            </div>
                            
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Summary Length</label>
                                <div class="flex items-center gap-4">
                                    <label class="flex items-center gap-2 cursor-pointer">
                                        <input type="radio" name="summaryLength" class="radio-custom" checked>
                                        <span class="text-sm">Short (~100 words)</span>
                                    </label>
                                    <label class="flex items-center gap-2 cursor-pointer">
                                        <input type="radio" name="summaryLength" class="radio-custom">
                                        <span class="text-sm">Medium (~250 words)</span>
                                    </label>
                                    <label class="flex items-center gap-2 cursor-pointer">
                                        <input type="radio" name="summaryLength" class="radio-custom">
                                        <span class="text-sm">Long (~500 words)</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        
                        <button id="processBtn" class="mt-8 w-full bg-indigo-600 hover:bg-indigo-700 text-white py-3 px-4 rounded-lg font-medium flex items-center justify-center gap-2 transition-colors duration-300 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
                            <i class="fas fa-magic"></i> Generate Summary
                        </button>
                    </div>
                    
                    <!-- Output Sections -->
                    <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-100 overflow-auto">
                        <h3 class="text-lg font-semibold mb-4 text-gray-800 flex items-center gap-2">
                            <i class="fas fa-file-alt text-indigo-500"></i> Extracted CV Content
                        </h3>
                        <div id="extractedContent" class="text-gray-700 text-sm overflow-auto">
                            <div class="text-center py-12 text-gray-400">
                                <i class="fas fa-file-import text-4xl mb-3"></i>
                                <p>Upload your CV or paste text to see extracted content</p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-100 overflow-auto">
                        <h3 class="text-lg font-semibold mb-4 text-gray-800 flex items-center gap-2">
                            <i class="fas fa-briefcase text-indigo-500"></i> Job Description
                        </h3>
                        <div id="jdContent" class="text-gray-700 overflow-auto">
                            <div class="text-center py-12 text-gray-400">
                                <i class="fas fa-align-left text-4xl mb-3"></i>
                                <p>Enter job description on the left to see it here</p>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-100 overflow-auto">
                        <h3 class="text-lg font-semibold mb-4 text-gray-800 flex items-center gap-2">
                            <i class="fas fa-robot text-indigo-500"></i> AI-Generated Summary
                        </h3>
                        <div id="aiSummary" class="text-gray-700 overflow-auto">
                            <div class="text-center py-12 text-gray-400">
                                <i class="fas fa-spinner fa-spin text-4xl mb-3"></i>
                                <p>Your summary will appear here after processing...</p>
                            </div>
                        </div>
                    </div>

                    <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-100 overflow-auto">
                        <h3 class="text-lg font-semibold mb-4 text-gray-800 flex items-center gap-2">
                            <i class="fas fa-project-diagram text-indigo-500"></i> CV-JD Match Analysis
                        </h3>
                        <div id="matchAnalysis" class="text-gray-700 overflow-auto">
                            <div class="text-center py-12 text-gray-400">
                                <i class="fas fa-search text-4xl mb-3"></i>
                                <p>Analysis of CV-JD match will appear here</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>

        <!-- Footer -->
        <footer class="bg-gray-50 py-6 text-center text-gray-500 text-sm border-t border-gray-200">
            <div class="container mx-auto max-w-6xl px-4">
                <p>© 2023 AI CV Summarizer. All rights reserved.</p>
                <p class="mt-1 flex items-center justify-center gap-2">
                    <span>This service may use your files to improve the AI model.</span>
                    <a href="https://github.com/username/repo/issues/new" target="_blank" class="text-indigo-600 hover:text-indigo-800">
                        <i class="fas fa-bug"></i> Report Bug
                    </a>
                </p>
            </div>
        </footer>
    </div>

    <script>
        // File Upload and Drag & Drop
        const dropZone = document.getElementById('dropZone');
        const fileInput = document.getElementById('fileInput');
        const uploadBtn = document.getElementById('uploadBtn');
        const processBtn = document.getElementById('processBtn');

        uploadBtn.addEventListener('click', () => fileInput.click());

        fileInput.addEventListener('change', (e) => {
            if (e.target.files.length) {
                handleFile(e.target.files[0]);
            }
        });

        ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
            dropZone.addEventListener(eventName, preventDefaults, false);
        });

        function preventDefaults(e) {
            e.preventDefault();
            e.stopPropagation();
        }

        ['dragenter', 'dragover'].forEach(eventName => {
            dropZone.addEventListener(eventName, highlight, false);
        });

        ['dragleave', 'drop'].forEach(eventName => {
            dropZone.addEventListener(eventName, unhighlight, false);
        });

        function highlight() {
            dropZone.classList.add('drag-active');
        }

        function unhighlight() {
            dropZone.classList.remove('drag-active');
        }

        dropZone.addEventListener('drop', (e) => {
            const dt = e.dataTransfer;
            const file = dt.files[0];
            handleFile(file);
        });

        function handleFile(file) {
            if (file.type !== 'application/pdf') {
                alert('Please upload a PDF file');
                return;
            }
            if (file.size > 10 * 1024 * 1024) { // 10MB
                alert('File is too large. Maximum size is 10MB');
                return;
            }

            // Enable process button
            processBtn.disabled = false;

            // Show file info
            const extractedContent = document.getElementById('extractedContent');
            extractedContent.innerHTML = `
                <div class="flex items-start gap-4 mb-4">
                    <i class="fas fa-file-pdf text-red-500 mt-1"></i>
                    <div>
                        <h4 class="font-medium">${file.name}</h4>
                        <p class="text-xs text-gray-500">${(file.size / (1024 * 1024)).toFixed(2)} MB</p>
                    </div>
                </div>
                <p class="text-green-600 text-sm"><i class="fas fa-check-circle"></i> Ready to process</p>
            `;

            // Here you would typically read the PDF content, but that would require a PDF parsing library
            // For demo purposes, we'll simulate this with a setTimeout in the process button handler
        }

        // Process Button Handler
        processBtn.addEventListener('click', () => {
            const aiSummary = document.getElementById('aiSummary');
            aiSummary.innerHTML = `
                <div class="text-center py-8">
                    <i class="fas fa-spinner fa-spin text-4xl mb-3 text-indigo-500"></i>
                    <p class="text-gray-600">Generating your summary...</p>
                </div>
            `;

            // Simulate API call
            setTimeout(() => {
                // This would be replaced with actual API call to your backend
                const sampleSummary = `
                    <div class="space-y-4">
                        <div class="p-4 bg-indigo-50 rounded-lg">
                            <h4 class="font-medium text-indigo-700 flex items-center gap-2"><i class="fas fa-user-graduate"></i> Education</h4>
                            <p class="text-sm mt-1">Bachelor's in Computer Science from XYZ University (2015-2019)</p>
                        </div>
                        <div class="p-4 bg-green-50 rounded-lg">
                            <h4 class="font-medium text-green-700 flex items-center gap-2"><i class="fas fa-briefcase"></i> Experience</h4>
                            <p class="text-sm mt-1">3 years as a Software Engineer at ABC Company, specialized in web development and UI design.</p>
                        </div>
                        <div class="p-4 bg-blue-50 rounded-lg">
                            <h4 class="font-medium text-blue-700 flex items-center gap-2"><i class="fas fa-code"></i> Skills</h4>
                            <p class="text-sm mt-1">JavaScript, React, Node.js, Python, SQL, Git, Agile Methodologies</p>
                        </div>
                    </div>
                `;
                aiSummary.innerHTML = sampleSummary;
            }, 2500);
        });
        // Tab switching between PDF and Text input
        const tabPdf = document.getElementById('tabPdf');
        const tabText = document.getElementById('tabText');
        const pdfSection = document.getElementById('pdfSection');
        const textSection = document.getElementById('textSection');
        const cvTextInput = document.getElementById('cvTextInput');

        tabPdf.addEventListener('click', () => {
            pdfSection.classList.remove('hidden');
            textSection.classList.add('hidden');
            tabPdf.classList.add('border-indigo-500', 'text-indigo-500', 'bg-indigo-50');
            tabPdf.classList.remove('border-gray-300', 'text-gray-500');
            tabText.classList.add('border-gray-300', 'text-gray-500');
            tabText.classList.remove('border-indigo-500', 'text-indigo-500', 'bg-indigo-50');
        });

        tabText.addEventListener('click', () => {
            pdfSection.classList.add('hidden');
            textSection.classList.remove('hidden');
            tabText.classList.add('border-indigo-500', 'text-indigo-500', 'bg-indigo-50');
            tabText.classList.remove('border-gray-300', 'text-gray-500');
            tabPdf.classList.add('border-gray-300', 'text-gray-500');
            tabPdf.classList.remove('border-indigo-500', 'text-indigo-500', 'bg-indigo-50');
        });

        // JD text input handler
        const jdTextInput = document.getElementById('jdTextInput');
        const jdContent = document.getElementById('jdContent');

        jdTextInput.addEventListener('input', () => {
            if (jdTextInput.value.trim()) {
                jdContent.innerHTML = `
                    <div class="prose max-w-none">
                        <pre class="whitespace-pre-wrap">${jdTextInput.value}</pre>
                    </div>
                `;
            } else {
                jdContent.innerHTML = `
                    <div class="text-center py-12 text-gray-400">
                        <i class="fas fa-align-left text-4xl mb-3"></i>
                        <p>Enter job description on the left to see it here</p>
                    </div>
                `;
            }
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Grzimo/cvscanner" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>