Skip to content

Commit 2f698e7

Browse files
committed
all files
0 parents  commit 2f698e7

16 files changed

Lines changed: 2360 additions & 0 deletions

app.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const sections = document.querySelectorAll('.section');
2+
const sectBtns = document.querySelectorAll('.controlls');
3+
const sectBtn = document.querySelectorAll('.control');
4+
const allSections = document.querySelector('.main-content');
5+
6+
7+
function PageTransitions(){
8+
//Button click active class
9+
for(let i = 0; i < sectBtn.length; i++){
10+
sectBtn[i].addEventListener('click', function(){
11+
let currentBtn = document.querySelectorAll('.active-btn');
12+
currentBtn[0].className = currentBtn[0].className.replace('active-btn', '');
13+
this.className += ' active-btn';
14+
})
15+
}
16+
17+
//Sctions Active
18+
allSections.addEventListener('click', (e) =>{
19+
const id = e.target.dataset.id;
20+
if(id){
21+
//resmove selected from the other btns
22+
sectBtns.forEach((btn) =>{
23+
btn.classList.remove('active')
24+
})
25+
e.target.classList.add('active')
26+
27+
//hide other sections
28+
sections.forEach((section)=>{
29+
section.classList.remove('active')
30+
})
31+
32+
const element = document.getElementById(id);
33+
element.classList.add('active');
34+
}
35+
})
36+
37+
//Toggle theme
38+
const themeBtn = document.querySelector('.theme-btn');
39+
themeBtn.addEventListener('click',() =>{
40+
let element = document.body;
41+
element.classList.toggle('light-mode')
42+
})
43+
}
44+
45+
PageTransitions();

img/blog1.jpg

94.2 KB
Loading

img/blog2.jpg

52.3 KB
Loading

img/blog3.jpg

53.8 KB
Loading

img/hero.png

205 KB
Loading

img/port1.jpg

55.4 KB
Loading

img/port2.jpg

90.8 KB
Loading

img/port3.jpg

56.9 KB
Loading

img/port4.jpg

68.6 KB
Loading

img/port5.jpg

32.8 KB
Loading

0 commit comments

Comments
 (0)