-
Notifications
You must be signed in to change notification settings - Fork 0
/
research.html
176 lines (161 loc) · 7.24 KB
/
research.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
<!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>Research Internship 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.3s ease-in-out;
}
input[type="text"]: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="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>
<h1>Research Internship Cold Email Generator</h1>
<form action="research.html" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your name" required><br>
<label for="job-field">Research Field:</label>
<select id="job_field" name="job_field" required>
<option value="" disabled selected>Select a field</option>
<option value="Computer Science">Computer Science</option>
<option value="Engineering">Engineering</option>
<option value="Biology">Biology</option>
<option value="Chemistry">Chemistry</option>
<option value="Biochemistry">Biochemistry</option>
<option value="Applied Physics">Applied Physics</option>
<option value="Theoretical Physics">Theoretical Physics</option>
<option value="Applied Mathematics">Applied Mathematics</option>
<option value="Theoretcal Mathematics">Theoretcal Mathematics</option>
<option value="Statistics">Statistics</option>
<option value="Economics">Economics</option>
</select><br>
<label for="education-level">Education Level:</label>
<select id="education_level" name="education_level" 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="school_name" placeholder="Enter your educational institution" required><br>
<label for="school-name">Professor Name:</label>
<input type="text" id="professor_name" name="professor_name" placeholder="Enter professor name" required><br>
<input type="submit" value="Generate Email">
</form>
<div id="result"></div>
</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(),
prof_name: $("#professor_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/research', {
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">Write an outreach cold email written by a student named {student_name} interested in working in the field of {student_field}. The person is a {student_experience} at {student_uni}, and is asking about an internship at a company called {company_name}. Do not generate emails or phone numbers. Only ask if they are open to hiring people.</div>
</div>
`;
document.body.innerHTML = content;
data = await response.json()
document.getElementsByClassName("result")[0].innerHTML = data.text
});
</script>
</html>