-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
41 lines (33 loc) · 1.1 KB
/
script.js
File metadata and controls
41 lines (33 loc) · 1.1 KB
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
const bar = document.getElementById('bar');
const close = document.getElementById('close');
const nav = document.getElementById('navbar');
if (bar) {
bar.addEventListener('click', () => {
nav.classList.add('start');
})
}
if (close) {
close.addEventListener('click', () => {
nav.classList.remove('start');
})
}
// contact page
function sendEmail() {
var params = {
name: document.getElementById("name").value,
email: document.getElementById("email").value,
message: document.getElementById("message").value
}
const serviceID = "service_8s3e0w5";
const templateID = "template_ha8v6rl";
emailjs.send(serviceID, templateID, params)
.then(
res => {
document.getElementById("name").value = "";
document.getElementById("email").value = "";
document.getElementById("message").value = "";
console.log(res);
alert("your message sent successfully");
})
.catch((err) => console.log(err));
}