forked from supriya46788/Research-Paper-Organizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathats-checker.html
More file actions
239 lines (213 loc) · 9.03 KB
/
Copy pathats-checker.html
File metadata and controls
239 lines (213 loc) · 9.03 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PDF Viewer & Annotator | Research Paper Organizer</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/ats-checker.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
</head>
<body>
<div class="container">
<!-- Navigation -->
<nav class="navbar">
<a href="index.html" class="nav-item">
<i class="fas fa-home"></i>
Home
</a>
<div class="navbar-right-links">
<a href="about.html" class="nav-item">About us</a>
<a href="blog.html" class="nav-item">Blogs</a>
<a href="Faq.html" class="nav-item">FAQ</a>
<a href="contact.html" class="nav-item">Contact Us</a>
<a href="tools.html" class="nav-item">Tools</a>
<button class="dark-toggle nav-item" id="darkModeToggle" title="Toggle Dark Mode" onclick="toggleDarkMode()">
<i class="fas fa-moon"></i>
</button>
</div>
</nav>
<h1>ATS Resume Score Checker</h1>
<p class="lead">
Upload your resume (and optionally a job description) to get an ATS
score based on formatting, keyword richness, and JD match.
</p>
<div>
<div class="card">
<div class="controls">
<div class="input-resume">
<label for="resumeFile">
Upload Resume
</label>
<input id="resumeFile" type="file" accept=".pdf,.docx,.txt" />
<span id="resumeFileName" class="custom-file">No file chosen</span>
</div>
<div class="input-jd">
<label for="jdFile">
Upload Job Description (optional)
</label>
<input id="jdFile" type="file" accept=".pdf,.docx,.txt" />
<span id="jdFileName" class="custom-file">No file chosen</span>
</div>
<button id="analyzeBtn" class="btn">Analyze</button>
</div>
<div class="result-container">
<div class="results" id="results" aria-live="polite"></div>
<div style="margin-top: 20px">
<div class="results">Score</div>
<div class="score-wrapper">
<div class="score" id="score">—</div>
</div>
</div>
</div>
<div style="margin-top: 10px">
<div class="results"><strong>Checks</strong></div>
<div class="check">
<input type="checkbox" id="hasContact" disabled />
<label class="check-label" for="hasContact">Contact info (email or phone)</label>
</div>
<div class="check">
<input type="checkbox" id="formattingOk" disabled />
<label class="check-label" for="formattingOk">No obvious tables/images</label>
</div>
<div class="check">
<input type="checkbox" id="lengthOk" disabled />
<label class="check-label" for="lengthOk">Reasonable length (100–1000 words)</label>
</div>
<div class="check">
<input type="checkbox" id="hasSkills" disabled />
<label class="check-label" for="hasSkills">Contains skills section/keywords</label>
</div>
<div class="check">
<input type="checkbox" id="jdMatchOk" disabled />
<label class="check-label" for="jdMatchOk">Job description match (if JD uploaded)</label>
</div>
</div>
<footer>
<strong>Note:</strong> This is a simple client-side check. For
deeper ATS analysis, a backend NLP service would be required.
</footer>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.16/mammoth.browser.min.js"></script>
<script>
const resumeFile = document.getElementById("resumeFile");
const jdFile = document.getElementById("jdFile");
const resumeFileName = document.getElementById("resumeFileName");
const jdFileName = document.getElementById("jdFileName");
const analyzeBtn = document.getElementById("analyzeBtn");
const resultsEl = document.getElementById("results");
const scoreEl = document.getElementById("score");
const hasContactEl = document.getElementById("hasContact");
const formattingOkEl = document.getElementById("formattingOk");
const lengthOkEl = document.getElementById("lengthOk");
const hasSkillsEl = document.getElementById("hasSkills");
const jdMatchEl = document.getElementById("jdMatchOk");
resumeFile.addEventListener("change", () => {
resumeFileName.textContent =
resumeFile.files.length > 0 ? resumeFile.files[0].name : "No file chosen";
});
jdFile.addEventListener("change", () => {
jdFileName.textContent =
jdFile.files.length > 0 ? jdFile.files[0].name : "No file chosen";
});
async function extractTextFromFile(file) {
if (!file) return "";
const name = file.name.toLowerCase();
if (name.endsWith(".pdf")) {
const arrayBuffer = await file.arrayBuffer();
const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise;
let text = "";
for (let i = 1; i <= pdf.numPages; i++) {
const page = await pdf.getPage(i);
const content = await page.getTextContent();
text += content.items.map((it) => it.str).join(" ") + "\n";
}
return text;
} else if (name.endsWith(".docx")) {
const arrayBuffer = await file.arrayBuffer();
const result = await mammoth.extractRawText({ arrayBuffer });
return result.value;
} else {
return await file.text();
}
}
function extractContactInfo(text) {
const emailMatch = text.match(
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/
);
const phoneMatch = text.match(
/(?:\+?\d{1,3}[\s-]?)?(?:\d{10}|\d{3}[\s-]\d{3}[\s-]\d{4}|\d{5}[\s-]\d{5})/
);
return emailMatch || phoneMatch;
}
analyzeBtn.addEventListener("click", async () => {
const resume = resumeFile.files[0];
const jd = jdFile.files[0];
if (!resume) {
resultsEl.innerHTML =
'<div class="small">Please upload a resume file.</div>';
return;
}
resultsEl.innerHTML = '<div class="small">Analyzing resume...</div>';
let resumeText = await extractTextFromFile(resume);
resumeText = resumeText.replace(/\s+/g, " ").trim();
let jdText = "";
if (jd)
jdText = (await extractTextFromFile(jd))
.replace(/\s+/g, " ")
.trim();
// Checks
const hasContact = extractContactInfo(resumeText);
hasContactEl.checked = hasContact;
const wordCount = resumeText.split(/\s+/).length;
lengthOkEl.checked = wordCount >= 100 && wordCount <= 1000;
const formattingIssues = /\[image\]|\.png|\.jpg|table|columns?/i.test(
resumeText
);
formattingOkEl.checked = !formattingIssues;
const skillsKeywords =
/(skills|technologies|languages|tools|frameworks)/i.test(resumeText);
hasSkillsEl.checked = skillsKeywords;
// JD keyword matching
let jdMatch = false;
if (jdText) {
const jdWords = jdText.toLowerCase().split(/\W+/);
const commonSkills = [
"javascript",
"python",
"c++",
"sql",
"html",
"css",
"react",
"node",
"java",
"aws",
];
let matches = commonSkills.filter(
(k) => resumeText.toLowerCase().includes(k) && jdWords.includes(k)
);
jdMatch = matches.length > 0;
jdMatchEl.checked = jdMatch;
} else {
jdMatchEl.checked = false;
}
// Score calculation
let score = 0;
if (hasContact) score += 20;
if (lengthOkEl.checked) score += 20;
if (formattingOkEl.checked) score += 20;
if (skillsKeywords) score += 20;
if (jdMatch) score += 20;
scoreEl.textContent = score + "%";
resultsEl.innerHTML = `<div><strong>Word count:</strong> ${wordCount}</div>`;
});
</script>
</body>
</html>