Skip to content

Commit

Permalink
Merge pull request #35 from LesiaUKR/navigation
Browse files Browse the repository at this point in the history
Navigation
  • Loading branch information
LesiaUKR authored Aug 28, 2024
2 parents afdb57e + e59c4db commit b68a660
Show file tree
Hide file tree
Showing 167 changed files with 51 additions and 29 deletions.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/about/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/about/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/desktop/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/gallery/mobile/[email protected]
Binary file modified src/img/gallery/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/desktop/[email protected]
Binary file modified src/img/hero/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/hero/[email protected]
Binary file modified src/img/hero/[email protected]
Binary file not shown.
Binary file modified src/img/hero/[email protected]
Binary file modified src/img/hero/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/hero/mobile/[email protected]
Binary file modified src/img/hero/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file modified src/img/howToPlay/desktop/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file modified src/img/howToPlay/mobile/[email protected]
Binary file not shown.
Binary file modified src/img/logo/desktop/[email protected]
Binary file modified src/img/logo/desktop/[email protected]
Binary file not shown.
10 changes: 9 additions & 1 deletion src/js/burger.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ export const burgerMenu = () => {

closeMenuBtns.forEach(closeMenuBtn => {
closeMenuBtn.addEventListener('click', e => {
// e.preventDefault();

if (e.currentTarget.nodeName === 'A') {
toggleMenu();
navigateTo(e.target.hash);
return;
}
toggleMenu();
// navigateTo(e.target.hash);
});
});

Expand All @@ -49,3 +55,5 @@ export const burgerMenu = () => {
}, 100)
);
};

burgerMenu();
20 changes: 7 additions & 13 deletions src/js/helpers/navigateTo.js
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',
});
});
})
);
};
15 changes: 9 additions & 6 deletions src/js/load.js
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);
});
})();
12 changes: 12 additions & 0 deletions src/js/navigation.js
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));
})();
8 changes: 3 additions & 5 deletions src/main.js
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();
6 changes: 4 additions & 2 deletions src/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<!-- NAV LIST -->
<ul class="nav-list">
<li class="nav-list-item">
<a class="nav-list-link" href="./index.html">Home</a>
<a class="nav-list-link js-nav-link" href="./index.html#home">Home</a>
</li>
<li class="nav-list-item">
<a class="nav-list-link js-nav-link" href="./index.html#about"
Expand Down Expand Up @@ -122,7 +122,9 @@
<!-- MOBILE NAVIGATION -->
<ul class="menu-list">
<li class="menu-list-item">
<a class="menu-list-link js-close-menu" href="./index.html">Home</a>
<a class="menu-list-link js-link js-close-menu" href="./index.html#home"
>Home</a
>
</li>
<li class="menu-list-item">
<a
Expand Down
2 changes: 1 addition & 1 deletion src/partials/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- HOME SECTION -->
<section class="home-section section">
<section class="home-section section" id="home">
<div class="container home-section-container">
<!-- HOME TITLE -->
<div class="home-title-wrapper">
Expand Down
6 changes: 5 additions & 1 deletion src/scss/common/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

html {
box-sizing: border-box;
scroll-behavior: smooth;
scroll-padding-top: 76px;
@include media(desktop) {
scroll-padding-top: 126px;
}
}

*,
*::before,
*::after {
box-sizing: inherit;
// outline: 1px solid red;
}

body {
Expand Down
1 change: 1 addition & 0 deletions src/scss/how-to-play.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
background-color: $_pic_bg_color;
border: 1px solid $_yellow_color;
border-radius: 50%;
overflow: hidden;
@include media(desktop) {
margin-bottom: 36px;
height: 196px;
Expand Down

0 comments on commit b68a660

Please sign in to comment.