generated from mosiichuk/frontend-base
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navbar amendments and created sidebar
- Loading branch information
Yevhen Mosiichuk
committed
Mar 12, 2021
1 parent
5578fc7
commit 7878dbc
Showing
5 changed files
with
260 additions
and
32 deletions.
There are no files selected for viewing
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,4 +1,5 @@ | ||
import "bootstrap/dist/css/bootstrap.min.css" | ||
import "bootstrap/dist/css/bootstrap-grid.min.css" | ||
import "bootstrap/dist/css/bootstrap-utilities.min.css" | ||
|
||
import './js/index'; | ||
import './styles/style.sass'; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
initMenuBurger(); | ||
}); | ||
|
||
document.addEventListener("scroll", () => { | ||
const header = document.getElementById('header'); | ||
|
||
if (window.pageYOffset > 50) { | ||
header.classList.add("header-scroll"); | ||
} else { | ||
header.classList.remove("header-scroll"); | ||
} | ||
}); | ||
|
||
function initMenuBurger() { | ||
let menuDisplayToggle = document.querySelector("#menuToggle input"), | ||
menu = document.querySelector(".menu"); | ||
|
||
menuDisplayToggle.addEventListener("change", () => { | ||
if (menuDisplayToggle.checked) { | ||
menu.classList.add("menu-active"); | ||
} else { | ||
menu.classList.remove("menu-active"); | ||
} | ||
}) | ||
} |
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
Oops, something went wrong.