-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
95 lines (83 loc) · 3.04 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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// footer btns
const homeBtn = document.querySelector('.home-btn');
const searchBtn = document.querySelector('.search-btn');
const reelBtn = document.querySelector('.reel-btn');
const notifyBtn = document.querySelector('.notify-btn');
const profileBtn = document.querySelector('.profile-btn');
// sections
const homeSec = document.getElementById('home')
const searchSec = document.getElementById('search')
const reelSec = document.getElementById('reel')
const notifySec = document.getElementById('notify')
const profileSec = document.getElementById('profile')
// * Click events for footer buttons
// HOME BTN
homeBtn.addEventListener('click' , () =>{
homeBtn.classList.add('active')
searchBtn.classList.remove('active')
reelBtn.classList.remove('active')
notifyBtn.classList.remove('active')
profileBtn.classList.remove('active')
// * sections
homeSec.classList.add('sec-active')
searchSec.classList.remove('sec-active')
reelSec.classList.remove('sec-active')
notifySec.classList.remove('sec-active')
profileSec.classList.remove('sec-active')
});
// SEARCH BTN
searchBtn.addEventListener('click' , () =>{
homeBtn.classList.remove('active')
searchBtn.classList.add('active')
reelBtn.classList.remove('active')
notifyBtn.classList.remove('active')
profileBtn.classList.remove('active')
// * sections
homeSec.classList.remove('sec-active')
searchSec.classList.add('sec-active')
reelSec.classList.remove('sec-active')
notifySec.classList.remove('sec-active')
profileSec.classList.remove('sec-active')
});
// reel btn
reelBtn.addEventListener('click' , () =>{
homeBtn.classList.remove('active')
searchBtn.classList.remove('active')
reelBtn.classList.add('active')
notifyBtn.classList.remove('active')
profileBtn.classList.remove('active')
// * sections
homeSec.classList.remove('sec-active')
searchSec.classList.remove('sec-active')
reelSec.classList.add('sec-active')
notifySec.classList.remove('sec-active')
profileSec.classList.remove('sec-active')
});
// notify BTN
notifyBtn.addEventListener('click' , () =>{
homeBtn.classList.remove('active')
searchBtn.classList.remove('active')
reelBtn.classList.remove('active')
notifyBtn.classList.add('active')
profileBtn.classList.remove('active')
// * sections
homeSec.classList.remove('sec-active')
searchSec.classList.remove('sec-active')
reelSec.classList.remove('sec-active')
notifySec.classList.add('sec-active')
profileSec.classList.remove('sec-active')
});
// profile BTN
profileBtn.addEventListener('click' , () =>{
homeBtn.classList.remove('active')
searchBtn.classList.remove('active')
reelBtn.classList.remove('active')
notifyBtn.classList.remove('active')
profileBtn.classList.add('active')
// * sections
homeSec.classList.remove('sec-active')
searchSec.classList.remove('sec-active')
reelSec.classList.remove('sec-active')
notifySec.classList.remove('sec-active')
profileSec.classList.add('sec-active')
});