-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
97 lines (52 loc) · 1.68 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
let developer = document.querySelector("#developer");
let hireAll = document.querySelectorAll(".hire");
let meAll = document.querySelectorAll(".me");
let hire = document.querySelector(".hire");
let me = document.querySelector(".me");
let hireArray = Array.from(hireAll);
let meArray = Array.from(meAll);
function devFunc() {
developer.textContent = "Hire me";
}
function devFuncTwo(){
developer.textContent = "Developer";
}
function hireFuncColor(){
this.style.color = "blue";
this.style.opacity = "100";
}
function hireFuncNonColor (){
this.style.color = "var(--grey_light)";
this.style.opacity = "5%";
}
function meFuncColor(){
this.style.color = "orange";
this.style.opacity = "100";
}
function meFuncNonColor (){
this.style.color = "grey";
this.style.opacity = "5%";
}
for (i of hireArray) {
i.addEventListener("mouseover", hireFuncColor);
i.addEventListener("mouseout", hireFuncNonColor);
}
for (i of meArray) {
i.addEventListener("mouseover", meFuncColor);
i.addEventListener("mouseout", meFuncNonColor);
}
developer.addEventListener("mouseover", devFunc);
developer.addEventListener("mouseout", devFuncTwo);
const panels = document.querySelector("#projectsection");
let child;
panels.addEventListener("mouseover", (event) => {
if (event.target.tagName === "A") {
child = event.target.firstChild;
event.target.firstChild.replaceWith("github actual");
}
})
panels.addEventListener("mouseout", (event) => {
if (event.target.tagName === "A") {
event.target.firstChild.replaceWith(child);
}
})