-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
65 lines (58 loc) · 2.38 KB
/
script.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
59
60
61
62
63
64
65
// Toggle styling of nav bar when screen width becomes smaller
let menuIcon = document.querySelector('#menu-icon');
let navBar = document.querySelector('.navbar');
menuIcon.onclick = () => {
menuIcon.classList.toggle('bx-x')
navBar.classList.toggle('active');
}
// Link social media icons to social media pages
const githubButtons = document.querySelectorAll('.github');
githubButtons.forEach(button => {
button.addEventListener('click', function() {
window.location.href = "https://github.com/soshwosh";
});
});
const linkedinButtons = document.querySelectorAll('.linkedin');
linkedinButtons.forEach(button => {
button.addEventListener('click', function() {
window.location.href = "https://www.linkedin.com/in/sasha-r-persaud/";
});
});
const instagramButtons = document.querySelectorAll('.instagram');
instagramButtons.forEach(button => {
button.addEventListener('click', function() {
window.location.href = "https://www.instagram.com/sosh.gets.a.tech.job/";
});
});
// Link Github repos to project cards
const aws_sent_analysis_news_repo = "https://github.com/SWEN-514-614-2231/term-project-team01"
const aws_sent_analysis_news_btn = document.querySelector('.aws_sent_analysis_news');
aws_sent_analysis_news_btn.addEventListener('click', function() {
window.location.href = aws_sent_analysis_news_repo;
});
// Send emails using Contact Me section
document.getElementById("contact-form").addEventListener('submit', function(event) {
// Collect input values
const from_name = document.getElementById('name').value;
const from_email = document.getElementById('email').value;
const from_phone = document.getElementById('phone').value;
const subject = document.getElementById('subject').value;
const message = document.getElementById('message').value;
// Setup email params
const templateParams = {
from_name: from_name,
from_email: from_email,
from_phone: from_phone,
subject: subject,
message: message,
};
// Send email using EmailJS
emailjs.send('service_q76dg58', 'contact_form', templateParams)
.then(function(response) {
console.log('SUCCESS!', response.status, response.text);
alert("Email sent successfully.");
}, function(error){
console.log('FAILED...', error);
alert("Failed to send email.");
});
});