-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathats-optimizer.html
More file actions
436 lines (375 loc) Β· 14.9 KB
/
ats-optimizer.html
File metadata and controls
436 lines (375 loc) Β· 14.9 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ATS Optimizer | Simpatico HR</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script>if(window.pdfjsLib)pdfjsLib.GlobalWorkerOptions.workerSrc='https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';</script>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
:root {
--accent: #6366f1;
--accent-soft: rgba(99,102,241,.12);
--bg: #020617;
--card: rgba(15,23,42,.65);
--border: rgba(255,255,255,.08);
--text: #f8fafc;
--muted: #94a3b8;
--green: #10b981;
--red: #ef4444;
--yellow: #f59e0b;
--blue: #3b82f6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
background:
radial-gradient(circle at 10% 20%, rgba(99,102,241,.15), transparent 40%),
radial-gradient(circle at 90% 80%, rgba(79,70,229,.1), transparent 40%),
var(--bg);
color: var(--text);
min-height: 100vh;
}
.nav {
backdrop-filter: blur(16px);
background: rgba(2,6,23,.85);
padding: 1.2rem 6%;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.logo { font-weight: 800; font-size: 1.1rem; color: #fff; text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 16px; }
.link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.link:hover { color: #fff; }
.container { max-width: 800px; margin: 0 auto; padding: 50px 20px; }
.header { text-align: center; margin-bottom: 40px; }
.header h1 {
font-size: clamp(2rem, 5vw, 3rem);
font-weight: 800;
background: linear-gradient(#fff, #94a3b8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 12px;
}
.header p { color: var(--muted); font-size: 1rem; line-height: 1.6; }
.card {
background: var(--card);
backdrop-filter: blur(22px);
border: 1px solid var(--border);
border-radius: 24px;
padding: 32px;
margin-bottom: 20px;
}
.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
label { display: block; font-size: 0.8rem; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
textarea, input[type="text"] {
width: 100%;
padding: 12px 14px;
background: rgba(255,255,255,0.04);
border: 1px solid var(--border);
border-radius: 12px;
color: var(--text);
font-size: 0.9rem;
font-family: inherit;
outline: none;
transition: border-color 0.2s;
}
textarea { min-height: 140px; resize: vertical; }
textarea:focus, input:focus { border-color: rgba(99,102,241,0.4); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.upload-area {
border: 2px dashed var(--border);
border-radius: 16px;
padding: 30px;
text-align: center;
cursor: pointer;
transition: all 0.3s;
margin-top: 8px;
}
.upload-area:hover { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.03); }
.upload-area.ok { border-color: var(--green); background: rgba(16,185,129,0.05); }
.upload-area p { color: var(--muted); font-size: 0.85rem; }
.upload-area strong { color: var(--accent); }
.file-name { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 16px;
border-radius: 16px;
font-weight: 700;
font-size: 0.95rem;
border: none;
cursor: pointer;
font-family: inherit;
transition: all 0.2s;
margin-top: 20px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { transform: scale(1.02); box-shadow: 0 8px 30px rgba(99,102,241,0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: #fff; margin-top: 10px; }
.btn-secondary:hover { border-color: rgba(99,102,241,0.4); }
/* Results */
.score-circle {
width: 140px; height: 140px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
margin: 0 auto 20px;
}
.score-num { font-size: 2.2rem; font-weight: 800; }
.score-label { font-size: 0.85rem; color: var(--muted); }
.result-section { margin-bottom: 20px; }
.result-section h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-match { background: rgba(16,185,129,0.12); color: #34d399; padding: 4px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }
.tag-miss { background: rgba(239,68,68,0.12); color: #f87171; padding: 4px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }
.tag-tip { background: rgba(99,102,241,0.12); color: #a5b4fc; padding: 4px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }
.tip-item {
background: rgba(255,255,255,0.03);
border: 1px solid var(--border);
border-radius: 12px;
padding: 12px 16px;
margin-bottom: 8px;
font-size: 0.85rem;
color: var(--muted);
line-height: 1.6;
}
.hidden { display: none !important; }
.toast-box { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 10px 18px; border-radius: 10px; font-size: 0.85rem; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: tIn 0.3s ease, tOut 0.3s ease 2.7s forwards; }
@keyframes tIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes tOut { to { transform: translateX(120%); opacity: 0; } }
@media (max-width: 600px) {
.container { padding: 30px 14px; }
.card { padding: 24px 18px; border-radius: 18px; }
.nav { padding: 1rem 4%; }
}
</style>
</head>
<body>
<div class="toast-box" id="toasts"></div>
<nav class="nav">
<a class="logo" href="index.html">SIMPATICO <span>HR</span></a>
<div class="nav-links">
<a class="link" href="career-lab.html">π§ͺ Career Lab</a>
<a class="link" href="index.html">Home</a>
</div>
</nav>
<div class="container">
<div class="header">
<h1>π― ATS Optimizer</h1>
<p>Upload your resume, paste the job description, and get instant ATS compatibility score with fix suggestions.</p>
</div>
<!-- INPUT -->
<div id="inputSection">
<div class="card">
<h2>π Your Resume</h2>
<div class="upload-area" id="uploadArea" onclick="document.getElementById('fileInput').click()">
<p>π Click to upload <strong>PDF or TXT</strong></p>
<p class="file-name" id="fileName">No file selected</p>
<input type="file" id="fileInput" accept=".pdf,.txt,.doc,.docx" hidden>
</div>
</div>
<div class="card">
<h2>π Job Description</h2>
<label>Paste the full job description below</label>
<textarea id="jdInput" placeholder="Paste the job description here... Example: We are looking for a Senior Frontend Developer with 5+ years experience in React, TypeScript, and Next.js..."></textarea>
<label>Job Title (optional)</label>
<input type="text" id="titleInput" placeholder="e.g. Senior Frontend Developer">
</div>
<button class="btn btn-primary" id="analyzeBtn" onclick="analyze()">π Analyze ATS Compatibility</button>
<button class="btn btn-secondary" onclick="window.location.href='career-lab.html'">β Back to Career Lab</button>
</div>
<!-- RESULTS -->
<div id="resultSection" class="hidden">
<div class="card" style="text-align:center;">
<h2 style="justify-content:center;">π ATS Compatibility Score</h2>
<div class="score-circle" id="scoreCircle">
<div>
<div class="score-num" id="scoreNum">0</div>
<div class="score-label">/ 100</div>
</div>
</div>
<p id="scoreSummary" style="color:var(--muted);line-height:1.6;"></p>
</div>
<div class="card">
<div class="result-section">
<h3>β
Matched Keywords</h3>
<div class="tag-list" id="matchedTags"></div>
</div>
<div class="result-section">
<h3>β Missing Keywords</h3>
<div class="tag-list" id="missingTags"></div>
</div>
<div class="result-section">
<h3>π‘ Improvement Tips</h3>
<div id="tipsList"></div>
</div>
</div>
<button class="btn btn-primary" onclick="resetForm()">π Analyze Another</button>
<button class="btn btn-secondary" onclick="window.location.href='career-lab.html'">β Career Lab</button>
</div>
</div>
<script>
const W = "https://evalis-ai.simpaticohrconsultancy.workers.dev";
let resumeText = "";
function toast(m) {
const c = document.getElementById("toasts");
const t = document.createElement("div");
t.className = "toast"; t.textContent = m;
c.appendChild(t);
setTimeout(() => t.remove(), 3200);
}
// File upload
document.getElementById('fileInput').addEventListener('change', async e => {
const file = e.target.files[0];
if (!file) return;
document.getElementById('fileName').textContent = 'β³ Processing...';
try {
const ext = file.name.split('.').pop().toLowerCase();
if (ext === 'txt') resumeText = await file.text();
else if (ext === 'pdf') resumeText = await extractPDF(file);
else resumeText = await file.text();
resumeText = resumeText.replace(/\s+/g, ' ').replace(/[^\x20-\x7E\n]/g, '').trim().substring(0, 5000);
if (resumeText.length < 30) {
document.getElementById('fileName').textContent = 'β οΈ Could not read. Try TXT.';
resumeText = '';
return;
}
document.getElementById('fileName').textContent = 'β
' + file.name + ' (' + resumeText.length + ' chars)';
document.getElementById('uploadArea').classList.add('ok');
toast('π Resume loaded!');
} catch (err) {
document.getElementById('fileName').textContent = 'β Error';
resumeText = '';
}
});
async function extractPDF(f) {
if (!window.pdfjsLib) return await f.text();
try {
const b = await f.arrayBuffer();
const p = await pdfjsLib.getDocument({ data: b }).promise;
let t = '';
for (let i = 1; i <= p.numPages; i++) {
const pg = await p.getPage(i);
const c = await pg.getTextContent();
t += c.items.map(x => x.str).join(' ') + '\n';
}
return t;
} catch (e) {
return await f.text();
}
}
// Analyze
async function analyze() {
const jd = document.getElementById('jdInput').value.trim();
const title = document.getElementById('titleInput').value.trim();
if (!resumeText) { toast('π Upload your resume first'); return; }
if (!jd) { toast('π Paste job description'); return; }
const btn = document.getElementById('analyzeBtn');
btn.disabled = true;
btn.textContent = 'β³ AI is analyzing...';
try {
const res = await fetch(W, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
messages: [
{
role: "system",
content: "You are an expert ATS (Applicant Tracking System) analyzer. Return ONLY valid JSON. No markdown."
},
{
role: "user",
content: `Analyze this resume against the job description for ATS compatibility.
Job Title: ${title || 'Not specified'}
Job Description:
${jd.substring(0, 3000)}
Resume:
${resumeText.substring(0, 4000)}
Return ONLY this JSON:
{
"score": 72,
"summary": "Brief 2-sentence assessment",
"matchedKeywords": ["keyword1", "keyword2", "keyword3"],
"missingKeywords": ["keyword1", "keyword2"],
"tips": ["Tip 1 for improvement", "Tip 2", "Tip 3", "Tip 4", "Tip 5"],
"experienceMatch": "good",
"formatScore": 8
}
Be specific. Match actual keywords from the JD. Keep tips actionable and under 100 chars each. Return ONLY JSON.`
}
]
})
});
const data = await res.json();
if (!data.response) throw new Error("Empty response");
const result = parseJSON(data.response);
showResults(result);
toast('β
Analysis complete!');
} catch (err) {
console.error(err);
toast('β Error: ' + err.message);
}
btn.disabled = false;
btn.textContent = 'π Analyze ATS Compatibility';
}
function parseJSON(raw) {
let c = raw.replace(/```json\s*/gi, '').replace(/```\s*/g, '').trim();
const m = c.match(/\{[\s\S]*\}/);
if (!m) throw new Error('No JSON');
c = m[0].replace(/,\s*([}\]])/g, '$1');
try { return JSON.parse(c); } catch (e) {
c = c.replace(/[\x00-\x1F\x7F]/g, ' ');
return JSON.parse(c);
}
}
function showResults(r) {
document.getElementById('inputSection').classList.add('hidden');
document.getElementById('resultSection').classList.remove('hidden');
const score = Math.min(100, Math.max(0, r.score || 50));
const isGood = score >= 75;
const isOk = score >= 50;
const color = isGood ? '#10b981' : isOk ? '#f59e0b' : '#ef4444';
const bg = isGood ? 'rgba(16,185,129,0.15)' : isOk ? 'rgba(245,158,11,0.15)' : 'rgba(239,68,68,0.15)';
document.getElementById('scoreCircle').style.background = `conic-gradient(${color} ${score * 3.6}deg, rgba(255,255,255,0.05) 0deg)`;
document.getElementById('scoreSummary').textContent = r.summary || '';
// Animated score
let cur = 0;
const el = document.getElementById('scoreNum');
const iv = setInterval(() => {
cur += Math.ceil(score / 25);
if (cur >= score) { cur = score; clearInterval(iv); }
el.textContent = cur;
el.style.color = color;
}, 30);
// Matched
const mt = document.getElementById('matchedTags');
mt.innerHTML = (r.matchedKeywords || []).map(k => `<span class="tag-match">β
${k}</span>`).join('');
// Missing
const ms = document.getElementById('missingTags');
ms.innerHTML = (r.missingKeywords || []).map(k => `<span class="tag-miss">β ${k}</span>`).join('');
// Tips
const tips = document.getElementById('tipsList');
tips.innerHTML = (r.tips || []).map(t => `<div class="tip-item">π‘ ${t}</div>`).join('');
}
function resetForm() {
document.getElementById('inputSection').classList.remove('hidden');
document.getElementById('resultSection').classList.add('hidden');
document.getElementById('jdInput').value = '';
document.getElementById('titleInput').value = '';
document.getElementById('fileName').textContent = 'No file selected';
document.getElementById('uploadArea').classList.remove('ok');
resumeText = '';
}
</script>
</body>
</html>