-
Notifications
You must be signed in to change notification settings - Fork 0
/
internships.html
178 lines (160 loc) · 6.74 KB
/
internships.html
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
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<meta charset="UTF-8">
<title>Cold Email Generator</title>
<style>
body {
text-align: center;
}
form {
margin-top: 50px;
}
label {
display: inline-block;
text-align: left;
width: 150px;
margin-bottom: 10px;
}
select {
display: inline-block;
width: 200px;
margin-bottom: 10px;
}
input[type="submit"] {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin-top: 20px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
input[type="text"], select {
width: 300px;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border-radius: 5px;
border: none;
background-color: #f2f2f2;
font-size: 16px;
color: #333;
font-weight: bold;
transition: background-color 0.2s;
}
input:focus, select:focus {
background-color: #ddd;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-gradient bg-body">
<div class="container-fluid">
<a class="navbar-brand" href="#"><img src="logos/full.png" height="40vh"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link active" aria-current="page" href="index.html">Home</a>
<a class="nav-link" href="internships.html">Internships</a>
<a class="nav-link" href="research.html">Research Internships</a>
</div>
</div>
</div>
</nav>
<h1>Internship Cold Email Generator</h1>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="student_name" placeholder="Enter your name" required><br>
<label for="job-field">Job Field:</label>
<select id="job-field" name="student_field" required>
<option value="" disabled selected>Select a field</option>
<option value="Software Engineering">Software Engineering</option>
<option value="Electrical Engineering">Electrical Engineering</option>
<option value="Civil Engineering">Civil Engineering</option>
<option value="Mechanical Engineering">Mechanical Engineering</option>
<option value="IT">IT</option>
<option value="Marketing">Marketing</option>
<option value="Finance">Finance</option>
<option value="Law">Law</option>
<option value="Education">Education</option>
<option value="Agriculture">Agriculture</option>
<option value="Sales">Sales</option>
</select><br>
<label for="education-level">Education Level:</label>
<select id="education-level" name="student_experience" required>
<option value="" disabled selected>Select a level</option>
<option value="high-school">High School</option>
<option value="university">Bachelor's Degree</option>
<option value="masters">Master's Degree</option>
<option value="phd">PhD</option>
</select><br>
<label for="school-name">School Name:</label>
<input type="text" id="school-name" name="student_uni" placeholder="Enter your educational institution" required><br>
<label for="company-name">Company Name:</label>
<input type="text" id="company-name" name="company_name" placeholder="Enter the company" required><br>
<input type="submit" value="Generate Email">
</form>
</body>
<script>
// const inputs = document.getElementsByTagName('input')
// const input = inputs[inputs.length - 1]
$("form").on("submit", async function(e) {
e.preventDefault()
obj = {
student_name: $("#name").val(),
student_field: $("#job-field").val(),
student_experience: $("#education-level").val(),
student_uni: $("#school-name").val(),
company_name: $("#company-name").val()
}
console.log(obj)
/* Send the data using post with element id name and name2*/
var response = await fetch('http://localhost:5000/api/v1/internship', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(obj)
});
const content = `
<nav class="navbar navbar-expand-lg navbar-light bg-gradient bg-body">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img src="logos/full.png" height="40vh"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link" aria-current="page" href="index.html">Home</a>
<a class="nav-link" href="internships.html">Internships</a>
<a class="nav-link active" href="research.html">Research Internships</a>
</div>
</div>
</div>
</nav>
<div class="container">
<h1>Cold Email Template</h1>
<div class="result card mt-5 fs-1"></div>
</div>
`;
document.body.innerHTML = content;
data = await response.json()
document.getElementsByClassName("result")[0].innerHTML = data.text
});
</script>
</html>