Skip to content

Commit

Permalink
Portfolio update
Browse files Browse the repository at this point in the history
  • Loading branch information
BossEmma committed May 28, 2024
1 parent 5f8666e commit 09244fb
Show file tree
Hide file tree
Showing 13 changed files with 1,351 additions and 4 deletions.
Empty file removed Assests/css/style.css
Empty file.
Empty file removed Assests/js/script.js
Empty file.
Binary file added asstets/images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asstets/images/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions asstets/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

// sidebar toggle variables
const menuToggler = document.querySelector('.menu-toggler');
const sideBar = document.querySelector('.side-bar');

// page navigation variables
const navItemLinks = document.querySelectorAll('.nav li a');
const pages = document.querySelectorAll('.page');


// variables for filtering
const filterBtn = document.querySelectorAll('.filter-item');
const itemCategory = document.querySelectorAll('.item-category');

// toggling sidebar in mobile
menuToggler.addEventListener('click', function(){
sideBar.classList.toggle('active');
});


// page navigation functionality

for (let i = 0; i < navItemLinks.length; i++) {
// added onclick event in nav links
navItemLinks[i].addEventListener('click', function(){

// collected nav links innertext
const itemLinkText = this.textContent.toLowerCase();

// defined page and add active class
for (let i = 0; i < pages.length; i++) {

// defining page condition
if (pages[i].classList.contains(itemLinkText)) {
// add active class on current page
pages[i].classList.add('active');
// add active class on clicked nav link
navItemLinks[i].classList.add('active');
} else {
// remove active class from other pages
pages[i].classList.remove('active');
// remove active class from other nav links
navItemLinks[i].classList.remove('active');
}

}

});
}

// added eventListener in filter buttons
for (let i = 0; i < filterBtn.length; i++) {
filterBtn[i].addEventListener('click', function(){

// remove all active class from filter button
for (let i = 0; i < filterBtn.length; i++) {
filterBtn[i].classList.remove('active');
}
// added active class on filter button clicked
this.classList.add('active');

// show item, based on filter button click
for (let i = 0; i < itemCategory.length; i++) {
const itemCategoryText = itemCategory[i].textContent;
console.log(itemCategoryText);
switch (this.textContent) {
case itemCategoryText:
itemCategory[i].parentElement.classList.add('active');
break;
case 'All':
itemCategory[i].parentElement.classList.add('active');
break;
default:
itemCategory[i].parentElement.classList.remove('active');
}
}
});
}
Loading

0 comments on commit 09244fb

Please sign in to comment.