-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from LesiaUKR/navigation
Navigation
- Loading branch information
Showing
167 changed files
with
51 additions
and
29 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
import * as bodyScrollLock from 'body-scroll-lock'; | ||
export const navigateTo = hash => { | ||
const headerRef = document.querySelector('header'); | ||
if (!headerRef) return; | ||
|
||
const id = hash.replace('#', ''); | ||
const elementRef = document.getElementById(id); | ||
|
||
const position = | ||
elementRef.getBoundingClientRect().top + | ||
window.scrollY - | ||
headerRef.offsetHeight; | ||
const positionToScroll = | ||
elementRef.getBoundingClientRect().top - headerRef.offsetHeight; | ||
|
||
bodyScrollLock.enableBodyScroll(document.body); | ||
// elementRef.scrollIntoView({}); | ||
setTimeout(() => { | ||
window.scroll({ | ||
// top: elementRef.offsetTop - headerRef.offsetHeight, | ||
top: position, | ||
setTimeout( | ||
window.scrollBy({ | ||
top: positionToScroll, | ||
behavior: 'smooth', | ||
}); | ||
}); | ||
}) | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// import { navigateTo } from './helpers/navigateTo.js'; | ||
import { navigateTo } from './helpers/navigateTo.js'; | ||
|
||
// (() => { | ||
// const locationHash = document.location.hash; | ||
// if (!locationHash) return; | ||
(() => { | ||
const locationHash = document.location.hash; | ||
if (!locationHash) return; | ||
|
||
// window.addEventListener('load', e => navigateTo(locationHash)); | ||
// })(); | ||
window.addEventListener('load', e => { | ||
e.preventDefault(); | ||
navigateTo(locationHash); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { navigateTo } from './helpers/navigateTo.js'; | ||
|
||
(() => { | ||
const linksRef = document.querySelectorAll('.js-nav-link'); | ||
|
||
const handleClick = e => { | ||
e.preventDefault(); | ||
navigateTo(e.target.hash); | ||
}; | ||
|
||
linksRef.forEach(link => link.addEventListener('click', handleClick)); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// import './js/redirect.js'; | ||
import { burgerMenu } from './js/burger.js'; | ||
// import './js/load.js'; | ||
import './js/navigation.js'; | ||
import './js/burger.js'; | ||
import './js/load.js'; | ||
// import './js/swiper.js'; | ||
import './js/miniSlide.js'; | ||
|
||
burgerMenu(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters