avimittal30 commited on
Commit
50a2256
·
1 Parent(s): a60a6e6

adding static directory

Browse files
Files changed (1) hide show
  1. static/index.html +112 -0
static/index.html ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Job Matcher</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ max-width: 600px;
12
+ margin: 40px auto;
13
+ padding: 20px;
14
+ background-color: #f9f9f9;
15
+ text-align: center;
16
+ }
17
+ textarea {
18
+ width: 100%;
19
+ height: 150px;
20
+ padding: 10px;
21
+ border: 1px solid #ccc;
22
+ border-radius: 5px;
23
+ }
24
+ button {
25
+ margin-top: 10px;
26
+ padding: 10px 20px;
27
+ background-color: #007BFF;
28
+ color: white;
29
+ border: none;
30
+ border-radius: 5px;
31
+ cursor: pointer;
32
+ }
33
+ button:hover {
34
+ background-color: #0056b3;
35
+ }
36
+ .resume {
37
+ background: white;
38
+ padding: 10px;
39
+ border-radius: 5px;
40
+ margin-top: 10px;
41
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
42
+ }
43
+
44
+ .resume-item {
45
+ background: white;
46
+ padding: 12px;
47
+ border-radius: 5px;
48
+ margin: 8px 0;
49
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
50
+ transition: transform 0.2s ease-in-out;
51
+ }
52
+
53
+ .resume-item:hover {
54
+ transform: scale(1.02);
55
+ background-color: #f1f1f1;
56
+ }
57
+
58
+
59
+ </style>
60
+ </head>
61
+ <body>
62
+ <h1>Job Description Input</h1>
63
+ <textarea id="jobDescription" placeholder="Enter the job description..."></textarea>
64
+ <button onclick="submitJobDescription()">Submit</button>
65
+ <div id="resumes"></div>
66
+
67
+ <script>
68
+ async function submitJobDescription() {
69
+ const jobDescription = document.getElementById("jobDescription").value;
70
+ const resumesDiv = document.getElementById("resumes");
71
+ resumesDiv.innerHTML = "Loading...";
72
+
73
+ try {
74
+ const response = await fetch("http://localhost:8000/candidate_recommendation/", { // ✅ Keep the trailing slash
75
+ method: "POST",
76
+ headers: { "Content-Type": "application/json" },
77
+ body: JSON.stringify({ job_description: jobDescription })
78
+ });
79
+
80
+ if (!response.ok) throw new Error("Failed to fetch resumes");
81
+ const data = await response.json();
82
+
83
+ // resumesDiv.innerHTML = "<h2>Top 5 Resumes</h2>";
84
+ // data.top_resumes.forEach(resume => {
85
+ // const div = document.createElement("div");
86
+ // div.className = "resume";
87
+ // div.textContent = resume;
88
+ // resumesDiv.appendChild(div);
89
+
90
+ // });
91
+
92
+ // Create a styled list of resumes
93
+ resumesDiv.innerHTML = "<h2>Top 5 Recommended Resumes</h2>";
94
+ const list = document.createElement("ol"); // Ordered list
95
+
96
+ data.top_resumes.forEach(resume => {
97
+ const listItem = document.createElement("li");
98
+ listItem.className = "resume-item";
99
+ listItem.textContent = resume;
100
+ list.appendChild(listItem);
101
+ });
102
+
103
+ resumesDiv.appendChild(list);
104
+
105
+ } catch (error) {
106
+ resumesDiv.innerHTML = `<p style='color: red;'>${error.message}</p>`;
107
+ }
108
+ }
109
+
110
+ </script>
111
+ </body>
112
+ </html>