Skip to content

Commit

Permalink
ats score finder added
Browse files Browse the repository at this point in the history
  • Loading branch information
momithalasya committed Oct 14, 2024
1 parent 200ff46 commit 2148901
Show file tree
Hide file tree
Showing 8 changed files with 533 additions and 0 deletions.
27 changes: 27 additions & 0 deletions atsScoreFinder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// atsScoreFinder.js

function calculateATSScore(resumeText, jobDescription) {
const resumeKeywords = resumeText.split(/\W+/).map(word => word.toLowerCase());
const jobKeywords = jobDescription.split(/\W+/).map(word => word.toLowerCase());

const matchedKeywords = resumeKeywords.filter(word => jobKeywords.includes(word));
const score = (matchedKeywords.length / jobKeywords.length) * 100;

return score;
}

function analyzeFormatting(resumeText) {
const feedback = [];
const lines = resumeText.split('\n');

if (lines.length < 3) {
feedback.push("Resume should have at least 3 lines.");
}
if (resumeText.length < 300) {
feedback.push("Resume is too short; consider adding more content.");
}

return feedback;
}

module.exports = { calculateATSScore, analyzeFormatting };
78 changes: 78 additions & 0 deletions atsscore.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}

.container {
max-width: 600px;
margin: 0 auto;
background-color: white;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}

h1 {
text-align: center;
color: #333;
margin-bottom: 20px;
}

label {
display: block;
margin-bottom: 10px;
font-weight: bold;
color: #555;
}

input[type="file"],
textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 4px;
}

textarea {
resize: vertical;
}

button {
display: block;
width: 100%;
padding: 10px;
background-color: #28a745;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}

button:hover {
background-color: #218838;
}

#result-section {
margin-top: 20px;
text-align: center;
}

#score {
font-size: 2em;
color: #28a745;
}

#feedback {
margin-top: 10px;
font-size: 1.2em;
color: #555;
}
30 changes: 30 additions & 0 deletions atsscore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resume ATS Score Finder</title>
<link rel="stylesheet" href="atsscore.css"> <!-- Link to your CSS file -->
</head>
<body>
<div class="container">
<h1>Resume ATS Score Finder</h1>
<label for="job-description">Enter Job Description:</label>
<textarea id="job-description" rows="4" placeholder="Enter job description..."></textarea>

<label for="resume-upload">Upload Your Resume (PDF or Word):</label>
<input type="file" id="resume-upload" accept=".pdf, .doc, .docx">

<label for="resume-text">Or Paste Your Resume Text Here:</label>
<textarea id="resume-text" rows="4" placeholder="Paste your resume text..."></textarea>

<button id="analyze-button">Analyze Resume</button>

<div id="feedback-section">
<h2>ATS Compatibility Score: <span id="score"></span></h2>
<p>Feedback: <span id="feedback"></span></p>
</div>
</div>
<script src="atsscore.js"></script> <!-- Link to your JavaScript file -->
</body>
</html>
51 changes: 51 additions & 0 deletions atsscore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Function to calculate the ATS score based on job description and resume
function calculateATSScore(jobDescription, resumeText) {
// Normalize text by converting to lowercase to ensure case-insensitive matching
const jobDescriptionLower = jobDescription.toLowerCase();
const resumeTextLower = resumeText.toLowerCase();

// Split the text into arrays of words using space or comma as separators
const jobKeywords = jobDescriptionLower.split(/[\s,]+/); // Keywords from job description
const resumeWords = resumeTextLower.split(/[\s,]+/); // Words from resume

// Count how many keywords from the job description appear in the resume
let matchCount = 0;
jobKeywords.forEach(keyword => {
if (resumeWords.includes(keyword)) {
matchCount++;
}
});

// Calculate the percentage match as the ATS score
const score = (matchCount / jobKeywords.length) * 100;
return Math.round(score * 100) / 100; // Round the score to two decimal places
}

// Function to provide feedback based on the ATS score
function displayFeedback(score) {
if (score === 100) {
return "Excellent! Your resume is highly compatible with the job description.";
} else if (score >= 75) {
return "Good job! Your resume is quite compatible, but consider adding more relevant keywords.";
} else if (score >= 50) {
return "Fair. Your resume needs improvement. Focus on including more keywords from the job description.";
} else {
return "Low compatibility. Revise your resume to better match the job description.";
}
}

// Main function to handle form submission
document.getElementById("analyze-button").addEventListener("click", function() {
const jobDescription = document.getElementById("job-description").value;
const resumeText = document.getElementById("resume-text").value;

if (jobDescription && resumeText) {
const atsScore = calculateATSScore(jobDescription, resumeText);
const feedback = displayFeedback(atsScore);

document.getElementById("score").innerText = atsScore + "%";
document.getElementById("feedback").innerText = feedback;
} else {
document.getElementById("feedback").innerText = "Please enter both the job description and resume.";
}
});
49 changes: 49 additions & 0 deletions client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// ATS Score Calculation Functionality
document.getElementById('atsForm').addEventListener('submit', function (event) {
event.preventDefault(); // Prevent form submission

const resumeInput = document.getElementById('resumeInput').value;
const resumeFile = document.getElementById('resumeFile').files[0];

let resumeText = resumeInput;

if (resumeFile) {
const reader = new FileReader();
reader.onload = function (e) {
const fileContent = e.target.result;
// Here you could extract text from the file
resumeText = fileContent; // For demo purposes, directly use file content
calculateATSScore(resumeText);
};
reader.readAsText(resumeFile);
} else {
calculateATSScore(resumeText);
}
});

function calculateATSScore(resumeText) {
// Sample ATS score calculation logic
const keywords = ["JavaScript", "HTML", "CSS", "Python", "Java"]; // Example keywords
let score = 0;

keywords.forEach(keyword => {
if (resumeText.includes(keyword)) {
score += 20; // Increment score for each keyword found
}
});

// Display the result
document.getElementById('score').innerText = `${score}/100`;
document.getElementById('feedback').innerText = getFeedback(score);
document.getElementById('atsResult').style.display = 'block';
}

function getFeedback(score) {
if (score >= 80) {
return "Great job! Your resume is highly compatible with ATS.";
} else if (score >= 50) {
return "Your resume is moderately compatible. Consider adding more keywords.";
} else {
return "Your resume may not perform well with ATS. It's recommended to revise it.";
}
}
Loading

0 comments on commit 2148901

Please sign in to comment.