-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
168 lines (134 loc) · 4.37 KB
/
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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
function escrevendoLetra(){
function ativaLetra(elemento){
const arrTexto = elemento.innerHTML.split('');
elemento.innerHTML = '';
arrTexto.forEach((letra, i)=>{
setTimeout(()=>{
elemento.innerHTML += letra;
}, 75 * i);
});
}
const titulo = document.querySelector('.digitando');
ativaLetra(titulo);
}
function ativacaoMenu(){
const ativaMenu = document.querySelector('.fa-bars');
const navMenu = document.querySelector('header .navegacao-primaria')
ativaMenu.addEventListener('click', ()=>{
ativaMenu.classList.toggle('fa-x')
navMenu.classList.toggle('ativado')
})
}
ativacaoMenu()
function sobreMim(){
const experiencia = document.querySelectorAll('.experience_content div');
const botao = document.querySelectorAll('.experience_content ul li')
const education = document.querySelectorAll('.education_content div');
const botaoEducation = document.querySelectorAll('.education_content ul li')
experiencia[0].classList.add('ativo')
botao[0].classList.add('ativo')
education[0].classList.add('ativo')
botaoEducation[0].classList.add('ativo')
function slideShow(index){
experiencia.forEach((divisao)=>{
divisao.classList.remove('ativo');
});
botao.forEach((item)=>{
item.classList.remove('ativo')
});
experiencia[index].classList.add('ativo')
botao[index].classList.add('ativo')
}
function slideShow2(index){
education.forEach((divisao)=>{
divisao.classList.remove('ativo');
});
botaoEducation.forEach((item)=>{
item.classList.remove('ativo')
});
education[index].classList.add('ativo')
botaoEducation[index].classList.add('ativo')
}
botao.forEach((event,index)=>{
event.addEventListener('click', ()=>{
slideShow(index)
});
});
botaoEducation.forEach((div, index)=>{
div.addEventListener('click', ()=>{
slideShow2(index)
})
})
}
sobreMim();
const listaALL = document.querySelectorAll('.projects_armazenamento ul li');
const buttonGeral = document.querySelectorAll('.project_navegacao li');
const buttonALL = document.querySelector('.project_models .all');
listaALL.forEach((item)=>{
item.classList.add('ativo');
})
function removeClick(index){
buttonGeral.forEach((item)=>{
item.classList.remove('ativo');
})
buttonGeral[index].classList.add('ativo')
}
buttonGeral.forEach((event,index)=>{
event.addEventListener('click', ()=>{
removeClick(index)
})
})
function showLista(lista, buttom = "all"){
lista.forEach((item)=>{
item.classList.remove('ativo');
});
if(buttom == 'design'){
lista[0].classList.add('ativo')
}
if(buttom == 'desktop'){
lista[3].classList.add('ativo');
}
if(buttom == 'website'){
lista[1].classList.add('ativo');
lista[2].classList.add('ativo');
lista[4].classList.add('ativo');
lista[5].classList.add('ativo');
}
if(buttom == 'teamwork'){
lista[1].classList.add('ativo');
lista[3].classList.add('ativo');
lista[5].classList.add('ativo');
}
if(buttom == 'all'){
lista[0].classList.add('ativo');
lista[1].classList.add('ativo');
lista[2].classList.add('ativo');
lista[3].classList.add('ativo');
lista[4].classList.add('ativo');
lista[5].classList.add('ativo');
lista[6].classList.add('ativo');
lista[7].classList.add('ativo');
}
}
buttonGeral.forEach((item)=>{
item.addEventListener('click', (e)=>{
let currentButton = e.target;
if(currentButton.classList.contains('all')){
showLista(listaALL);
} if(currentButton.classList.contains('design')){
showLista(listaALL, "design")
}
if(currentButton.classList.contains('desktop')){
showLista(listaALL, "desktop")
}
if(currentButton.classList.contains('website')){
showLista(listaALL, "website")
}
if(currentButton.classList.contains('teamwork')){
showLista(listaALL, "teamwork")
}
if(currentButton.classList.contains('all')){
showLista(listaALL, "all")
}
});
});