embedded hello friend because i'm lazy

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2023-05-01 07:48:08 +02:00
1 parent 4af776a3e1
commit 9c991511b4
639 files changed
+33878 -1

No files matched your search

@@ -0,0 +1,32 @@
// Mobile menu
const menuTrigger = document.querySelector(".menu-trigger");
const menu = document.querySelector(".menu");
const mobileQuery = getComputedStyle(document.body).getPropertyValue(
"--phoneWidth"
);
const isMobile = () => window.matchMedia(mobileQuery).matches;
const isMobileMenu = () => {
menuTrigger && menuTrigger.classList.toggle("hidden", !isMobile());
menu && menu.classList.toggle("hidden", isMobile());
};
isMobileMenu();
menuTrigger &&
menuTrigger.addEventListener(
"click",
() => menu && menu.classList.toggle("hidden")
);
window.addEventListener("resize", isMobileMenu);
const language = document.getElementsByTagName('html')[0].lang;
const logo = document.querySelector(".logo__pathname");
if(logo){
window.onload = () => {
let path = window.location.pathname.substring(1);
path = path.replace(language+'/','')
logo.textContent += path.substring(0,path.indexOf('/'));
};
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.