-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
117 lines (100 loc) · 3.02 KB
/
app.js
File metadata and controls
117 lines (100 loc) · 3.02 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
const btns=document.querySelectorAll(".btn");
const pages=document.querySelectorAll(".page");
const close=document.querySelector(".close");
const container=document.querySelector(".container");
btns.forEach((btn,index)=>{
btn.addEventListener("click",()=>{
container.style.transition="1.5s";
container.classList.remove("container-full");
setTimeout(() => {
callMe(index);
container.classList.add("container-full");
}, 1000);
})
})
function callMe(index){
pages[0].classList.remove("coverMode");
pages.forEach((page,idx)=>{
if(idx<=index){
page.classList.add("page-open");
}
else{
page.classList.remove("page-open");
}
})
}
close.addEventListener("click",()=>{
contactBlock.style.transform=`scale(0)`;
container.style.transition="0.3s";
container.classList.remove("container-full");
setTimeout(() => {
callMe(index);
container.classList.add("container-full");
}, 2000);
pages.forEach(page=>{
page.classList.remove("page-open");
})
pages[0].classList.add("coverMode");
})
const contactBlock=document.querySelector(".contact-block");
btns[4].addEventListener("click",()=>{
setTimeout(() => {
contactBlock.style.transform=`scale(1)`;
}, 2000);
})
// Working when click btn click home
const homeContainer=document.querySelector(".home-container");
btns[0].addEventListener("click",()=>{
setTimeout(() => {
homeContainer.classList.add("home-container-show");
}, 2000);
})
const aboutContainer=document.querySelector(".about-container");
btns[1].addEventListener("click",()=>{
homeContainer.classList.remove("home-container-show");
setTimeout(() => {
aboutContainer.classList.add("about-container-show");
}, 2000);
})
btns[2].addEventListener("click",()=>{
aboutContainer.classList.remove("about-container-show");
})
const projectContainer=document.querySelector(".project-container");
btns[3].addEventListener("click",()=>{
setTimeout(() => {
projectContainer.classList.add("project-container-show");
}, 2000);
})
btns[4].addEventListener("click",()=>{
projectContainer.classList.remove("project-container-show");
})
// Slider block
const slides=document.querySelectorAll(".slide");
const prev=document.querySelector(".prev");
const next=document.querySelector(".next");
prev.classList.add("wow");
slider();
function slider(){
let i=0;
let c=1000;
next.addEventListener("click",()=>{
c=c-500;
slides.forEach(slide=>{
slide.style.transform=`translateX(${c}px)`
})
i++;
if(i===4) next.classList.add("wow");
prev.classList.remove("wow");
})
console.log(i);
prev.addEventListener("click",()=>{
c=c+500;
slides.forEach(slide=>{
slide.style.transform=`translateX(${c}px)`
})
i--;
if(i===0) prev.classList.add("wow");
next.classList.remove("wow");
})
}
// End Slider