-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (32 loc) · 1.32 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
document.addEventListener("DOMContentLoaded", function () {
const containers = document.querySelectorAll(".image-container");
const headlineSpans = document.querySelectorAll(".headline span");
containers.forEach((container) => {
container.addEventListener("mouseenter", function () {
headlineSpans.forEach((span) => {
span.style.color = "transparent";
span.style.webkitTextStroke = "1px white";
});
this.querySelector(".project-title").style.opacity = "1";
this.querySelector(".project-subtitle").style.opacity = "1";
containers.forEach((otherContainer) => {
if (otherContainer !== this) {
const otherImg = otherContainer.querySelector("img");
otherImg.style.filter = "brightness(0) invert(1) opacity(0.3)";
}
});
});
container.addEventListener("mouseleave", function () {
headlineSpans.forEach((span) => {
span.style.color = "";
span.style.webkitTextStroke = "";
});
this.querySelector(".project-title").style.opacity = "0";
this.querySelector(".project-subtitle").style.opacity = "0";
containers.forEach((otherContainer) => {
const otherImg = otherContainer.querySelector("img");
otherImg.style.filter = "";
});
});
});
});