-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
47 lines (41 loc) · 1.46 KB
/
app.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
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener('click',() => {
//toggle Nav
nav.classList.toggle('nav-active');
//Animate Links
navLinks.forEach((link,index) => {
if (link.style.animation){
link.style.animation = ''
} else {
link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.2}s`;
}
});
//Burger Animation
burger.classList.toggle('toggle');
});
}
navSlide();
window.addEventListener("scroll",function(){
var header = document.querySelector("header");
header.classList.toggle("sticky",window.scrollY>100);
});
var tabButtons=document.querySelectorAll(".tabContainer .buttonContainer button")
var tabPanels=document.querySelectorAll(".tabContainer .tabPanel")
function showPanel(panelIndex){
tabButtons.forEach(function(node){
node.style.backgroundColor="";
node.style.color="";
});
tabButtons[panelIndex].style.backgroundColor='black';
tabButtons[panelIndex].style.color="white";
tabPanels.forEach(function(node){
node.style.display="none";
});
tabPanels[panelIndex].style.display="flex";
}
showPanel(0);
//transition de pages
const swup = new Swup();