-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
59 lines (48 loc) · 1.72 KB
/
index.js
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
var tablinks = document.getElementsByClassName("tab-links");
var tabcontents = document.getElementsByClassName("tab-contentes");
function opentab(tabname){
for(tablink of tablinks){
tablink.classList.remove("active-link");
}
for(tabcontent of tabcontents){
tabcontent.classList.remove("active-tab");
}
event.currentTarget.classList.add("active-link");
document.getElementById(tabname).classList.add("active-tab");
}
var work = document.querySelectorAll('.work');
function rotate(e){
for(works of work){
works.classList.remove('rotate')
}
e.target.classList.add('rotate');
}
// ---------------------------- email messaging------------------------------//
function sendMessage() {
var params = {
from_name: document.getElementById("sender_name").value,
email_id: document.getElementById("sender_add").value,
message: document.getElementById("message").value + " " + document.getElementById("phone_no").value
};
var serviceID = "service_klktxrn" // Correct the variable name if necessary
var templateID = "template_9z83kbv" // Correct the variable name if necessary
var api_key = "8L8mQyyKKi5jJYPzB" // Correct the variable name if necessary
var data = {
service_id: serviceID,
template_id: templateID,
user_id: api_key,
template_params: params
};
fetch('https://api.emailjs.com/api/v1.0/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((result) => {
console.log(result);
}).catch((error) => {
console.log(error.text);
});
alert("Success Fully Sended")
}