add base styles and scripts
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<footer class="content-info">
|
||||
@php(dynamic_sidebar('sidebar-footer'))
|
||||
</footer>
|
||||
@@ -0,0 +1,17 @@
|
||||
export default function Footer() {
|
||||
const body = document.querySelector("body");
|
||||
const footer = document.querySelector(".js-footer");
|
||||
const links = footer.querySelectorAll("a");
|
||||
const currentURL = location.protocol + '//' + location.host + location.pathname;
|
||||
|
||||
links.forEach(link => {
|
||||
const hash = link.hash;
|
||||
const href = link.href;
|
||||
|
||||
link.addEventListener("click", () => {
|
||||
if(href.includes(currentURL)) {
|
||||
body.classList.remove("menu-open");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user