-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
34 lines (29 loc) · 992 Bytes
/
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
// Skills section tabs
let tabs = document.querySelectorAll(".tab-links");
let tabText = document.querySelectorAll(".tab-content");
tabs.forEach((tab, index) => {
tab.addEventListener("click", () => {
tabText.forEach((text) => {
text.classList.remove("active");
});
tabs.forEach((tab) => {
tab.classList.remove("active");
});
tabText[index].classList.add("active");
tabs[index].classList.add("active");
});
});
// Automatically update current year in footer copyright
const footerYear = document.querySelector(".year");
const currentYear = new Date().getFullYear();
footerYear.textContent = currentYear;
// Mobile Navigation
const sideMenu = document.getElementById("sideMenu");
const openMenu = document.querySelector(".fa-bars");
const closeMenu = document.querySelector(".fa-xmark");
openMenu.addEventListener("click", () => {
sideMenu.style.right = "0";
});
closeMenu.addEventListener("click", () => {
sideMenu.style.right = "-20rem";
});