-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (40 loc) · 1.56 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
39
40
NodeList.prototype.addEventListener = function (eventName, eventHandler) {
for (let node of this) {
node.addEventListener(eventName, eventHandler);
}
}
window.addEventListener("load", function () {
document.body.classList.remove("off");
})
window.particlesJS.load('particles', 'config/particles.json', function () {
console.log('callback - particles.js config loaded');
});
document.querySelector("body > main#portfolio > nav.right").addEventListener("click", function () {
document.querySelector("body > main#portfolio > main").scrollBy({
top: 0,
left: window.innerWidth,
behavior: "smooth"
});
});
document.querySelector("body > main#portfolio > nav.left").addEventListener("click", function () {
document.querySelector("body > main#portfolio > main").scrollBy({
top: 0,
left: 0 - window.innerWidth,
behavior: "smooth"
});
});
document.querySelectorAll("body > main#portfolio > main > section > a").addEventListener("mouseenter", function () {
this.parentNode.parentNode.parentNode.classList.add("on");
});
document.querySelectorAll("body > main#portfolio > main > section > a").addEventListener("mouseleave", function () {
this.parentNode.parentNode.parentNode.classList.remove("on");
})
document.querySelector("body > header > header > select").value = navigator.language;
document.querySelector("body > header > header > select").addEventListener("change", function () {
window.dispatchEvent(new CustomEvent("LANGUAGE", {
detail: {
"lang": this.value
}
}));
});
document.querySelector("body > header > header > select").dispatchEvent(new Event("change"));