avimittal30 commited on
Commit
45caa45
·
1 Parent(s): 1ff4a94

adding files

Browse files
Files changed (1) hide show
  1. index.html +79 -0
index.html ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Job Matcher</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ max-width: 600px;
11
+ margin: 40px auto;
12
+ padding: 20px;
13
+ background-color: #f9f9f9;
14
+ text-align: center;
15
+ }
16
+ textarea {
17
+ width: 100%;
18
+ height: 150px;
19
+ padding: 10px;
20
+ border: 1px solid #ccc;
21
+ border-radius: 5px;
22
+ }
23
+ button {
24
+ margin-top: 10px;
25
+ padding: 10px 20px;
26
+ background-color: #007BFF;
27
+ color: white;
28
+ border: none;
29
+ border-radius: 5px;
30
+ cursor: pointer;
31
+ }
32
+ button:hover {
33
+ background-color: #0056b3;
34
+ }
35
+ .resume {
36
+ background: white;
37
+ padding: 10px;
38
+ border-radius: 5px;
39
+ margin-top: 10px;
40
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
41
+ }
42
+ </style>
43
+ </head>
44
+ <body>
45
+ <h1>Job Description Input</h1>
46
+ <textarea id="jobDescription" placeholder="Enter the job description..."></textarea>
47
+ <button onclick="submitJobDescription()">Submit</button>
48
+ <div id="resumes"></div>
49
+
50
+ <script>
51
+ async function submitJobDescription() {
52
+ const jobDescription = document.getElementById("jobDescription").value;
53
+ const resumesDiv = document.getElementById("resumes");
54
+ resumesDiv.innerHTML = "Loading...";
55
+
56
+ try {
57
+ const response = await fetch("http://localhost:8000/match_resumes", {
58
+ method: "POST",
59
+ headers: { "Content-Type": "application/json" },
60
+ body: JSON.stringify({ job_description: jobDescription })
61
+ });
62
+
63
+ if (!response.ok) throw new Error("Failed to fetch resumes");
64
+ const data = await response.json();
65
+
66
+ resumesDiv.innerHTML = "<h2>Top 5 Resumes</h2>";
67
+ data.resumes.forEach(resume => {
68
+ const div = document.createElement("div");
69
+ div.className = "resume";
70
+ div.textContent = resume;
71
+ resumesDiv.appendChild(div);
72
+ });
73
+ } catch (error) {
74
+ resumesDiv.innerHTML = `<p style='color: red;'>${error.message}</p>`;
75
+ }
76
+ }
77
+ </script>
78
+ </body>
79
+ </html>