-
Notifications
You must be signed in to change notification settings - Fork 0
/
reveal.js
65 lines (52 loc) · 1.45 KB
/
reveal.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
window.revelar = ScrollReveal({reset:true})
/*Efeito pagina inicial (destaques)*/
revelar.reveal('.efeito-txt-pagInicital', {
duration:2000,
distance:'90px'
} )
revelar.reveal('.efeito-reveal-destaques', {
duration:2000,
distance:'100px',
delay:500
} )
// Topo da apresentação//
revelar.reveal('.efeito-img-apto', {
duration:2000,
distance:'90px'
} )
revelar.reveal('.efeito-txt-apto', {
duration:2000,
distance:'90px',
delay: 500
} )
revelar.reveal('.efeito-ficha-tec', {
duration:2000,
distance:'90px',
delay: 500
} )
/*Ativar o menu */
const links = document.querySelectorAll(".nav-menu a");
function ativarLink(link){
const url = location.href;
const href = link.href;
if(url.includes(href)){
link.classList.add("ativo");
}
}
links.forEach(ativarLink);
/*----------- Menu hamburger ---------------*/
const btnMobile = document.getElementById('btn-mobile');
function toggleMenu(event) {
if (event.type === 'touchstart') event.preventDefault();
const nav = document.getElementById('nav');
nav.classList.toggle('active');
const active = nav.classList.contains('active');
event.currentTarget.setAttribute('aria-expanded', active);
if (active) {
event.currentTarget.setAttribute('aria-label', 'Fechar Menu');
} else {
event.currentTarget.setAttribute('aria-label', 'Abrir Menu');
}
}
btnMobile.addEventListener('click', toggleMenu);
btnMobile.addEventListener('touchstart', toggleMenu);