-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
75 lines (57 loc) · 2.32 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
const closephone = document.querySelector("#closephone"); // le lien
const aligntxt = document.querySelector("#aligntxt"); // align justify
const phone = document.querySelector(".phone"); // blog entier
const closeicon = document.querySelector("#closeicon"); // fermer icon
const descendre = document.querySelector("#descendre");
const listeelem = document.querySelector("#listeelem");
const descendre1 = document.querySelector("#descendre1");
const listeelem1 = document.querySelector("#listeelem1");
const linkCompa = document.querySelector(".linkCompa");
const headerdesk = document.querySelector(".headerdesk");
const getStarted = document.querySelector("#getStarted");
closephone.addEventListener("click",()=>{
if(!aligntxt.classList.contains("hidden")){
phone.classList.add("flex")
phone.classList.remove("hidden")
aligntxt.classList.add("hidden")
aligntxt.classList.remove("flex")
closeicon.classList.add("flex")
closeicon.classList.remove("hidden")
}else{
phone.classList.remove("flex")
phone.classList.add("hidden")
aligntxt.classList.add("flex")
aligntxt.classList.remove("hidden")
closeicon.classList.add("hidden")
closeicon.classList.remove("flex")
}
})
descendre.addEventListener("click",()=>{
if(!listeelem.classList.contains("hidden")){
listeelem.classList.add("hidden")
listeelem.classList.remove("flex")
}else{
listeelem.classList.add("flex")
listeelem.classList.remove("hidden")
}
}, )
descendre1.addEventListener("click",()=>{
if(!listeelem1.classList.contains("hidden")){
listeelem1.classList.add("hidden")
listeelem1.classList.remove("flex")
}else{
listeelem1.classList.add("flex")
listeelem1.classList.remove("hidden")
}
}, )
window.addEventListener("scroll",()=>{
if(window.scrollY > 100 ){
headerdesk.classList.add("border-gray-200","border","border-neutral-200/50","bg-white")
getStarted.classList.remove("hidden","opacity-0")
getStarted.classList.add("flex","opacity-1")
}else{
headerdesk.classList.remove("border-gray-200","border","border-neutral-200/50","bg-white")
getStarted.classList.add("hidden","opacity-0")
getStarted.classList.remove("flex","opacity-1")
}
})