forked from RajD2910/Codebrewed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
60 lines (49 loc) · 1.66 KB
/
Copy pathscript.js
File metadata and controls
60 lines (49 loc) · 1.66 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
let navbar = document.querySelector('.navbar');
document.querySelector('#menu-btn').onclick = () =>{
navbar.classList.toggle('active');
searchForm.classList.remove('active');
cartItem.classList.remove('active');
}
let searchForm = document.querySelector('.search-form');
document.querySelector('#search-btn').onclick = () =>{
searchForm.classList.toggle('active');
navbar.classList.remove('active');
cartItem.classList.remove('active');
}
let cartItem = document.querySelector('.cart-items-container');
document.querySelector('#search-btn').onclick = () =>{
searchForm.classList.toggle('active');
navbar.classList.remove('active');
cartItem.classList.remove('active');
}
document.querySelector('#cart-btn').onclick = () =>{
cartItem.classList.toggle('active');
navbar.classList.remove('active');
searchForm.classList.remove('active');
}
gsap.to("header",{
backgroundColor: "rgb(69, 31, 4)",
duration:0.7,
height: "9rem",
scrollTrigger: {
trigger:"header",
scroller: "body",
start: "top -10%",
end : "top -11%",
scrub: .5
}
})
document.getElementById("profile-btn").addEventListener("click", function() {
openPopup("login-popup");
});
function openPopup(id) {
document.getElementById(id).classList.add("active");
}
function closePopup(id) {
document.getElementById(id).classList.remove("active");
}
function toggleForm(formId) {
document.getElementById("login-form").classList.remove("active");
document.getElementById("register-form").classList.remove("active");
document.getElementById(formId).classList.add("active");
}