-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (32 loc) · 1.08 KB
/
script.js
File metadata and controls
43 lines (32 loc) · 1.08 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
42
43
// Tab functionality for skills section
function initSkillsTabs() {
const tabs = document.querySelectorAll(".skill-tab");
const categories = document.querySelectorAll(".skill-category");
tabs.forEach((tab) => {
tab.addEventListener("click", () => {
tabs.forEach((t) => t.classList.remove("active"));
tab.classList.add("active");
const targetId = tab.getAttribute("data-tab");
categories.forEach((category) => {
category.classList.remove("active");
});
document.getElementById(targetId).classList.add("active");
});
});
initTechIconTooltips();
}
function initTechIconTooltips() {
const techIcons = document.querySelectorAll(".tech-icon, .tech-icon-lg");
techIcons.forEach((icon) => {
let timeout;
icon.addEventListener("mouseenter", function () {
clearTimeout(timeout);
});
icon.addEventListener("mouseleave", function () {
timeout = setTimeout(() => {}, 100);
});
});
}
document.addEventListener("DOMContentLoaded", function () {
initSkillsTabs();
});