-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed header web component Format code Hide custom scrollbar Add prettier to recommended extensions
- Loading branch information
Showing
10 changed files
with
409 additions
and
369 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,3 +1,3 @@ | ||
{ | ||
"recommendations": ["celianriboulet.webvalidator"] | ||
"recommendations": ["celianriboulet.webvalidator", "esbenp.prettier-vscode"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,50 @@ | ||
// first handler for hide / show of search box when magnifying glass is clicked | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const $toggles = Array.prototype.slice.call( | ||
document.querySelectorAll('.search-icon'), 0); | ||
document.addEventListener("DOMContentLoaded", () => { | ||
const $toggles = Array.prototype.slice.call( | ||
document.querySelectorAll(".search-icon"), | ||
0, | ||
); | ||
|
||
$toggles.forEach( el => { | ||
el.addEventListener('click', () => { | ||
$toggles.forEach((el) => { | ||
el.addEventListener("click", () => { | ||
console.log("Search icon clicked"); | ||
// Get the target from the "data-target" attribute | ||
const $target = document.getElementById("search-control"); | ||
// Toggle the search control | ||
el.classList.toggle('is-hidden'); | ||
$target.classList.toggle('is-hidden'); | ||
}) | ||
}) | ||
// Get the target from the "data-target" attribute | ||
const $target = document.getElementById("search-control"); | ||
// Toggle the search control | ||
el.classList.toggle("is-hidden"); | ||
$target.classList.toggle("is-hidden"); | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
|
||
document.addEventListener("DOMContentLoaded", () => { | ||
// Get all "navbar-burger" elements | ||
const $navbarBurgers = Array.prototype.slice.call( | ||
document.querySelectorAll('.navbar-burger'), 0); | ||
|
||
document.querySelectorAll(".navbar-burger"), | ||
0, | ||
); | ||
|
||
// Add a click event on each of them | ||
$navbarBurgers.forEach( el => { | ||
el.addEventListener('click', () => { | ||
|
||
// Get the target from the "data-target" attribute | ||
const target = el.dataset.target; | ||
const $target = document.getElementById(target); | ||
|
||
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" | ||
el.classList.toggle('is-active'); | ||
$target.classList.toggle('is-active'); | ||
|
||
}); | ||
$navbarBurgers.forEach((el) => { | ||
el.addEventListener("click", () => { | ||
// Get the target from the "data-target" attribute | ||
const target = el.dataset.target; | ||
const $target = document.getElementById(target); | ||
|
||
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" | ||
el.classList.toggle("is-active"); | ||
$target.classList.toggle("is-active"); | ||
}); | ||
}); | ||
|
||
}); | ||
}); | ||
|
||
var prevScrollpos = window.scrollY; | ||
window.onscroll = function() { | ||
var currentScrollPos = window.scrollY; | ||
if (prevScrollpos > currentScrollPos) { | ||
document.getElementById("context").style.top = "66px"; | ||
} else { | ||
document.getElementById("context").style.top = "0px"; | ||
} | ||
prevScrollpos = currentScrollPos; | ||
} | ||
window.onscroll = function () { | ||
var currentScrollPos = window.scrollY; | ||
if (prevScrollpos > currentScrollPos) { | ||
document.getElementById("context").style.top = "4rem"; | ||
} else { | ||
document.getElementById("context").style.top = "0px"; | ||
} | ||
prevScrollpos = currentScrollPos; | ||
}; |
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
Oops, something went wrong.