-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (29 loc) · 937 Bytes
/
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
let menu = document.querySelector('#menu-bars');
let header = document.querySelector('header');
menu.onclick = () =>{
menu.classList.toggle('fa-times');
header.classList.toggle('active');
}
window.onscroll = () =>{
menu.classList.remove('fa-times');
header.classList.remove('active');
}
let cursor1 = document.querySelector('.cursor-1');
let cursor2 = document.querySelector('.cursor-2');
window.onmousemove = (e) =>{
console.log("working....")
cursor1.style.top = e.pageY + 'px';
cursor1.style.left = e.pageX + 'px';
cursor2.style.top = e.pageY + 'px';
cursor2.style.left = e.pageX + 'px';
}
document.querySelectorAll('a').forEach(links =>{
links.onmouseenter = () =>{
cursor1.classList.add('active');
cursor2.classList.add('active');
}
links.onmouseleave = () =>{
cursor1.classList.remove('active');
cursor2.classList.remove('active');
}
});