-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
62 lines (43 loc) · 1.54 KB
/
app.js
File metadata and controls
62 lines (43 loc) · 1.54 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
// navbar responsive hamburger menu
const navSlide = ()=> {
const navUl = document.querySelector('.nav-main-links');
const navLinks = document.querySelectorAll('.nav-main-links li');
const burger = document.querySelector('.burger');
const signUp = document.querySelector('.nav-links .sign-up');
burger.addEventListener('click', ()=> {
// animation nav links
navLinks.forEach((link, index)=>{
if (link.style.animation) {
link.style.animation = ''
} else {
link.style.animation = `navLinkFade 0.5s ease forwards ${index /9 + 0.2}s`;
}
})
navUl.classList.toggle('nav-active')
signUp.classList.toggle('sign-active')
burger.classList.toggle('toggle');
})
}
navSlide();
// header background on scroll
window.addEventListener('scroll', function () {
let header = document.querySelector('header');
let windowPosition = window.scrollY > 0;
header.classList.toggle('header-bg', windowPosition);
})
// details list for services
const caretDown = ()=> {
const caret = document.querySelectorAll('.details-package a');
const packageList = document.querySelectorAll('.package-list');
caret.forEach((ul,index)=> {
ul.addEventListener('click', ()=> {
if(packageList[index].style.display = "none") {
packageList[index].classList.toggle('package-list-active')
}
})
})
}
caretDown();
// copy-right
var date = new Date().getFullYear();
document.getElementById("year").innerHTML = date;