-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
30 lines (24 loc) · 915 Bytes
/
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
const arrows = document.querySelectorAll(".arrows");
const moviewrapper = document.querySelectorAll(".movielistContainerWrapper");
let clickCounter = 0 ;
arrows.forEach((arrow,i)=>{
arrow.addEventListener("click",()=>{
clickCounter++;
const check = moviewrapper[i].querySelectorAll(".wrapperItem").length;
if((clickCounter + 3)-check <0 )
{
moviewrapper[i].style.transform = `translateX(${-425*(clickCounter)}px)`;
}
else
{ moviewrapper[i].style.transform = `translateX(0px)`;
clickCounter = 0 ;}
})
})
// theme changer
const ball = document.querySelector(".ball")
const items = document.querySelectorAll(".topbar,.navList,.leftbar,.leftbarWrapper,.mainContainer,.newreleaseheading,.theme,.ball,.profileHeading");
ball.addEventListener("click",()=>{
items.forEach(item=>{
item.classList.toggle("active");
})
})