Skip to content

Commit

Permalink
feat(blur-header): add js scipt for blur effect
Browse files Browse the repository at this point in the history
Added js scrip for header scroll blur effect in assets/js/main.js
  • Loading branch information
rasan3-1416 committed Oct 6, 2023
1 parent f8e1298 commit fa0995f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ const linkAction = () => {
navMenu.classList.remove('show-menu')
}
navLink.forEach(n => n.addEventListener('click', linkAction))
/*=============== REMOVE MENU MOBILE ===============*/


/*=============== ADD BLUR HEADER ===============*/


const blurHeader = () => {
const header = document.getElementById('header')
/* When the scroll is greater then 50 viewport height add the blur-header class in header */
this.scrollY >=50 ? header.classList.add('blur-header'):header.classList.remove('blur-header')
}
window.addEventListener('scroll', blurHeader)
/*=============== SWIPER FAVORITES ===============*/


Expand Down

0 comments on commit fa0995f

Please sign in to comment.